|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.sf.jso.sql.JSODatabase
| Constructor Summary | |
JSODatabase()
|
|
| Method Summary | |
java.sql.Connection |
connect(java.lang.String anUrl,
java.lang.String anUser,
java.lang.String aPassword)
Connects to the database. |
void |
createTable(TableDescriptor aTable,
java.sql.Connection aConnection)
Creates a table in the database. |
void |
dropTable(java.lang.String aTable,
java.sql.Connection aConnection)
Drops a table in the database. |
java.lang.String |
getDriverClass()
Returns database's JDBC driver class name. |
int |
getStringLength()
Returns the length to be used as string comlumns length in tables. |
boolean |
isDuplicateKeyCode(int aCode)
Indicates if a vendor error code is a duplicate key error code. |
boolean |
isReferentialIntegrityCode(int aCode)
Indicates if a vendor error code is a referential integrity error code. |
boolean |
mapTypes(java.sql.Connection aConnection)
Maps JDBC SQL types to database data types. |
boolean |
mapTypes(java.io.InputStream aStream)
Maps JDBC SQL types to database data types. |
boolean |
mapTypes(java.util.Properties properties)
Maps JDBC SQL types to database data types. |
boolean |
set(java.io.InputStream aStream)
Sets database properties. |
boolean |
set(java.util.Properties properties)
Sets database properties. |
void |
setDriverClass(java.lang.String className)
Sets database's JDBC driver class name. |
void |
setDuplicateKeyCodes(java.lang.String codes)
Sets SQL error codes for duplicate keys. |
void |
setReferentialIntegrityCodes(java.lang.String codes)
Sets SQL error codes for referential integrity errors. |
void |
setStringLength(int someLength)
Sets the length to be used as string comlumns length in tables. |
void |
setStringLength(java.lang.String someLength)
Sets the length to be used as string comlumns length in tables. |
boolean |
tableExists(java.lang.String aTable,
java.sql.Connection aConnection)
Checks for table existence. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public JSODatabase()
| Method Detail |
public boolean set(java.io.InputStream aStream)
throws java.io.IOException
set in interface DatabaseInterfaceaStream - Input stream of a properties file.
true if all mandatory properties could be set;
false otherwise.
java.io.IOExceptionProperties.load(InputStream),
DatabaseInterface.set(Properties)public boolean set(java.util.Properties properties)
set in interface DatabaseInterfaceproperties - Properties from which database properties will be set.
true if all mandatory properties could be set;
false otherwise.public void setDriverClass(java.lang.String className)
setDriverClass in interface DatabaseInterfaceclassName - Fully qualified name for the JDBC driver class.public java.lang.String getDriverClass()
getDriverClass in interface DatabaseInterfacepublic void setStringLength(java.lang.String someLength)
setStringLength in interface DatabaseInterfacesomeLength - String comlumns length in tables.public void setStringLength(int someLength)
setStringLength in interface DatabaseInterfacesomeLength - String comlumns length in tables.public int getStringLength()
getStringLength in interface DatabaseInterface
public boolean mapTypes(java.sql.Connection aConnection)
throws java.sql.SQLException
mapTypes in interface DatabaseInterfaceaConnection - Connection from which data type metadata will be retrieved.
true if all necessary jdbc types could be mapped or
false otherwise.
java.sql.SQLException
public boolean mapTypes(java.io.InputStream aStream)
throws java.io.IOException
mapTypes in interface DatabaseInterfaceaStream - Input stream of a properties file.
true if all necessary jdbc types could be mapped or
false otherwise.
java.io.IOExceptionProperties.load(InputStream),
DatabaseInterface.mapTypes(Properties)public boolean mapTypes(java.util.Properties properties)
mapTypes in interface DatabaseInterfaceproperties - Properties from which data type metadata will be retrieved.
true if all necessary jdbc types could be mapped or
false otherwise.DatabaseInterface.set(Properties)
public void createTable(TableDescriptor aTable,
java.sql.Connection aConnection)
throws java.sql.SQLException
createTable in interface DatabaseInterfaceaTable - The table descriptor of the table to be created.aConnection - A connection to the database.
java.sql.SQLException
public boolean tableExists(java.lang.String aTable,
java.sql.Connection aConnection)
throws java.sql.SQLException
tableExists in interface DatabaseInterfaceaTable - The table name.aConnection - A connection to the database.
java.sql.SQLException
public void dropTable(java.lang.String aTable,
java.sql.Connection aConnection)
throws java.sql.SQLException
dropTable in interface DatabaseInterfaceaTable - The table name.aConnection - A connection to the database.
java.sql.SQLException
public void setDuplicateKeyCodes(java.lang.String codes)
throws java.lang.IllegalArgumentException
setDuplicateKeyCodes in interface DatabaseInterfacecodes - String containing numeric error codes separated by commas.
java.lang.IllegalArgumentExceptionpublic boolean isDuplicateKeyCode(int aCode)
isDuplicateKeyCode in interface DatabaseInterfaceaCode - Vendor error code.
true if the supplied code is a duplicate key error
code; false
public void setReferentialIntegrityCodes(java.lang.String codes)
throws java.lang.IllegalArgumentException
setReferentialIntegrityCodes in interface DatabaseInterfacecodes - String containing numeric error codes separated by commas.
java.lang.IllegalArgumentExceptionpublic boolean isReferentialIntegrityCode(int aCode)
isReferentialIntegrityCode in interface DatabaseInterfaceaCode - Vendor error code.
true if the supplied code is a referential integrity
error code; false
public java.sql.Connection connect(java.lang.String anUrl,
java.lang.String anUser,
java.lang.String aPassword)
throws java.sql.SQLException
connect in interface DatabaseInterfaceanUrl - A database url of the form jdbc:subprotocol:subname.anUser - The database user on whose behalf the connections will be made.aPassword - The user's password.
java.sql.SQLException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||