|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.storage.jdbc.JDBCConnection
public class JDBCConnection
JDBCConnection is an implementation of java.sql.Connection
interface.
All of the implemented methods delegate to an actual java.sql.Connection
object
created using the DriverManager create methods. This class is meant to allow
users to set the information needed to create a java.sql.Connection
in webAF
and to hook up the Connection to a dataBean. If this class in instantiated while
at designTime, no connection is created. To allow a programmer to get information from
a user of their applet, the loginCommand can be set. The command will be executed before
attempting to create the connection. The JDBCConnection instance will be passed to
the command.execute(Object)
method.
In order to use default sun.jdbc.odbc.JdbcOdbcDriver in an applet,
the applet will need to be signed or the user's policy file changed. If this is not done,
a SQLException will be thrown with the message: No suitable driver.
Field Summary | |
---|---|
protected java.sql.Connection |
connection
|
protected java.util.Properties |
connectionInfo
|
protected java.lang.String |
databaseURL
|
protected boolean |
designTime
|
protected java.lang.Class |
driverClass
|
protected java.lang.String |
driverName
|
protected com.sas.util.Command |
loginCmd
|
protected java.lang.String |
password
|
static java.lang.String |
RB_KEY
|
protected javax.swing.event.SwingPropertyChangeSupport |
spcs
Used to support property changes in the webAF customizer |
protected java.lang.String |
user
|
Constructor Summary | |
---|---|
JDBCConnection()
Constructor for the JDBCConnection. |
Method Summary | |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener to the listener list. |
void |
clearWarnings()
Implementation of the java.sql.Connection interface. |
void |
close()
Implementation of the java.sql.Connection interface. |
void |
commit()
Implementation of the java.sql.Connection interface. |
protected java.sql.Connection |
createConnection()
Create the Connection object used to delegate all Connection method calls to. |
java.sql.Statement |
createStatement()
Implementation of the java.sql.Connection interface. |
java.sql.Statement |
createStatement(int resultSetType,
int resultSetConcurrency)
Implementation of the java.sql.Connection interface. |
java.sql.Statement |
createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
Implementation of the java.sql.Connection interface. |
boolean |
getAutoCommit()
Implementation of the java.sql.Connection interface. |
java.lang.String |
getCatalog()
Implementation of the java.sql.Connection interface. |
java.sql.Connection |
getConnection()
Get the connection used by this class to delegate to for implementation methods of java.sql.Connection interface. |
java.util.Properties |
getConnectionInfo()
Get the Properties object used to get a connection from the DriverManager. |
java.lang.String |
getDatabaseURL()
Get the Database URL used to get a connection from the DriverManager. |
java.lang.String |
getDriverName()
Get the name of the Driver class for this Connection. |
static com.sas.beans.ExtendedBeanInfo |
getExtendedBeanInfo()
|
int |
getHoldability()
Implementation of the java.sql.Connection interface. |
com.sas.util.Command |
getLoginCommand()
Get the Command object to be executed before attempting to load the Driver or find a Connection. |
java.sql.DatabaseMetaData |
getMetaData()
Implementation of the java.sql.Connection interface. |
java.lang.String |
getPassword()
Get the password used to get a connection from the DriverManager. |
int |
getTransactionIsolation()
Implementation of the java.sql.Connection interface. |
java.util.Map |
getTypeMap()
Implementation of the java.sql.Connection interface. |
java.lang.String |
getUsername()
Get the username used to get a connection from the DriverManager. |
java.sql.SQLWarning |
getWarnings()
Implementation of the java.sql.Connection interface. |
boolean |
isClosed()
Implementation of the java.sql.Connection interface. |
boolean |
isReadOnly()
Implementation of the java.sql.Connection interface. |
java.lang.String |
nativeSQL(java.lang.String sql)
Implementation of the java.sql.Connection interface. |
java.sql.CallableStatement |
prepareCall(java.lang.String sql)
Implementation of the java.sql.Connection interface. |
java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
Implementation of the java.sql.Connection interface. |
java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
Implementation of the java.sql.Connection interface. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql)
Implementation of the java.sql.Connection interface. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int autoGeneratedKeys)
Implementation of the java.sql.Connection interface. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int[] columnIndexes)
Implementation of the java.sql.Connection interface. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
Implementation of the java.sql.Connection interface. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
Implementation of the java.sql.Connection interface. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
java.lang.String[] columnNames)
Implementation of the java.sql.Connection interface. |
void |
releaseSavepoint(java.sql.Savepoint savepoint)
Implementation of the java.sql.Connection interface. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a PropertyChangeListener from the listener list. |
void |
resetConnection()
Reset the connection used by this class. |
void |
rollback()
Implementation of the java.sql.Connection interface. |
void |
rollback(java.sql.Savepoint savepoint)
Implementation of the java.sql.Connection interface. |
void |
setAutoCommit(boolean autoCommit)
Implementation of the java.sql.Connection interface. |
void |
setCatalog(java.lang.String catalog)
Implementation of the java.sql.Connection interface. |
void |
setConnectionInfo(java.util.Properties info)
Set the Connection information Properties object. |
void |
setDatabaseURL(java.lang.String url)
Set the database URL that this connection will connect to. |
void |
setDriverName(java.lang.String driver)
Set the name of the Driver class for this Connection. |
void |
setHoldability(int holdability)
Implementation of the java.sql.Connection interface. |
void |
setLoginCommand(com.sas.util.Command command)
Set the login Command. |
void |
setPassword(java.lang.String password)
Set the password used to get a connection from the DriverManager. |
void |
setReadOnly(boolean readOnly)
Implementation of the java.sql.Connection interface. |
java.sql.Savepoint |
setSavepoint()
Implementation of the java.sql.Connection interface. |
java.sql.Savepoint |
setSavepoint(java.lang.String name)
Implementation of the java.sql.Connection interface. |
void |
setTransactionIsolation(int level)
Implementation of the java.sql.Connection interface. |
void |
setTypeMap(java.util.Map typeMap)
Implementation of the java.sql.Connection interface. |
void |
setUsername(java.lang.String username)
Set the username used to get a connection from the DriverManager. |
Field Detail |
---|
public static final java.lang.String RB_KEY
protected boolean designTime
protected java.sql.Connection connection
protected java.lang.String driverName
protected java.lang.String databaseURL
protected java.lang.String user
protected java.lang.String password
protected java.util.Properties connectionInfo
protected java.lang.Class driverClass
protected com.sas.util.Command loginCmd
protected javax.swing.event.SwingPropertyChangeSupport spcs
Constructor Detail |
---|
public JDBCConnection()
Method Detail |
---|
public static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
public java.lang.String getPassword()
public void setPassword(java.lang.String password)
password
- the password stringpublic java.lang.String getUsername()
public void setUsername(java.lang.String username)
username
- the username stringpublic java.util.Properties getConnectionInfo()
public void setConnectionInfo(java.util.Properties info)
info
- the Connection Properties objectpublic java.lang.String getDatabaseURL()
public void setDatabaseURL(java.lang.String url)
url
- the URL to connect topublic java.lang.String getDriverName()
public void setDriverName(java.lang.String driver) throws java.lang.ClassNotFoundException
driver
- the driver class name
java.lang.ClassNotFoundException
public com.sas.util.Command getLoginCommand()
the
- login commandpublic void setLoginCommand(com.sas.util.Command command)
protected java.sql.Connection createConnection() throws java.sql.SQLException
getConnection( String, Properties )
method
is called. If the password or the user are not equal to null, the
getConnection( String, String, String )
method is called.
Otherwise, the getConnection( String )
method is called.
The method called is based on whether the Connection info Properties object
is set, the password and username, or just the databaseURL.
java.sql.SQLException
DriverManager
public void resetConnection() throws java.sql.SQLException
java.sql.SQLException
public java.sql.Connection getConnection() throws java.sql.SQLException
java.sql.SQLException
public java.sql.Statement createStatement() throws java.sql.SQLException
createStatement
in interface java.sql.Connection
java.sql.SQLException
public java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
createStatement
in interface java.sql.Connection
java.sql.SQLException
public java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
createStatement
in interface java.sql.Connection
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int autoGeneratedKeys) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int[] columnIndexes) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql, java.lang.String[] columnNames) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
public java.sql.CallableStatement prepareCall(java.lang.String sql) throws java.sql.SQLException
prepareCall
in interface java.sql.Connection
java.sql.SQLException
public java.sql.CallableStatement prepareCall(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
prepareCall
in interface java.sql.Connection
java.sql.SQLException
public java.lang.String nativeSQL(java.lang.String sql) throws java.sql.SQLException
nativeSQL
in interface java.sql.Connection
java.sql.SQLException
public void setAutoCommit(boolean autoCommit) throws java.sql.SQLException
setAutoCommit
in interface java.sql.Connection
java.sql.SQLException
public boolean getAutoCommit() throws java.sql.SQLException
getAutoCommit
in interface java.sql.Connection
java.sql.SQLException
public void commit() throws java.sql.SQLException
commit
in interface java.sql.Connection
java.sql.SQLException
public void rollback() throws java.sql.SQLException
rollback
in interface java.sql.Connection
java.sql.SQLException
public void close() throws java.sql.SQLException
close
in interface java.sql.Connection
java.sql.SQLException
public boolean isClosed() throws java.sql.SQLException
isClosed
in interface java.sql.Connection
java.sql.SQLException
public java.sql.DatabaseMetaData getMetaData() throws java.sql.SQLException
getMetaData
in interface java.sql.Connection
java.sql.SQLException
public void setReadOnly(boolean readOnly) throws java.sql.SQLException
setReadOnly
in interface java.sql.Connection
java.sql.SQLException
public boolean isReadOnly() throws java.sql.SQLException
isReadOnly
in interface java.sql.Connection
java.sql.SQLException
public void setCatalog(java.lang.String catalog) throws java.sql.SQLException
setCatalog
in interface java.sql.Connection
java.sql.SQLException
public java.lang.String getCatalog() throws java.sql.SQLException
getCatalog
in interface java.sql.Connection
java.sql.SQLException
public void setTransactionIsolation(int level) throws java.sql.SQLException
setTransactionIsolation
in interface java.sql.Connection
java.sql.SQLException
public int getTransactionIsolation() throws java.sql.SQLException
getTransactionIsolation
in interface java.sql.Connection
java.sql.SQLException
public java.sql.SQLWarning getWarnings() throws java.sql.SQLException
getWarnings
in interface java.sql.Connection
java.sql.SQLException
public void clearWarnings() throws java.sql.SQLException
clearWarnings
in interface java.sql.Connection
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
public java.sql.CallableStatement prepareCall(java.lang.String sql, int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
prepareCall
in interface java.sql.Connection
java.sql.SQLException
public java.util.Map getTypeMap() throws java.sql.SQLException
getTypeMap
in interface java.sql.Connection
java.sql.SQLException
public void setTypeMap(java.util.Map typeMap) throws java.sql.SQLException
setTypeMap
in interface java.sql.Connection
java.sql.SQLException
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
public void setHoldability(int holdability) throws java.sql.SQLException
setHoldability
in interface java.sql.Connection
java.sql.SQLException
public int getHoldability() throws java.sql.SQLException
getHoldability
in interface java.sql.Connection
java.sql.SQLException
public java.sql.Savepoint setSavepoint() throws java.sql.SQLException
setSavepoint
in interface java.sql.Connection
java.sql.SQLException
public java.sql.Savepoint setSavepoint(java.lang.String name) throws java.sql.SQLException
setSavepoint
in interface java.sql.Connection
java.sql.SQLException
public void rollback(java.sql.Savepoint savepoint) throws java.sql.SQLException
rollback
in interface java.sql.Connection
java.sql.SQLException
public void releaseSavepoint(java.sql.Savepoint savepoint) throws java.sql.SQLException
releaseSavepoint
in interface java.sql.Connection
java.sql.SQLException
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |