public interface Protocol
| Modifier and Type | Method and Description |
|---|---|
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 ?
|
List<QueryResult> |
executeBatch()
executes the batch of queries
|
QueryResult |
executeQuery(Query dQuery)
executes a query
|
QueryResult |
executeQuery(Query createQuery,
InputStream inputStream) |
String |
getCatalog()
Retrieves this
Connection object's current catalog name. |
String |
getDatabase()
returns the current used database
|
SupportedDatabases |
getDatabaseType() |
String |
getHost()
returns the host
|
QueryResult |
getMoreResults() |
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
|
String |
getServerVariable(String s) |
String |
getServerVersion()
returns the server version string
|
String |
getUsername()
returns the current connected username
|
boolean |
isClosed()
returns true if the connection has been closed
|
boolean |
noPrepStmtCache() |
boolean |
ping()
checks whether the connectiion is still valid
|
void |
releaseSavepoint(String savepoint)
releases the savepoint
|
void |
rollback()
rolls back the current transaction
|
void |
rollback(String savepoint)
rolls back to the given save point
|
void |
selectDB(String database)
selects what database to use
|
void |
setCatalog(String catalog)
Sets the given catalog name in order to select a subspace of this
Connection object's database in
which to work. |
void |
setReadonly(boolean readOnly)
sets whether this connection should be read only
TODO: actually enforce this
|
void |
setSavepoint(String savepoint)
sets a save point
|
List<RawPacket> |
startBinlogDump(int startPos,
String filename) |
boolean |
supportsPBMS() |
void |
timeOut() |
void close()
throws QueryException
QueryException - if there is a communication problem with the serverboolean isClosed()
void selectDB(String database) throws QueryException
database - the databaseQueryException - if there is a problem selecting the databaseString getServerVersion()
void setReadonly(boolean readOnly)
readOnly - if the connection should be read onlyboolean getReadonly()
void commit()
throws QueryException
QueryException - if there is a problem committing the txnvoid rollback()
throws QueryException
QueryException - if there is a problem rolling backvoid rollback(String savepoint) throws QueryException
savepoint - the save point to roll back toQueryException - if there is a problem rolling backvoid setSavepoint(String savepoint) throws QueryException
savepoint - the save point nameQueryException - if there is a problem setting the save pointvoid releaseSavepoint(String savepoint) throws QueryException
savepoint - the name of the savepoint to releaseQueryException - if there is a problem releasing the save pointString getHost()
int getPort()
String getDatabase()
String getUsername()
String getPassword()
boolean ping()
throws QueryException
QueryException - if there is a problem communicatingQueryResult executeQuery(Query dQuery) throws QueryException
dQuery - the query to executeQueryException - if there is a problem with the queryvoid addToBatch(Query dQuery)
dQuery - the query to addList<QueryResult> executeBatch() throws QueryException
QueryException - if there is a problemvoid clearBatch()
List<RawPacket> startBinlogDump(int startPos, String filename) throws BinlogDumpException
BinlogDumpExceptionSupportedDatabases getDatabaseType()
boolean supportsPBMS()
String getServerVariable(String s) throws QueryException
QueryExceptionboolean createDB()
QueryResult executeQuery(Query createQuery, InputStream inputStream) throws QueryException
QueryExceptionvoid cancelCurrentQuery()
throws QueryException
QueryExceptionvoid timeOut()
throws QueryException
QueryExceptionQueryResult getMoreResults() throws QueryException
QueryExceptionvoid setCatalog(String catalog) throws QueryException
Connection object's database in
which to work.
If the protocol does not support catalogs, it will silently ignore this request.catalog - the name of a catalog (subspace in this Connection object's database) in which to
workQueryException - if a database access error occurs or this method is called on a closed connectiongetCatalog()String getCatalog() throws QueryException
Connection object's current catalog name.
null if there is noneQueryException - if a database access error occurs or this method is called on a closed connectionsetCatalog(java.lang.String)boolean noPrepStmtCache()
Copyright © 2016. All rights reserved.