|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.klg.jclass.datasource.jdbc.DataTableConnection
A connection to a JDBC datasource. It can be shared between various data controls.
Field Summary | |
protected boolean |
autoCommitFlag
|
protected Connection |
connection
|
Constructor Summary | |
DataTableConnection()
DataTableConnection Constructor, empty, must load driver and call connect after instantiating. |
|
DataTableConnection(String driver,
String url,
String user,
String password,
String database)
DataTableConnection Constructor. |
Method Summary | |
void |
connect(String url,
Properties properties)
Establish a connection using property object. |
void |
connect(String url,
String login,
String password)
Establish a connection to a data database using odbc style. |
void |
connect(String url,
String login,
String password,
String db)
Establish a connection to a data database using hostname and port. |
void |
disconnect()
Close the connection to the database. |
boolean |
getAutoCommit()
Get auto commit value. |
Connection |
getConnection()
Return this connection to the database. |
void |
loadDriver(String driver)
Load this driver into memory. |
void |
reconnect()
Reconnect using previous parameters. |
void |
setAutoCommit(boolean value)
Set auto commit value. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected transient Connection connection
protected boolean autoCommitFlag
Constructor Detail |
public DataTableConnection(String driver, String url, String user, String password, String database) throws DataModelException
driver
- a String indicating which driver to loadurl
- a String url for the connectionuser
- a String for the user namepassword
- a String for the user passworddatabase
- a String for the data base name
DataModelException
- If initialization fails.public DataTableConnection()
Method Detail |
public void loadDriver(String driver) throws DataModelException
driver
- a String indicating which driver to load
DataModelException
- If driver fails to load.public void connect(String url, String login, String password, String db) throws DataModelException
url
- a String url for the connectionlogin
- a String for the user namepassword
- a String for the user passworddb
- a String for the data base name
DataModelException
- If connection fails.public void connect(String url, String login, String password) throws DataModelException
url
- a String url for the connectionlogin
- a String for the user namepassword
- a String for the user password
DataModelException
- If connection fails.public void connect(String url, Properties properties) throws DataModelException
Properties props = new Properties();
props.put("user", "dba");
props.put("password", "90210");
c = new DataTableConnection();
c.loadDriver("sun.jdbc.odbc.JdbcOdbcDriver");
c.connect("jdbc:odbc:JClassDemoSQLAnywhere", props);
url
- a String a database url of the form jdbc:subprotocol:subnameproperties
- a list of arbitrary string tag/value pairs as
connection arguments; normally at least a "user" and "password"
property should be included
DataModelException
- If connection fails.public Connection getConnection()
public void disconnect()
public void reconnect() throws DataModelException
DataModelException
- If reconnect fails.public void setAutoCommit(boolean value) throws SQLException
value
- a boolean determining when the commit occurs.
SQLException
- If data base access error occurs.public boolean getAutoCommit() throws SQLException
SQLException
- If data base access error occurs.
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |