public interface DatabaseEnvironment
For the methods executeQuery
and executeUpdate
that support parameters
(the ones that have the parameter Object[] parameterValues
), take the following into
account:
parameterValues
has to match the number of
"?" in the query.For example,
SELECT * FROM customer WHERE last_name = ?
The Virtual DataPort server will format each value depending on the class of the object. For example:
java.lang.Double
, java.lang.Integer
,
etc.), it replaces the placeholder with the number, without quotes.
java.lang.String
, it surrounds the value with single
quotes.Modifier and Type | Method and Description |
---|---|
Transaction |
createTransaction()
Creates a new transaction.
|
ResultSet |
executeQuery(String query)
Executes a query against the VDP server.
|
ResultSet |
executeQuery(String query,
long queryTimeout,
long chunkTimeout,
long chunkSize)
Executes a query against the VDP server.
|
ResultSet |
executeQuery(String query,
Object[] parameterValues)
Executes a parameterized query.
|
ResultSet |
executeQuery(String query,
Object[] parameterValues,
long queryTimeout,
long chunkTimeout,
long chunkSize)
Executes a parameterized query specifying the timeouts.
|
int |
executeUpdate(String query)
Executes an INSERT, UPDATE or DELETE query.
|
int |
executeUpdate(String query,
Object[] parameterValues)
Executes a parameterized INSERT, UPDATE or DELETE query.
|
int |
executeUpdate(String query,
Object[] parameterValues,
long queryTimeout)
Executes a parameterized INSERT, UPDATE or DELETE query specifying the timeouts.
|
String |
executeVqlCommand(String command)
Executes a VQL command.
|
String |
executeVqlCommand(String command,
long queryTimeout)
Executes a VQL command with a timeout.
|
String |
executeVqlCommand(String databaseName,
String command)
Executes a VQL command over the given database.
|
String |
executeVqlCommand(String databaseName,
String command,
long queryTimeout)
Executes a VQL command over the given database with a timeout.
|
String |
getDatabaseProperty(String name)
Obtains a database property.
|
void |
joinTransaction(StoredProcedure storedProcedure)
Joins a stored procedure to the current transaction.
|
void |
log(int level,
String logMessage)
Adds an entry log, with the specified level.
|
DatabaseFunction |
lookupFunction(String functionName,
int arity)
Obtains a handler to execute a function.
|
StoredProcedureExecutor |
lookupProcedure(String procedureName)
Obtains a stored procedure reference, which can be used to execute it.
|
ResultSet executeQuery(String query) throws StoredProcedureException
query
- the VQL query.StoredProcedureException
- If there is some error executing the query.ResultSet executeQuery(String query, long queryTimeout, long chunkTimeout, long chunkSize) throws StoredProcedureException
query
- the VQL query.queryTimeout
- query timeout configuration.chunkTimeout
- chunk timeout configuration.chunkSize
- chunk size configuration.StoredProcedureException
- If there is some error executing the query.ResultSet executeQuery(String query, Object[] parameterValues) throws StoredProcedureException
query
- a VQL query that may contain one or more '?' parameter placeholdersparameterValues
- the list of values to be replaced in the query. The number of elements in
this array has to match the number of "?" in the query.StoredProcedureException
- If there is some error executing the query, or the parameters
supplied are invalid.ResultSet executeQuery(String query, Object[] parameterValues, long queryTimeout, long chunkTimeout, long chunkSize) throws StoredProcedureException
query
- a VQL query that may contain one or more '?' parameter placeholdersparameterValues
- the list of values to be replaced in the query. The number of elements in
this array has to match the number of "?" in the query.queryTimeout
- query timeout configuration.chunkTimeout
- chunk timeout configuration.chunkSize
- chunk size configuration.StoredProcedureException
- If there is some error executing the query, or the parameters
supplied are invalid.StoredProcedureExecutor lookupProcedure(String procedureName) throws StoredProcedureException
procedureName
- the name of the stored procedure.StoredProcedureException
- If there is some error obtaining the procedure.DatabaseFunction lookupFunction(String functionName, int arity) throws StoredProcedureException
functionName
- the name of the function.arity
- the arity of the function.StoredProcedureException
- If there is some error obtaining the function.String getDatabaseProperty(String name) throws StoredProcedureException
name
- the name of the property. The available properties are:
StoredProcedureException
- If there is some error retrieving the propertyvoid log(int level, String logMessage)
level
- the desired log level. Should be one of these:
logMessage
- the message to be logged.int executeUpdate(String query) throws StoredProcedureException
query
- the query to be executed.StoredProcedureException
- If there is an error during the execution of the query.int executeUpdate(String query, Object[] parameterValues) throws StoredProcedureException
query
- a VQL query that may contain one or more '?' parameter placeholdersparameterValues
- the list of values to be replaced in the query. The number of elements in
this array has to match the number of "?" in the query.StoredProcedureException
- If there is some error executing the query, or the parameters
supplied are invalid.int executeUpdate(String query, Object[] parameterValues, long queryTimeout) throws StoredProcedureException
query
- a VQL query that may contain one or more '?' parameter place holdersparameterValues
- the list of values to be replaced in the query. The number of elements in
this array has to match the number of "?" in the query.queryTimeout
- query timeout configuration.StoredProcedureException
- If there is an error executing the query, or the parameters
supplied are invalid.String executeVqlCommand(String databaseName, String command) throws StoredProcedureException
databaseName
- database where the command is executedcommand
- command to be executedStoredProcedureException
- If there is some error executing the command, or the parameters
supplied are invalid.String executeVqlCommand(String command, long queryTimeout) throws StoredProcedureException
command
- command to be executedqueryTimeout
- query timeout configuration.StoredProcedureException
- If there is some error executing the command, or the parameters
supplied are invalid.String executeVqlCommand(String databaseName, String command, long queryTimeout) throws StoredProcedureException
databaseName
- database where the command is executedcommand
- command to be executedqueryTimeout
- query timeout configuration.StoredProcedureException
- If there is some error executing the command, or the parameters
supplied are invalid.String executeVqlCommand(String command) throws StoredProcedureException
command
- command to be executedStoredProcedureException
- If there is some error executing the command, or the parameters
supplied are invalid.Transaction createTransaction() throws NotSupportedException, SystemException
NotSupportedException
- If a transaction has already been started.SystemException
- If there is an error starting the transaction.void joinTransaction(StoredProcedure storedProcedure) throws RollbackException, SystemException
storedProcedure
- the procedure to be joined to the transaction.RollbackException
- If there is an error joining the transaction.SystemException
- If there is an error joining the transaction.Copyright © 2022 Denodo Technologies. All rights reserved.