public interface AQServerConnection
Modifier and Type | Method and Description |
---|---|
void |
changeDatabase(String name)
Change database in the current connection.
|
void |
changeSchema(String name)
Change schema in the current connection.
|
void |
commit()
Commits a transaction.
|
void |
connect()
Establish SQL connection to the server.
|
void |
connect(Object password)
Establish SQL connection to the server with the provided password.
|
void |
connect(Object username,
Object password)
Establish SQL connection to the server with the provided user credentials.
|
void |
disconnect()
Disconnect a server connection.
|
boolean |
execute(String sql)
Execute a query.
|
AQResultSet |
executeQuery(String sql)
Execute a query to get a result set.
|
AQScriptResult |
executeScript(String script)
Executes a script, which may contain multiple statements, and may produce multiple
result sets.
|
AQDataSet |
executeSnapshot(String sql)
Execute query and extract data into AQDataSet.
|
int |
executeUpdate(String sql)
Execute an update query.
|
String |
getCurrentDatabase()
Get the current database the connection is connected to.
|
Connection |
getJdbcConnection()
Returns underlying JDBC connection.
|
AQMetadata |
getMetadata()
Get metadata object which allows for introspection of the database structure.
|
String |
getName()
Get connection name (as seen in the schema tree).
|
AQScriptOptions |
getScriptOptions()
Returns an instance of AQScriptOption object associated with the given connection.
|
String |
getSessionID()
To get the connection session id.
|
String |
getVersionString()
Get database/server version.
|
boolean |
isCaseSensitive()
Returns true if names in this connections are case sensitive.
|
boolean |
isConnected()
Get the connection status of the connection session.
|
AQScriptOptions |
newScriptOptions()
Creates a copy of AQScriptOption object associated with the given connection.
|
AQScriptParser |
newScriptParser()
Creates a new script parser object.
|
AQSqlFormatter |
newSqlFormat()
Creates new SQL formatter object.
|
void |
rollback()
Rolls back a transaction.
|
void |
setAutoCommit(boolean enable)
Sets auto-commit mode.
|
String |
sqlEncode(String string)
Escapes single quote characters in a string to
make it safe for inclusion into a SQL query.
|
String getName()
String getSessionID()
AQMetadata getMetadata()
boolean execute(String sql) throws Exception
sql
- The SQL statement.true
: If the first result is a ResultSet
object;
false
: If it is an update count or there are no results.Exception
- on error. eg. if SQL statementint executeUpdate(String sql) throws Exception
sql
- The SQL statement.Exception
- If SQL statement is not a data manipulation statement.AQResultSet executeQuery(String sql) throws Exception
sql
- The SQL statement.Exception
- If SQL statement is a data manipulation statement.AQDataSet executeSnapshot(String sql) throws Exception
sql
- The SQL statement.Exception
- on error.void connect() throws Exception
Exception
- on error.void connect(Object password) throws Exception
password
- A String
password or a AQOpaqueObject
with the password.Exception
- on error.void connect(Object username, Object password) throws Exception
username
- A String
or a AQOpaqueObject
with the user name.password
- A String
password or a AQOpaqueObject
with the password.Exception
- on error.boolean isConnected()
void disconnect()
String getVersionString()
boolean isCaseSensitive()
void changeDatabase(String name) throws Exception
name
- The name of the database.Exception
- On errorvoid changeSchema(String name) throws Exception
name
- The name of the schema.Exception
- On errorAQScriptResult executeScript(String script) throws Exception
script
- The script to be executed.Exception
- On errorString sqlEncode(String string)
string
- The string to be encoded.AQScriptOptions getScriptOptions()
AQScriptOptions newScriptOptions()
AQSqlFormatter newSqlFormat()
AQScriptParser newScriptParser()
String getCurrentDatabase()
Connection getJdbcConnection()
Connection
void setAutoCommit(boolean enable) throws Exception
Connection.setAutoCommit(boolean)
.enable
- to enable/disableException
- On errorvoid rollback() throws Exception
Connection.rollback()
.Exception
- On errorvoid commit() throws Exception
Connection.commit()
.Exception
- On error
Copyright © 2017 AquaFold, Inc. All Rights Reserved. Use is subject to license terms.