public class SQLRConnection
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
long |
connection
connection is used internally, it's just
public to make the JNI wrapper work faster.
|
Constructor and Description |
---|
SQLRConnection(java.lang.String server,
short port,
java.lang.String socket,
java.lang.String user,
java.lang.String password,
int retrytime,
int tries)
Initiates a connection to "server" on "port"
or to the unix "socket" on the local machine
and auths with "user" and "password".
|
Modifier and Type | Method and Description |
---|---|
boolean |
autoCommitOff()
Instructs the database to wait for the
client to tell it when to commit.
|
boolean |
autoCommitOn()
Instructs the database to perform a commit
after every successful query.
|
boolean |
begin()
Begins a transaction.
|
java.lang.String |
bindFormat()
Returns a string representing the format
of the bind variables used in the db.
|
java.lang.String |
clientVersion()
Returns the version of the sqlrelay client software
|
boolean |
commit()
Issues a commit.
|
java.lang.String |
dbHostName()
Returns the host name of the database
|
java.lang.String |
dbIpAddress()
Returns the ip address of the database
|
java.lang.String |
dbVersion()
Returns the version of the database
|
void |
debugOff()
Turns debugging off.
|
void |
debugOn()
Causes verbose debugging information to be
sent to standard output.
|
void |
delete()
Disconnects and ends the session if
it hasn't been ended already.
|
void |
disableEncryption()
Disables encryption.
|
void |
enableKerberos(java.lang.String service,
java.lang.String mech,
java.lang.String flags)
Enables Kerberos authentication and encryption.
|
void |
enableTls(java.lang.String version,
java.lang.String cert,
java.lang.String password,
java.lang.String ciphers,
java.lang.String validate,
java.lang.String ca,
short depth)
Enables TLS/SSL encryption, and optionally authentication.
|
void |
endSession()
Ends the session.
|
java.lang.String |
errorMessage()
If an operation failed and generated an error,
the error message is available here.
|
long |
errorNumber()
If an operation failed and generated an
error, the error number is available here.
|
java.lang.String |
getClientInfo()
Returns the string that was set by setClientInfo().
|
short |
getConnectionPort()
Returns the inet port that the connection is
communicating over.
|
java.lang.String |
getConnectionSocket()
Returns the unix socket that the connection
is communicating over.
|
java.lang.String |
getCurrentDatabase()
Returns the database/schema that is currently in use
|
boolean |
getDebug()
Returns 0 if debugging is off and 1 if
debugging is on.
|
long |
getLastInsertId()
Returns the value of the autoincrement
column for the last insert
|
java.lang.String |
identify()
Returns the type of database:
oracle, postgresql, mysql, etc.
|
boolean |
ping()
Returns 1 if the database is up and 0
if it's down.
|
boolean |
resumeSession(short port,
java.lang.String socket)
Resumes a session previously left open
using suspendSession().
|
boolean |
rollback()
Issues a rollback.
|
boolean |
selectDatabase(java.lang.String database)
Sets the current database/schema to "database"
|
java.lang.String |
serverVersion()
Returns the version of the sqlrelay server software
|
void |
setAuthenticationTimeout(int timeoutsec,
int timeoutusec)
Sets the authentication timeout in seconds and
milliseconds.
|
boolean |
setClientInfo(java.lang.String clientinfo)
Allows you to set a string that will be passed to the
server and ultimately included in server-side logging
along with queries that were run by this instance of
the client.
|
void |
setConnectTimeout(int timeoutsec,
int timeoutusec)
Sets the server connect timeout in seconds and
milliseconds.
|
boolean |
setDebugFile(java.lang.String debugfile)
Allows you to specify a file to write debug to.
|
void |
setResponseTimeout(int timeoutsec,
int timeoutusec)
Sets the response timeout (for queries, commits, rollbacks,
pings, etc.) in seconds and milliseconds.
|
boolean |
suspendSession()
Disconnects this connection from the current
session but leaves the session open so
that another connection can connect to it
using resumeSession().
|
public long connection
public SQLRConnection(java.lang.String server, short port, java.lang.String socket, java.lang.String user, java.lang.String password, int retrytime, int tries)
public void delete()
public void setConnectTimeout(int timeoutsec, int timeoutusec)
public void setAuthenticationTimeout(int timeoutsec, int timeoutusec)
public void setResponseTimeout(int timeoutsec, int timeoutusec)
public void enableKerberos(java.lang.String service, java.lang.String mech, java.lang.String flags)
public void enableTls(java.lang.String version, java.lang.String cert, java.lang.String password, java.lang.String ciphers, java.lang.String validate, java.lang.String ca, short depth)
public void disableEncryption()
public void endSession()
public boolean suspendSession()
public short getConnectionPort()
public java.lang.String getConnectionSocket()
public boolean resumeSession(short port, java.lang.String socket)
public boolean ping()
public java.lang.String identify()
public java.lang.String dbVersion()
public java.lang.String dbHostName()
public java.lang.String dbIpAddress()
public java.lang.String serverVersion()
public java.lang.String clientVersion()
public java.lang.String bindFormat()
public boolean selectDatabase(java.lang.String database)
public java.lang.String getCurrentDatabase()
public long getLastInsertId()
public boolean autoCommitOn()
public boolean autoCommitOff()
public boolean begin()
public boolean commit()
public boolean rollback()
public java.lang.String errorMessage()
public long errorNumber()
public void debugOn()
public void debugOff()
public boolean getDebug()
public boolean setDebugFile(java.lang.String debugfile)
public boolean setClientInfo(java.lang.String clientinfo)
public java.lang.String getClientInfo()