|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.ojb.broker.platforms.TorqueDBHandling
Provides basic database handling (drop, create, init) via torque.
Field Summary | |
protected static java.lang.String |
TORQUE_PLATFORM_DB2
Torque db platforms |
protected static java.lang.String |
TORQUE_PLATFORM_HYPERSONIC
|
protected static java.lang.String |
TORQUE_PLATFORM_INTERBASE
|
protected static java.lang.String |
TORQUE_PLATFORM_MSSQL
|
protected static java.lang.String |
TORQUE_PLATFORM_MYSQL
|
protected static java.lang.String |
TORQUE_PLATFORM_ORACLE
|
protected static java.lang.String |
TORQUE_PLATFORM_POSTGRESQL
|
protected static java.lang.String |
TORQUE_PLATFORM_SAPDB
|
protected static java.lang.String |
TORQUE_PLATFORM_SYBASE
|
Constructor Summary | |
TorqueDBHandling()
Creates a new handling object. |
Method Summary | |
void |
addDBDefinitionFile(java.io.InputStream schemaStream)
Adds an input stream of a db definition (in our case of a torque schema file). |
void |
addDBDefinitionFiles(java.lang.String srcDir,
java.lang.String listOfFilenames)
Adds the input files (in our case torque schema files) to use. |
void |
createCreationScript()
Creates the db-creation sql script (but does not perform it). |
void |
createDB()
Creates the database. |
void |
createInitScripts()
Creates the initialization scripts (creation of tables etc.) but does not perform them. |
JdbcConnectionDescriptor |
getConnection()
Returns the connection descriptor used by this handling object. |
protected java.lang.String |
getDBCreationUrl()
Template-and-Hook method for generating the url required by the jdbc driver to allow for creating a database (as opposed to accessing an already-existing database). |
protected java.lang.String |
getDBManipulationUrl()
Template-and-Hook method for generating the url required by the jdbc driver to allow for modifying an existing database. |
java.lang.String |
getTargetTorquePlatform()
Returns the torque database platform used. |
void |
initDB()
Creates the tables according to the schema files. |
void |
setConnection(JdbcConnectionDescriptor jcd)
Sets the jdbc connection to use. |
void |
setWorkDir(java.lang.String dir)
Sets the working directory. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final java.lang.String TORQUE_PLATFORM_DB2
protected static final java.lang.String TORQUE_PLATFORM_HYPERSONIC
protected static final java.lang.String TORQUE_PLATFORM_INTERBASE
protected static final java.lang.String TORQUE_PLATFORM_MSSQL
protected static final java.lang.String TORQUE_PLATFORM_MYSQL
protected static final java.lang.String TORQUE_PLATFORM_ORACLE
protected static final java.lang.String TORQUE_PLATFORM_POSTGRESQL
protected static final java.lang.String TORQUE_PLATFORM_SAPDB
protected static final java.lang.String TORQUE_PLATFORM_SYBASE
Constructor Detail |
public TorqueDBHandling()
Method Detail |
public void setConnection(JdbcConnectionDescriptor jcd) throws PlatformException
setConnection
in interface DBHandling
jcd
- The connection to use
PlatformException
- If the target database cannot be handled with torquepublic JdbcConnectionDescriptor getConnection()
getConnection
in interface DBHandling
public java.lang.String getTargetTorquePlatform()
public void addDBDefinitionFiles(java.lang.String srcDir, java.lang.String listOfFilenames) throws java.io.IOException
addDBDefinitionFiles
in interface DBHandling
srcDir
- The directory containing the fileslistOfFilenames
- The filenames in a comma-separated list
java.io.IOException
public void addDBDefinitionFile(java.io.InputStream schemaStream) throws java.io.IOException
addDBDefinitionFile
in interface DBHandling
java.io.IOException
public void createCreationScript() throws PlatformException
PlatformException
- If some error occurredpublic void createDB() throws PlatformException
createDB
in interface DBHandling
PlatformException
- If some error occurredpublic void createInitScripts() throws PlatformException
PlatformException
- If some error occurredpublic void initDB() throws PlatformException
initDB
in interface DBHandling
PlatformException
- If some error occurredprotected java.lang.String getDBCreationUrl()
protected java.lang.String getDBManipulationUrl()
public void setWorkDir(java.lang.String dir) throws java.io.IOException
setWorkDir
in interface DBHandling
dir
- The directory
java.io.IOException
- If the directory does not exist or cannot be written/read
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |