📄 connection.pm.in
字号:
# Copyright (c) 2000-2001 David Muse# See the file COPYING for more informationpackage SQLRelay::Connection;require DynaLoader;@ISA = 'DynaLoader';$VERSION = '@SQLR_VERSION@';bootstrap SQLRelay::Connection $VERSION;1;__END__=head1 NAME SQLRelay::Connection - Perl API for SQL Relay=head1 SYNOPSIS use SQLRelay::Connection; use SQLRelay::Cursor; my $sc=SQLRelay::Connection->new("testhost",9000,"", "testuser","testpassword",0,1); my $ss=SQLRelay::Cursor->new($sc); $ss->sendQuery("select table_name from user_tables"); $sc->endSession(); for (my $i=0; $i<$ss->rowCount(); $i++) { print $ss->getField($i,"table_name"), "\n"; }=head1 DESCRIPTION SQLRelay::Connection new(server, port, socket, user, password, retrytime, tries); # Initiates a connection to "server" on "port" # or to the unix "socket" on the local machine # and authenticates with "user" and "password". # Failed connections will be retried for # "tries" times on interval "retrytime". # If "tries" is 0 then retries will continue # forever. If "retrytime" is 0 then retries # will be attempted on a default interval. # # If the "socket" parameter is neither # NULL nor "" then an attempt will be made to # connect through it before attempting to # connect to "server" on "port". If it is # NULL or "" then no attempt will be made to # connect through the socket. DESTROY(); # Disconnects and ends the session if # it hasn't been ended already. endSession(); # Ends the session. suspendSession(); # Leaves the session open so another client # can connect to it. getConnectionPort(); # Returns the inet port that the client is # communicating over. This parameter may be # passed to another client for use in # the resumeSession() command below. # Note: the value returned by this method is # only valid after a call to suspendSession(). getConnectionSocket(); # Returns the unix socket that the client is # communicating over. This parameter may be # passed to another client for use in # the resumeSession() command below. # Note: the value returned by this method is # only valid after a call to suspendSession(). resumeSession(port,socket); # Resumes a session previously left open # using suspendSession(). # Returns true on success and false on failure. ping(); # Returns true if the database is up and false # if it's down. identify(); # Returns the type of database: # oracle8, postgresql, mysql, etc. dbVersion(); # Returns the version of the database bindFormat(); # Returns a string representing the format # of the bind variables used in the db. autoCommitOn(); # Instructs the database to perform a commit # after every successful query. # Returns true if setting autocommit on succeeded # and false if it failed. autoCommitOff(); # Instructs the database to wait for the # client to tell it when to commit. # Returns true if setting autocommit off succeeded # and false if it failed. commit(); # Issues a commit. Returns true if the commit # succeeded, false if it failed. rollback(); # Issues a rollback. Returns true if the rollback # succeeded, false if it failed. debugOn(); # Causes verbose debugging information to be # sent to standard output. Another way to do # this is to start a query with "-- debug\n". debugOff(); # Turns debugging off. getDebug(); # Returns true if debugging is currently on and false # if debugging is currently off.=head1 AUTHOR David Muse david.muse@firstworks.com=cut
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -