|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface for a relational database management system.
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. |
Method Detail |
public boolean set(java.io.InputStream aStream) throws java.io.IOException
aStream
- Input stream of a properties file.
true
if all mandatory properties could be set;
false
otherwise.
java.io.IOException
Properties.load(InputStream)
,
set(Properties)
public boolean set(java.util.Properties properties)
jso.database.driver.class
: Fully qualified name for the
JDBC driver.jso.database.codes.duplicateKey
: String containing numeric
databse codes for duplicate key errors, separated by commas. This is an
optional parameter, but if not specified the manager will not be able to
throw DuplicateObjectException
s.jso.database.codes.referentialIntegrity
: String containing
numeric databse codes for referential integrity errors, separated by
commas. This is an optional parameter, but if not specified the
manager
will not be able to throw
IntegrityException
s.jso.database.string.length
: The length to be used as
string comlumns length in tables. This is an optional parameter.Also, database data types shoul be mapped to JDBC types. The following properties should contain the names of the database data types corresponding to the property JDBC type:
jso.database.type.BOOLEAN
jso.database.type.CHAR
jso.database.type.DATE
jso.database.type.DOUBLE
jso.database.type.FLOAT
jso.database.type.INTEGER
jso.database.type.LONGVARCHAR
jso.database.type.SMALLINT
jso.database.type.TIME
jso.database.type.TIMESTAMP
jso.database.type.TINYINT
jso.database.type.VARCHAR
properties
- 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)
className
- Fully qualified name for the JDBC driver class.public java.lang.String getDriverClass()
public void setStringLength(java.lang.String someLength)
someLength
- String comlumns length in tables.public void setStringLength(int someLength)
someLength
- String comlumns length in tables.public int getStringLength()
public boolean mapTypes(java.sql.Connection aConnection) throws java.sql.SQLException
aConnection
- 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
aStream
- Input stream of a properties file.
true
if all necessary jdbc types could be mapped or
false
otherwise.
java.io.IOException
Properties.load(InputStream)
,
mapTypes(Properties)
public boolean mapTypes(java.util.Properties properties)
properties
- Properties from which data type metadata will be retrieved.
true
if all necessary jdbc types could be mapped or
false
otherwise.set(Properties)
public void createTable(TableDescriptor aTable, java.sql.Connection aConnection) throws java.sql.SQLException
aTable
- 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
aTable
- 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
aTable
- The table name.aConnection
- A connection to the database.
java.sql.SQLException
public void setDuplicateKeyCodes(java.lang.String codes) throws java.lang.IllegalArgumentException
codes
- String containing numeric error codes separated by commas.
java.lang.IllegalArgumentException
public boolean isDuplicateKeyCode(int aCode)
aCode
- 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
codes
- String containing numeric error codes separated by commas.
java.lang.IllegalArgumentException
public boolean isReferentialIntegrityCode(int aCode)
aCode
- 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
anUrl
- 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 |