|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectch.sahits.codegen.java.input.db.DBConnection
ch.sahits.codegen.java.input.db.OracleConnection
public class OracleConnection
This class handles the connection to a Oracle DB. It queries the DB for the structure of a table.
| Field Summary |
|---|
| Fields inherited from class ch.sahits.codegen.java.input.db.DBConnection |
|---|
conn, db, host, password, port, product, schema, table, user |
| Constructor Summary | |
|---|---|
OracleConnection()
Default constructor |
|
| Method Summary | |
|---|---|
protected java.lang.Class |
convert2Java(java.lang.String type)
Convert the corresponding Java type for a database type |
protected DataBaseTable |
createDataBaseTable()
Create the DataBaseTable with product specific data |
java.lang.String |
getConnectionDriverClass()
Retrieve the driver class name for the JDBC connection |
java.lang.String |
getConnectionString()
Retrieve the connection String for the specific database |
protected java.lang.String |
getConstraintFieldSQL(java.lang.String constraintName)
Retrieve the SQL that gets you all fields of a constraint |
protected java.lang.String |
getIndexConstraintSQL()
Retrieve the SQL that gets you the Index constraints |
protected DataBaseTable |
getStructure()
Query the INFORMATION_SCHEMA to retrieve the metadata |
protected java.lang.String |
getTableSQL()
Retrieve the SQL that gets you the table definition |
protected boolean |
isAutogenKey(java.lang.String fieldName)
Check if a trigger is defined for the field on insert that referres to a sequence that fills the field. |
protected void |
loadDriver()
check if the driver is available |
| Methods inherited from class ch.sahits.codegen.java.input.db.DBConnection |
|---|
addFields2Index, getConstraintsFields, getPort, getSchema, init, isAutGenKey, setHost, setPassword, setPort, setProduct, setSchema, setTableName, setUserName |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public OracleConnection()
| Method Detail |
|---|
protected final DataBaseTable getStructure()
throws java.sql.SQLException
getStructure in class DBConnectionjava.sql.SQLExceptionpublic final java.lang.String getConnectionString()
getConnectionString in class DBConnection
protected final void loadDriver()
throws java.lang.ClassNotFoundException
loadDriver in class DBConnectionjava.lang.ClassNotFoundException - JDBC driver not on classpathpublic final java.lang.String getConnectionDriverClass()
protected final java.lang.Class convert2Java(java.lang.String type)
convert2Java in class DBConnectiontype - database type
protected final DataBaseTable createDataBaseTable()
DataBaseTable with product specific data
createDataBaseTable in class DBConnectionDataBaseTableprotected final java.lang.String getConstraintFieldSQL(java.lang.String constraintName)
getConstraintFieldSQL in class DBConnectionconstraintName - name of the constraint
protected final java.lang.String getIndexConstraintSQL()
getIndexConstraintSQL in class DBConnectionprotected final java.lang.String getTableSQL()
getTableSQL in class DBConnectionprotected final boolean isAutogenKey(java.lang.String fieldName)
fieldName - name of the field
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||