org.drizzle.jdbc.internal.common
Interface Protocol

All Known Implementing Classes:
MySQLProtocol

public interface Protocol

User: marcuse Date: Jan 14, 2009 Time: 4:05:47 PM


Method Summary
 void addToBatch(Query dQuery)
          adds a query to the batch
 void cancelCurrentQuery()
           
 void clearBatch()
          clears the current batch
 void close()
          closes the connection to the server
 void commit()
          commits the current transaction
 boolean createDB()
          should a database be created if it does not exist ?
 java.util.List<QueryResult> executeBatch()
          executes the batch of queries
 QueryResult executeQuery(Query dQuery)
          executes a query
 QueryResult executeQuery(Query createQuery, java.io.InputStream inputStream)
           
 java.lang.String getDatabase()
          returns the current used database
 SupportedDatabases getDatabaseType()
           
 java.lang.String getHost()
          returns the host
 QueryResult getMoreResults()
           
 java.lang.String getPassword()
          the current password
 int getPort()
          returns the port we are connected to
 boolean getReadonly()
          check if it is possble to execute writing operations on this connection
 java.lang.String getServerVariable(java.lang.String s)
           
 java.lang.String getServerVersion()
          returns the server version string
 java.lang.String getUsername()
          returns the current connected username
 boolean isClosed()
          returns true if the connection has been closed
 boolean ping()
          checks whether the connectiion is still valid
 void releaseSavepoint(java.lang.String savepoint)
          releases the savepoint
 void rollback()
          rolls back the current transaction
 void rollback(java.lang.String savepoint)
          rolls back to the given save point
 void selectDB(java.lang.String database)
          selects what database to use
 void setReadonly(boolean readOnly)
          sets whether this connection should be read only

TODO: actually enforce this

 void setSavepoint(java.lang.String savepoint)
          sets a save point
 java.util.List<RawPacket> startBinlogDump(int startPos, java.lang.String filename)
           
 boolean supportsPBMS()
           
 void timeOut()
           
 

Method Detail

close

void close()
           throws QueryException
closes the connection to the server

Throws:
QueryException - if there is a communication problem with the server

isClosed

boolean isClosed()
returns true if the connection has been closed

Returns:
true if the connection is closed

selectDB

void selectDB(java.lang.String database)
              throws QueryException
selects what database to use

Parameters:
database - the database
Throws:
QueryException - if there is a problem selecting the database

getServerVersion

java.lang.String getServerVersion()
returns the server version string

Returns:

setReadonly

void setReadonly(boolean readOnly)
sets whether this connection should be read only

TODO: actually enforce this

Parameters:
readOnly - if the connection should be read only

getReadonly

boolean getReadonly()
check if it is possble to execute writing operations on this connection

Returns:
true if we can update etc

commit

void commit()
            throws QueryException
commits the current transaction

Throws:
QueryException - if there is a problem committing the txn

rollback

void rollback()
              throws QueryException
rolls back the current transaction

Throws:
QueryException - if there is a problem rolling back

rollback

void rollback(java.lang.String savepoint)
              throws QueryException
rolls back to the given save point

Parameters:
savepoint - the save point to roll back to
Throws:
QueryException - if there is a problem rolling back

setSavepoint

void setSavepoint(java.lang.String savepoint)
                  throws QueryException
sets a save point

Parameters:
savepoint - the save point name
Throws:
QueryException - if there is a problem setting the save point

releaseSavepoint

void releaseSavepoint(java.lang.String savepoint)
                      throws QueryException
releases the savepoint

Parameters:
savepoint - the name of the savepoint to release
Throws:
QueryException - if there is a problem releasing the save point

getHost

java.lang.String getHost()
returns the host

Returns:
the host we are connected to

getPort

int getPort()
returns the port we are connected to

Returns:
the port

getDatabase

java.lang.String getDatabase()
returns the current used database

Returns:

getUsername

java.lang.String getUsername()
returns the current connected username

Returns:
the username

getPassword

java.lang.String getPassword()
the current password

Returns:
the password

ping

boolean ping()
             throws QueryException
checks whether the connectiion is still valid

Returns:
true if it is valid
Throws:
QueryException - if there is a problem communicating

executeQuery

QueryResult executeQuery(Query dQuery)
                         throws QueryException
executes a query

Parameters:
dQuery - the query to execute
Returns:
a query result.
Throws:
QueryException - if there is a problem with the query

addToBatch

void addToBatch(Query dQuery)
adds a query to the batch

Parameters:
dQuery - the query to add

executeBatch

java.util.List<QueryResult> executeBatch()
                                         throws QueryException
executes the batch of queries

Returns:
a list of query results
Throws:
QueryException - if there is a problem

clearBatch

void clearBatch()
clears the current batch


startBinlogDump

java.util.List<RawPacket> startBinlogDump(int startPos,
                                          java.lang.String filename)
                                          throws BinlogDumpException
Throws:
BinlogDumpException

getDatabaseType

SupportedDatabases getDatabaseType()

supportsPBMS

boolean supportsPBMS()

getServerVariable

java.lang.String getServerVariable(java.lang.String s)
                                   throws QueryException
Throws:
QueryException

createDB

boolean createDB()
should a database be created if it does not exist ?


executeQuery

QueryResult executeQuery(Query createQuery,
                         java.io.InputStream inputStream)
                         throws QueryException
Throws:
QueryException

cancelCurrentQuery

void cancelCurrentQuery()
                        throws QueryException
Throws:
QueryException

timeOut

void timeOut()
             throws QueryException
Throws:
QueryException

getMoreResults

QueryResult getMoreResults()
                           throws QueryException
Throws:
QueryException


Copyright © 2012. All Rights Reserved.