|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gswing.components.common.db.DbAccess
public class DbAccess
Purpose: Creates and maintains a JDBC connection with a database.
Constructor Summary | |
---|---|
DbAccess(String url,
String dbName,
String userName)
Constructor. |
|
DbAccess(String url,
String dbName,
String userName,
String password)
Constructor. |
Method Summary | |
---|---|
void |
closeConnection()
Close the database connection. |
protected Statement |
createStatement()
Create standard statement with a query timeout of 10 seconds. |
protected Connection |
getConnection()
Get the JDBC connection to this database. |
String |
getDatabaseName()
Get the name of this database. |
int |
getNumberOfTables()
Counts number of tables in database. |
String |
getPassword()
Get the password for this database |
Vector |
getTableList()
Get the list of tables in this database. |
boolean |
hasValidConnection()
Do we have a valid database connection? |
boolean |
isConnected()
Determine database connection status; |
boolean |
setDriverClassName(String driver)
Set the driver class name. |
void |
setPassword(String password)
Set the database password. |
boolean |
tableExists(String tableName)
Check whether a particular table exists in this database. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DbAccess(String url, String dbName, String userName, String password)
url
- The URL of this database connection.dbName
- The database name or catalogue.userName
- The database user name.password
- The database password.public DbAccess(String url, String dbName, String userName)
url
- The URL of this database connection.dbName
- The database name or catalogue.userName
- The database user name.Method Detail |
---|
public boolean tableExists(String tableName)
tableName
- The name of the table to check.
protected Connection getConnection()
public void closeConnection()
public boolean isConnected()
protected Statement createStatement() throws SQLException
SQLException
public String getPassword()
public boolean setDriverClassName(String driver)
driver
- The driver class name.
public void setPassword(String password)
password
- The password to set.public int getNumberOfTables()
public Vector getTableList()
public String getDatabaseName()
public boolean hasValidConnection()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |