org.caleigo.core.service
Class JDBCPreparedStatementDataService

java.lang.Object
  extended byorg.caleigo.core.AbstractDataService
      extended byorg.caleigo.core.service.JDBCPreparedStatementDataService
All Implemented Interfaces:
IDataService, IDistributable, ISecureService, IService, java.io.Serializable

public class JDBCPreparedStatementDataService
extends AbstractDataService

Version:
1.00
Author:
Dennis Zikovic
See Also:
Serialized Form

Nested Class Summary
protected  class JDBCPreparedStatementDataService.ConnectionPool
           
protected  class JDBCPreparedStatementDataService.JDBCDataTransaction
           
 
Nested classes inherited from class org.caleigo.core.AbstractDataService
AbstractDataService.AbstractDataTransaction
 
Field Summary
static int DEFAULT_MAX_CONNECTION_POOL_SIZE
           
 
Fields inherited from class org.caleigo.core.AbstractDataService
DEFAULT_TIMEOUT
 
Constructor Summary
JDBCPreparedStatementDataService(IDataSourceDescriptor descriptor)
          Default constructor for JDBCDataService.
JDBCPreparedStatementDataService(IDataSourceDescriptor descriptor, java.lang.Object serviceIdentity, java.lang.String url)
           
JDBCPreparedStatementDataService(IDataSourceDescriptor descriptor, java.lang.Object serviceIdentity, java.lang.String url, java.util.Properties info, int maxConnectionPoolSize)
           
JDBCPreparedStatementDataService(IDataSourceDescriptor descriptor, java.lang.Object serviceIdentity, java.lang.String url, java.lang.String user, java.lang.String password)
           
JDBCPreparedStatementDataService(IDataSourceDescriptor descriptor, java.lang.Object serviceIdentity, java.lang.String url, java.lang.String user, java.lang.String password, java.lang.String catalog)
           
 
Method Summary
protected  void closeConnection(java.sql.Connection connection)
           
protected  void executeDelete(java.sql.Connection connection, IEntity entity)
           
protected  void executeInsert(java.sql.Connection connection, IEntity entity)
           
protected  void executeLoad(java.sql.Connection connection, IEntity entity, Qualifier qualifier)
           
protected  void executeQuery(java.sql.Connection connection, DataQuery query, ISelection selection)
           
protected  void executeUpdate(java.sql.Connection connection, IEntity entity, Qualifier qualifier)
           
 java.lang.String getPassword()
           
protected  java.lang.Object getSetData(java.sql.ResultSet set, int index, DataType dataType)
           
 SQLToolKitPS getSQLToolKit()
           
 java.lang.String getURL()
           
 java.lang.String getUser()
           
protected  boolean hasAutoIndexField(IEntityDescriptor entityDescriptor)
           
 IDataTransaction newTransaction()
          Returns a new IDataTransaction object that can be used to batch data operations and wrap them in a transaction.
protected  java.sql.Connection openConnection()
           
 boolean ping()
          Should return true if the service is online and reponding to calls.
protected  void readResultSetRow(java.sql.ResultSet set, IEntity entity, boolean useFastSetData)
           
static void setDriver(java.sql.Driver driver)
           
 void setSQLToolKit(SQLToolKitPS kit)
           
protected  void updateAutoIndex(java.sql.Statement statement, IEntity entity)
          This method updates autogenerated primary key field values.
 
Methods inherited from class org.caleigo.core.AbstractDataService
checkEntityAsDeletable, checkEntityAsStorable, delete, finalizeService, getCustomProxyService, getDataSourceDescriptor, getServiceIdentity, getServiceInterface, getServiceInterfaceClass, getServiceType, getTimeout, hasCustomProxyService, initializeService, isValidating, load, loadSelection, loadSelection, refresh, setEntityData, setTimeout, setValidating, store
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MAX_CONNECTION_POOL_SIZE

public static final int DEFAULT_MAX_CONNECTION_POOL_SIZE
See Also:
Constant Field Values
Constructor Detail

