|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.ojb.broker.util.dbhandling.TorqueDBHandling
public class TorqueDBHandling
Provides basic database handling (drop, create, init) via torque.
| Field Summary | |
|---|---|
protected static String |
TORQUE_PLATFORM_DB2
Torque db platforms |
protected static String |
TORQUE_PLATFORM_HYPERSONIC
|
protected static String |
TORQUE_PLATFORM_INTERBASE
|
protected static String |
TORQUE_PLATFORM_MSSQL
|
protected static String |
TORQUE_PLATFORM_MYSQL
|
protected static String |
TORQUE_PLATFORM_ORACLE
|
protected static String |
TORQUE_PLATFORM_POSTGRESQL
|
protected static String |
TORQUE_PLATFORM_SAPDB
|
protected static String |
TORQUE_PLATFORM_SYBASE
|
| Constructor Summary | |
|---|---|
TorqueDBHandling()
Creates a new handling object. |
|
| Method Summary | |
|---|---|
void |
addDBDefinitionFile(InputStream schemaStream)
Adds an input stream of a db definition (in our case of a torque schema file). |
void |
addDBDefinitionFiles(String srcDir,
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 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 String |
getDBManipulationUrl()
Template-and-Hook method for generating the url required by the jdbc driver to allow for modifying an existing database. |
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(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 String TORQUE_PLATFORM_DB2
protected static final String TORQUE_PLATFORM_HYPERSONIC
protected static final String TORQUE_PLATFORM_INTERBASE
protected static final String TORQUE_PLATFORM_MSSQL
protected static final String TORQUE_PLATFORM_MYSQL
protected static final String TORQUE_PLATFORM_ORACLE
protected static final String TORQUE_PLATFORM_POSTGRESQL
protected static final String TORQUE_PLATFORM_SAPDB
protected static final String TORQUE_PLATFORM_SYBASE
| Constructor Detail |
|---|
public TorqueDBHandling()
| Method Detail |
|---|
public void setConnection(JdbcConnectionDescriptor jcd)
throws PlatformException
setConnection in interface DBHandlingjcd - The connection to use
PlatformException - If the target database cannot be handled with torquepublic JdbcConnectionDescriptor getConnection()
getConnection in interface DBHandlingpublic String getTargetTorquePlatform()
public void addDBDefinitionFiles(String srcDir,
String listOfFilenames)
throws IOException
addDBDefinitionFiles in interface DBHandlingsrcDir - The directory containing the fileslistOfFilenames - The filenames in a comma-separated list
IOException
public void addDBDefinitionFile(InputStream schemaStream)
throws IOException
addDBDefinitionFile in interface DBHandlingschemaStream - The input stream
IOException
public void createCreationScript()
throws PlatformException
PlatformException - If some error occurred
public void createDB()
throws PlatformException
createDB in interface DBHandlingPlatformException - If some error occurred
public void createInitScripts()
throws PlatformException
PlatformException - If some error occurred
public void initDB()
throws PlatformException
initDB in interface DBHandlingPlatformException - If some error occurredprotected String getDBCreationUrl()
protected String getDBManipulationUrl()
public void setWorkDir(String dir)
throws IOException
setWorkDir in interface DBHandlingdir - The directory
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 | |||||||||