LibWeb::Database - A generic database driver for libweb applications


LibWeb documentation  | view source Contained in the LibWeb distribution.

Index


NAME

Top

LibWeb::Database - A generic database driver for libweb applications

SUPPORTED PLATFORMS

Top

BSD, Linux, Solaris and Windows.

REQUIRE

Top

ISA

Top

SYNOPSIS

Top

  use LibWeb::Database;
  my $db = new LibWeb::Database();

  my ($sql, $user, $host, $fetch, $result);
  $sql = "select USER_NAME, USER_HOST ".
         "from USER_TABLE ".
         "where USER_LOGIN_STATUS = ".
         "LOGIN_INDICATOR";

  $fetch = $db->query(
                       -sql => $sql,
                       -bind_cols => [\$user, \$host]
                     );

  while ( &$fetch ) {
      $result .= "$user $host <BR>\n";
  }

  $db->done();

  print "Content-Type: text/html\n\n";
  print "<P> The following users have logged in: $result";

ABSTRACT

Top

As long as you have the proper DBD installed for your database, you can use this class to interact with your database in your LibWeb applications.

The current version of LibWeb::Database is available at

   http://libweb.sourceforge.net

Several LibWeb applications (LEAPs) have be written, released and are available at

   http://leaps.sourceforge.net

TYPOGRAPHICAL CONVENTIONS AND TERMINOLOGY

Top

Variables in all-caps (e.g. USER_TABLE) are those variables set through LibWeb's rc file. Please read LibWeb::Core for more information. Method's parameters in square brackets means optional.

DESCRIPTION

Top

do()

Params:

  -sql => 

Pre:

Post:

query()

Params:

  -sql=>, -bind_cols=> [, -want_hash=> ]

Pre:

Post:

finish()

Finish a statement execution.

disconnect()

Disconnect the current database session.

done()

Finish a statement execution and disconnect the current database session.

AUTHORS

Top

Colin Kong (colin.kong@toronto.edu)

CREDITS

Top

BUGS

Top

SEE ALSO

Top

DBI, LibWeb::Core.


LibWeb documentation  | view source Contained in the LibWeb distribution.