Class ExoDatasource
java.lang.Object
org.exoplatform.services.database.ExoDatasource
Created by The eXo Platform SAS
Author : Tuan Nguyen tuan08@users.sourceforge.net Apr 4, 2006
This class is a wrapper class for the java.sql.Datasource class.
In additional to the java.sql.Datasourcemethod such getConnection().
The ExoDatasource provides 2 other methods:
DBTableManager getDBTableManager and IDGenerator getIDGenerator()
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcloseConnection(Connection conn) This method should delegate to the method close of the Connection object.voidcommit(Connection conn) This method should delegate to the commit() method of the Connection object.This method should call the datasource getConnection method and return the Connection object.intThis method should return the real Datasource objectThis method should return the DBTableManager object.This method should return the IDGenerator object, the developer can use the id generator to generate an unique long id for an db object
-
Field Details
-
STANDARD_DB_TYPE
public static final int STANDARD_DB_TYPE- See Also:
-
HSQL_DB_TYPE
public static final int HSQL_DB_TYPE- See Also:
-
MYSQL_DB_TYPE
public static final int MYSQL_DB_TYPE- See Also:
-
DB2_DB_TYPE
public static final int DB2_DB_TYPE- See Also:
-
DERBY_DB_TYPE
public static final int DERBY_DB_TYPE- See Also:
-
ORACLE_DB_TYPE
public static final int ORACLE_DB_TYPE- See Also:
-
SQL_SERVER_TYPE
public static final int SQL_SERVER_TYPE- See Also:
-
MSSQL_DB_TYPE
public static final int MSSQL_DB_TYPE- See Also:
-
SYSBASE_DB_TYPE
public static final int SYSBASE_DB_TYPE- See Also:
-
POSTGRES_DB_TYPE
public static final int POSTGRES_DB_TYPE- See Also:
-
-
Constructor Details
-
ExoDatasource
The constructor should: 1. Keep track of the datasource object 2. Create the DBTableManager object base on the datasource information such database type, version 3. Create an IDGenerator for the datasource- Parameters:
ds-- Throws:
Exception
-
-
Method Details
-
getDatasource
This method should return the real Datasource object- Returns:
-
getConnection
This method should call the datasource getConnection method and return the Connection object. The developer can add some debug code or broadcast an event here.- Returns:
- Throws:
Exception
-
closeConnection
This method should delegate to the method close of the Connection object. The developer can add debug or broadcast an event here.- Parameters:
conn-- Throws:
Exception
-
commit
This method should delegate to the commit() method of the Connection object. The developer can add the debug code here- Parameters:
conn-- Throws:
Exception
-
getDBTableManager
This method should return the DBTableManager object. The DBTableManager object should be initialized in the constructor according to the database type and version- Returns:
-
getIDGenerator
This method should return the IDGenerator object, the developer can use the id generator to generate an unique long id for an db object- Returns:
-
getDatabaseType
public int getDatabaseType() -
getDatabaseName
-
getDatabaseVersion
-
getQueryBuilder
-