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:
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.TO_DATE( <property "datepattern" of the i18n of the Server> , <string that represents the date object converted using the "datepattern" of the i18n of the Server> )
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 com.denodo.vdb.util.SynchronizeException, StoredProcedureException
procedureName
- the name of the stored procedure.com.denodo.vdb.util.SynchronizeException
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:
StoredProcedureExecutor#LOG_TRACE
StoredProcedureExecutor#LOG_DEBUG
StoredProcedureExecutor#LOG_INFO
StoredProcedureExecutor#LOG_WARN
StoredProcedureExecutor#LOG_ERROR
StoredProcedureExecutor#LOG_FATAL
logMessage
- the message to be logged.int executeUpdate(String query) throws StoredProcedureException
query
- the query to be executed.StoredProcedureException
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 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.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
SystemException
void joinTransaction(StoredProcedure storedProcedure) throws RollbackException, SystemException
storedProcedure
- the procedure to be joined to the transaction.RollbackException
SystemException
Copyright © 2019 Denodo Technologies. All rights reserved.