nl.gx.webmanager.services.datasource
Interface QueryManagerService


Deprecated. Use DataSourceManager and standard java JDBC api instead.

@Deprecated
public interface QueryManagerService

This interface represents query manager services. A query manager service implements generic query execution methods for ease of development only.

Note: The QueryResult instances that some of this class's methods return load the complete query result in memory. These methods should thus not be used for queries that potentially return large result sets because that might cause an OutOfMemoryException.

Author:
ivol

Field Summary
static java.lang.String MEDIAREPOSITORY_DBID
          Deprecated. Identifier to use for accessing the media repository database
static java.lang.String TIMESTAMP_DBID
          Deprecated. Identifier to use for accessing the timestamp database
static java.lang.String WEBADMIN_DBID
          Deprecated. Identifier to use for accessing the webadmin database
 
Method Summary
 QueryResult callStoredProcedure(javax.sql.DataSource datasource, java.lang.String procedure, java.lang.Object[] args)
          Deprecated. Because of potential performance and scalability problems it is better to use the standard java JDBC api.
 QueryResult executeSelect(javax.sql.DataSource datasource, java.lang.String statement, java.lang.Object[] args)
          Deprecated. Because of potential performance and scalability problems it is better to use the standard java JDBC api.
 boolean executeStoredProcedure(javax.sql.DataSource datasource, java.lang.String procedure, java.lang.Object[] args)
          Deprecated. Because of potential performance and scalability problems it is better to use the standard java JDBC api.
 int executeUpdate(javax.sql.DataSource datasource, java.lang.String statement, java.lang.Object[] args)
          Deprecated. Because of potential performance and scalability problems it is better to use the standard java JDBC api.
 int getAsInt(java.lang.Object object)
          Deprecated. Utility method which is not needed when using the standard java JDBC api.
 javax.sql.DataSource getDataSourceById(java.lang.String dbId)
          Deprecated. Use DataSourceManager.getDataSource(String) instead.
 javax.sql.DataSource getDataSourceByName(java.lang.String fullDataSourceName)
          Deprecated. Use DataSourceManager.getDataSource(String) instead.
 

Field Detail

MEDIAREPOSITORY_DBID

static final java.lang.String MEDIAREPOSITORY_DBID
Deprecated. 
Identifier to use for accessing the media repository database

See Also:
Constant Field Values

TIMESTAMP_DBID

static final java.lang.String TIMESTAMP_DBID
Deprecated. 
Identifier to use for accessing the timestamp database

See Also:
Constant Field Values

WEBADMIN_DBID

static final java.lang.String WEBADMIN_DBID
Deprecated. 
Identifier to use for accessing the webadmin database

See Also:
Constant Field Values
Method Detail

getDataSourceById

@Deprecated
javax.sql.DataSource getDataSourceById(java.lang.String dbId)
                                       throws java.sql.SQLException
Deprecated. Use DataSourceManager.getDataSource(String) instead.

Returns the datasource by the given database id. It will retrieve the datasource name from the configuration management service and the database id provided should equal the name of the parameter under which the full datasource name is stored. It is recommended to use the predefined database ids in this interface. For example: getDataSourceById(QueryManagerService.WEBADMIN_DBID);

Parameters:
dbId - Database id of which the datasource should be retrieved
Returns:
The datasource for the given database id
Throws:
java.sql.SQLException - in case an error occurred while retrieving the datasource

getDataSourceByName

@Deprecated
javax.sql.DataSource getDataSourceByName(java.lang.String fullDataSourceName)
                                         throws java.sql.SQLException
Deprecated. Use DataSourceManager.getDataSource(String) instead.

Returns the datasource by the given full datasource name.

Parameters:
fullDataSourceName - Datasource name of the datasource to retrieve
Returns:
Datasource for the given DataSource name
Throws:
java.sql.SQLException - in case an error occurred while retrieving the datasource

executeSelect

@Deprecated
QueryResult executeSelect(javax.sql.DataSource datasource,
                                     java.lang.String statement,
                                     java.lang.Object[] args)
                          throws java.sql.SQLException
Deprecated. Because of potential performance and scalability problems it is better to use the standard java JDBC api.

Performs a select query and returns the result.

Parameters:
datasource - Datasource to execute the query on
statement - Statement to execute. Recommended is to use prepared statements.
args - Input arguments of the statement in case of prepared statements.
Returns:
The results of the query QueryResult object.
Throws:
java.sql.SQLException - If a SQL exception occurred

executeUpdate

@Deprecated
int executeUpdate(javax.sql.DataSource datasource,
                             java.lang.String statement,
                             java.lang.Object[] args)
                  throws java.sql.SQLException
Deprecated. Because of potential performance and scalability problems it is better to use the standard java JDBC api.

Executes a SQL statement that must be either a INSERT, UPDATE or DELETE statement

Parameters:
datasource - Datasource to execute the stored procedure on
procedure - Stored procedure to execute.
args - Input arguments of the stored procedure.
Returns:
either (1) the row count for INSERT, UPDATE, or DELETE statements or (2) 0 for SQL statements that return nothing
Throws:
java.sql.SQLException - If a SQL exception occurred

executeStoredProcedure

@Deprecated
boolean executeStoredProcedure(javax.sql.DataSource datasource,
                                          java.lang.String procedure,
                                          java.lang.Object[] args)
                               throws java.sql.SQLException
Deprecated. Because of potential performance and scalability problems it is better to use the standard java JDBC api.

Execute any stored procedure

Parameters:
datasource - Datasource to execute the stored procedure on
procedure - Stored procedure to execute.
args - Input arguments of the stored procedure.
Returns:
The execute method returns a boolean to indicate the form of the first result.
Throws:
java.sql.SQLException - If a SQL exception occurred

callStoredProcedure

@Deprecated
QueryResult callStoredProcedure(javax.sql.DataSource datasource,
                                           java.lang.String procedure,
                                           java.lang.Object[] args)
                                throws java.sql.SQLException
Deprecated. Because of potential performance and scalability problems it is better to use the standard java JDBC api.

Performs a stored procedure and returns the result.

Parameters:
datasource - Datasource to execute the stored procedure on
procedure - Stored procedure to execute.
args - Input arguments of the stored procedure.
Returns:
The results of the query QueryResult object.
Throws:
java.sql.SQLException - If a SQL exception occurred

getAsInt

@Deprecated
int getAsInt(java.lang.Object object)
Deprecated. Utility method which is not needed when using the standard java JDBC api.

Returns an object that was returned as result of a query as an Integer. This is necessary for the generic executeSelect since a getObject on a number result in oracle does not return an Integer but a BigDecimal

Parameters:
object - Object of the result query to be converted to an Integer
Returns:
Value of the object as Integer
Throws:
java.lang.IllegalArgumentException - if the object is not an Integer, BigInteger or BigDecimal


Copyright © 2007-2011 GX Software BV. All Rights Reserved.