|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.nqadmin.swingSet.datasources.SSConnection
public class SSConnection
SSConnection.java
SwingSet - Open Toolkit For Making Swing Controls Database-Aware
The SSConnection class is a wrapper for Connection. It provides methods to specify the url, username, password & driver class name. The createConnection should be called before calling the getConnection method. When ever any connection parameters are changed createConnection has to be called to change to connection object.
| Constructor Summary | |
|---|---|
SSConnection()
Constructs a default SSConnection object. |
|
SSConnection(java.lang.String _url)
Constructs a SSConnection object with the specified database url. |
|
SSConnection(java.lang.String _url,
java.lang.String _username,
java.lang.String _password)
Constructs a SSConnection object with the specified database url. |
|
SSConnection(java.lang.String _url,
java.lang.String _username,
java.lang.String _password,
java.lang.String _driverName)
Constructs a SSConnection object with the specified database url. |
|
| Method Summary | |
|---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener _listener)
Method to add bean property change listeners. |
void |
addVetoableChangeListener(java.beans.VetoableChangeListener _listener)
Method to add bean vetoable change listeners. |
void |
createConnection()
Creates a connection to the database based on the information provided by the user. |
java.sql.Connection |
getConnection()
Returns the database connection object. |
java.lang.String |
getDriverName()
Returns the database driver being used. |
java.lang.String |
getPassword()
Returns the password being used to connect to the database. |
java.lang.String |
getUrl()
Returns the url to the database. |
java.lang.String |
getUsername()
Returns the username being used to connect to the database. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener _listener)
Method to remove bean property change listeners. |
void |
removeVetoableChangeListener(java.beans.VetoableChangeListener _listener)
Method to remove bean veto change listeners. |
void |
setDriverName(java.lang.String _driverName)
Sets the database driver class name. |
void |
setPassword(java.lang.String _password)
Sets the password to be used while connecting to the database. |
void |
setUrl(java.lang.String _url)
Sets the url to the database. |
void |
setUsername(java.lang.String _username)
Sets the username to be used while connecting to the database. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SSConnection()
public SSConnection(java.lang.String _url)
_url - - url to the database to which connection has to be established.
the url should be of the form jdbc:subprotocol:subname
public SSConnection(java.lang.String _url,
java.lang.String _username,
java.lang.String _password)
_url - - url to the database to which connection has to be established.
the url should be of the form jdbc:subprotocol:subname_username - - the database username on whose behalf the connection is being made_password - - the user's password
public SSConnection(java.lang.String _url,
java.lang.String _username,
java.lang.String _password,
java.lang.String _driverName)
_url - - url to the database to which connection has to be established.
the url should be of the form jdbc:subprotocol:subname_username - - the database username on whose behalf the connection is being made_password - - the user's password_driverName - - name of the database driver to be used.| Method Detail |
|---|
public void addPropertyChangeListener(java.beans.PropertyChangeListener _listener)
_listener - bean property change listenerpublic void removePropertyChangeListener(java.beans.PropertyChangeListener _listener)
_listener - bean property change listenerpublic void addVetoableChangeListener(java.beans.VetoableChangeListener _listener)
_listener - bean vetoable change listenerpublic void removeVetoableChangeListener(java.beans.VetoableChangeListener _listener)
_listener - bean veto change listenerpublic void setUrl(java.lang.String _url)
_url - - url to the database to which connection has to be established.
the url should be of the form jdbc:subprotocol:subnamepublic java.lang.String getUrl()
public void setUsername(java.lang.String _username)
_username - - the database username on whose behalf the connection is being madepublic java.lang.String getUsername()
public void setPassword(java.lang.String _password)
_password - - the user's password to be used.public java.lang.String getPassword()
public void setDriverName(java.lang.String _driverName)
_driverName - - name of the database driver to be used.public java.lang.String getDriverName()
public java.sql.Connection getConnection()
public void createConnection()
throws java.sql.SQLException,
java.lang.ClassNotFoundException
java.sql.SQLException
java.lang.ClassNotFoundException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||