JDBCPreparedStatementDataService

public JDBCPreparedStatementDataService(IDataSourceDescriptor descriptor)
Default constructor for JDBCDataService.


JDBCPreparedStatementDataService

public JDBCPreparedStatementDataService(IDataSourceDescriptor descriptor,
                                        java.lang.Object serviceIdentity,
                                        java.lang.String url)

JDBCPreparedStatementDataService

public JDBCPreparedStatementDataService(IDataSourceDescriptor descriptor,
                                        java.lang.Object serviceIdentity,
                                        java.lang.String url,
                                        java.lang.String user,
                                        java.lang.String password)

JDBCPreparedStatementDataService

public JDBCPreparedStatementDataService(IDataSourceDescriptor descriptor,
                                        java.lang.Object serviceIdentity,
                                        java.lang.String url,
                                        java.lang.String user,
                                        java.lang.String password,
                                        java.lang.String catalog)

JDBCPreparedStatementDataService

public JDBCPreparedStatementDataService(IDataSourceDescriptor descriptor,
                                        java.lang.Object serviceIdentity,
                                        java.lang.String url,
                                        java.util.Properties info,
                                        int maxConnectionPoolSize)
Method Detail

setDriver

public static void setDriver(java.sql.Driver driver)

newTransaction

public IDataTransaction newTransaction()
Description copied from interface: IDataService
Returns a new IDataTransaction object that can be used to batch data operations and wrap them in a transaction.

Specified by:
newTransaction in interface IDataService
Specified by:
newTransaction in class AbstractDataService

ping

public boolean ping()
Should return true if the service is online and reponding to calls.

Specified by:
ping in interface IService
Specified by:
ping in class AbstractDataService

executeLoad

protected void executeLoad(java.sql.Connection connection,
                           IEntity entity,
                           Qualifier qualifier)
                    throws DataServiceException
Throws:
DataServiceException

executeQuery

protected void executeQuery(java.sql.Connection connection,
                            DataQuery query,
                            ISelection selection)
                     throws DataServiceException
Throws:
DataServiceException

executeInsert

protected void executeInsert(java.sql.Connection connection,
                             IEntity entity)
                      throws DataServiceException
Throws:
DataServiceException

executeUpdate

protected void executeUpdate(java.sql.Connection connection,
                             IEntity entity,
                             Qualifier qualifier)
                      throws DataServiceException
Throws:
DataServiceException

executeDelete

protected void executeDelete(java.sql.Connection connection,
                             IEntity entity)
                      throws DataServiceException
Throws:
DataServiceException

openConnection

protected java.sql.Connection openConnection()
                                      throws DataServiceException
Throws:
DataServiceException

closeConnection

protected void closeConnection(java.sql.Connection connection)
                        throws DataServiceException
Throws:
DataServiceException

readResultSetRow

protected void readResultSetRow(java.sql.ResultSet set,
                                IEntity entity,
                                boolean useFastSetData)
                         throws DataServiceException
Throws:
DataServiceException

getSetData

protected java.lang.Object getSetData(java.sql.ResultSet set,
                                      int index,
                                      DataType dataType)

updateAutoIndex

protected void updateAutoIndex(java.sql.Statement statement,
                               IEntity entity)
                        throws DataServiceException
This method updates autogenerated primary key field values. Note that this method can only be used directly after a insert and should still not be considered safe in an environment with frequent inserts to the entity's table.

Throws:
DataServiceException

hasAutoIndexField

protected boolean hasAutoIndexField(IEntityDescriptor entityDescriptor)

getURL

public java.lang.String getURL()

getUser

public java.lang.String getUser()

getPassword

public java.lang.String getPassword()

getSQLToolKit

public SQLToolKitPS getSQLToolKit()

setSQLToolKit

public void setSQLToolKit(SQLToolKitPS kit)


Copyright © 2005 Caleigo. All Rights Reserved.