|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jdesktop.dataset.DataConnection
org.jdesktop.dataset.provider.sql.JDBCDataConnection
public class JDBCDataConnection
An implementation of the DataConnection for interacting with a local database. This implementation is "local", meaning that it is written and optimized for low latency database access, such as for an in memory database, or one on a local network.
Constructor Summary | |
---|---|
JDBCDataConnection()
Create a new DatabaseDataStoreConnection. |
|
JDBCDataConnection(java.lang.String driver,
java.lang.String url,
java.util.Properties props)
Create a new JDBCDataConnection and initializes it to connect to a database using the given params. |
|
JDBCDataConnection(java.lang.String jndiContext,
java.lang.String user,
java.lang.String passwd)
Create a new JDBCDataConnection and initializes it to connect to a database using the given params. |
|
JDBCDataConnection(java.lang.String driver,
java.lang.String url,
java.lang.String user,
java.lang.String passwd)
Create a new JDBCDataConnection and initializes it to connect to a database using the given params. |
Method Summary | |
---|---|
void |
commit()
|
protected void |
connect()
Connect to the database. |
protected void |
disconnect()
Disconnects from the database and causes all of the attached DataModels to flush their contents. |
java.sql.ResultSet |
executeQuery(java.sql.PreparedStatement ps)
|
int |
executeUpdate(java.sql.PreparedStatement ps)
|
java.sql.Connection |
getConnection()
|
java.lang.String |
getPassword()
|
java.util.Properties |
getProperties()
|
java.lang.String |
getUrl()
|
java.lang.String |
getUserName()
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql)
|
void |
setPassword(java.lang.String password)
|
void |
setProperties(java.util.Properties properties)
|
void |
setUrl(java.lang.String url)
|
void |
setUserName(java.lang.String userName)
|
Methods inherited from class org.jdesktop.dataset.DataConnection |
---|
addPropertyChangeListener, addPropertyChangeListener, isConnected, removePropertyChangeListener, setConnected |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JDBCDataConnection()
public JDBCDataConnection(java.lang.String driver, java.lang.String url, java.lang.String user, java.lang.String passwd)
driver
- url
- user
- passwd
- public JDBCDataConnection(java.lang.String driver, java.lang.String url, java.util.Properties props)
driver
- url
- props
- public JDBCDataConnection(java.lang.String jndiContext, java.lang.String user, java.lang.String passwd)
jndiContext
- user
- passwd
- Method Detail |
---|
public java.lang.String getUrl()
public void setUrl(java.lang.String url)
url
- set the JDBC connection urlpublic java.lang.String getUserName()
public void setUserName(java.lang.String userName)
userName
- used to connect to the databasepublic java.lang.String getPassword()
public void setPassword(java.lang.String password)
password
- the password used to connect to the databasepublic java.util.Properties getProperties()
public void setProperties(java.util.Properties properties)
properties
- miscellaneous JDBC properties to use when connecting
to the database via the JDBC driverprotected void connect() throws java.lang.Exception
connect
in class DataConnection
java.lang.Exception
protected void disconnect() throws java.lang.Exception
disconnect
in class DataConnection
java.lang.Exception
public java.sql.ResultSet executeQuery(java.sql.PreparedStatement ps)
public int executeUpdate(java.sql.PreparedStatement ps)
public java.sql.PreparedStatement prepareStatement(java.lang.String sql) throws java.lang.Exception
java.lang.Exception
public void commit()
public java.sql.Connection getConnection()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |