public class DBConnection
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String | COPYRIGHT
IBM copyright notice field.
|
static java.lang.String | DB_400
String to identify the DB2 database on the AS/400 platform.
|
static java.lang.String | DB_DB2
String to identify DB2 database.
|
static java.lang.String | DB_DB2_390
String to identify the database DB2 on the 390 platform.
|
static java.lang.String | DB_ORACLE
String to identify Oracle database.
|
static java.lang.String | DB2_DRIVER
DB2 JDBC driver.
|
static java.lang.String | DB2_URL_PFX
DB2 URL prefix.
|
static java.lang.String | DB400_DRIVER
DB2 JDBC driver.
|
static java.lang.String | ORACLE_DRIVER
Oracle JDBC driver.
|
static java.lang.String | ORACLE_URL_PFX
Oracle URL prefix.
|
Constructor and Description |
---|
DBConnection()
Construct a DBConnection object.
|
Modifier and Type | Method and Description |
---|---|
boolean | connectTo(java.lang.String url, java.lang.String id, java.lang.String pw)
Connects to a database.
|
boolean | disconnectTo()
Disconnects from the database.
|
java.sql.Connection | getCon()
Getter for the database connection.
|
java.lang.String | getDatabase()
Getter for the database name.
|
java.lang.String | getDBType()
Getter for the database type.
|
java.lang.String | getPasswd()
Getter for the user's password.
|
java.lang.String | getUser()
Getter for the user.
|
void | setCon(java.sql.Connection newCon)
Setter for database connection.
|
void | setDatabase(java.lang.String newDatabase)
Setter for the database name.
|
void | setDBType(java.lang.String newDBType)
Setter for the database type.
|
void | setPasswd(java.lang.String newPasswd)
Setter for the user's password.
|
void | setUser(java.lang.String newUser)
Setter for the user.
|
public static final java.lang.String COPYRIGHT
public static final java.lang.String DB2_DRIVER
public static final java.lang.String DB2_URL_PFX
public static final java.lang.String ORACLE_DRIVER
public static final java.lang.String ORACLE_URL_PFX
public static final java.lang.String DB_ORACLE
public static final java.lang.String DB_DB2
public static final java.lang.String DB_DB2_390
public static final java.lang.String DB_400
public static final java.lang.String DB400_DRIVER
public boolean connectTo(java.lang.String url, java.lang.String id, java.lang.String pw)
public boolean disconnectTo()
public java.sql.Connection getCon()
public java.lang.String getDatabase()
public java.lang.String getDBType()
public java.lang.String getPasswd()
public java.lang.String getUser()
public void setCon(java.sql.Connection newCon)
public void setDatabase(java.lang.String newDatabase)
public void setDBType(java.lang.String newDBType)
public void setPasswd(java.lang.String newPasswd)
public void setUser(java.lang.String newUser)