|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.lightdev.lib.sam.JDBCAdapter
com.lightdev.app.trec.server.SQLAdapter
public class SQLAdapter
JDBC adapter to connect to a database. This adapter assumes a file named 'db.properties' in the package this class resides in. In file 'db.properties' all relevant actual database settings such as driver, server or database name can be made. When this adapter is deployed on a server, file db.properties can be adjusted after deploment to connect to an individual database without having to recompile and redeploy this class.
Alternately settings can be made by calling methods setDriverName
and setConnectString
| Field Summary |
|---|
| Fields inherited from class com.lightdev.lib.sam.JDBCAdapter |
|---|
RB_KEY_DB_DRIVER_NAME, RB_KEY_DB_NAME, RB_KEY_DB_PREFIX, RB_KEY_DB_PW, RB_KEY_DB_SERVER_NAME, RB_KEY_DB_USER_NAME |
| Constructor Summary | |
|---|---|
SQLAdapter()
create a new instance of an SQLAdapter object |
|
| Method Summary | |
|---|---|
void |
destroy()
destroy this adapter |
Connection |
getConnection()
get a connection to the database this adapter refers to |
String |
getConnectString()
get a string such as jdbc:mysql://server/database? |
void |
setConnectString(String connectString)
set the connect string this adapter should use This method can be used as an alternative to using a 'db.properties' resource bundle |
void |
setDriverName(String driverName)
set the name of the JDBC database driver class this adapter should use to connect to a database |
void |
setSupportsTransactions(boolean supportsTransactions)
indicate whether of not the database this adapter refers to supports transactions |
boolean |
supportsTransactions()
determine whether or not the database supports transactions |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SQLAdapter()
| Method Detail |
|---|
public Connection getConnection()
throws Exception
getConnection in class JDBCAdapterExceptionpublic boolean supportsTransactions()
supportsTransactions in class JDBCAdapterpublic void setDriverName(String driverName)
driverName - name of driver class including full package namepublic void setConnectString(String connectString)
This method can be used as an alternative to using a 'db.properties' resource bundle
connectString - the connect string to usepublic String getConnectString()
getConnectString in class JDBCAdapterpublic void destroy()
destroy in class JDBCAdapterpublic void setSupportsTransactions(boolean supportsTransactions)
supportsTransactions - true when transactions are supported, false if not
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||