org.jdesktop.swingx.auth
public class JDBCLoginService extends LoginService
Constructor and Description |
---|
JDBCLoginService()
Default JavaBean constructor
|
JDBCLoginService(java.lang.String jndiContext)
Create a new JDBCLoginService and initializes it to connect to a
database using the given params.
|
JDBCLoginService(java.lang.String driver,
java.lang.String url)
Create a new JDBCLoginService and initializes it to connect to a
database using the given params.
|
JDBCLoginService(java.lang.String driver,
java.lang.String url,
java.util.Properties props)
Create a new JDBCLoginService and initializes it to connect to a
database using the given params.
|
Modifier and Type | Method and Description |
---|---|
boolean |
authenticate(java.lang.String name,
char[] password,
java.lang.String server)
This method is intended to be implemented by clients wishing to
authenticate a user with a given password.
|
java.sql.Connection |
getConnection() |
java.util.Properties |
getProperties() |
java.lang.String |
getUrl() |
void |
setConnection(java.sql.Connection conn) |
void |
setProperties(java.util.Properties properties) |
void |
setUrl(java.lang.String url) |
addLoginListener, cancelAuthentication, getServer, getSynchronous, getUserRoles, removeLoginListener, setServer, setSynchronous, startAuthentication
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, clone, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
public JDBCLoginService(java.lang.String driver, java.lang.String url)
driver
- url
- public JDBCLoginService(java.lang.String driver, java.lang.String url, java.util.Properties props)
driver
- url
- props
- public JDBCLoginService(java.lang.String jndiContext)
jndiContext
- public JDBCLoginService()
public java.lang.String getUrl()
public void setUrl(java.lang.String url)
url
- set the JDBC connection urlpublic 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 driverpublic java.sql.Connection getConnection()
public void setConnection(java.sql.Connection conn)
public boolean authenticate(java.lang.String name, char[] password, java.lang.String server) throws java.lang.Exception
LoginService
authenticate
in class LoginService
name
- user namepassword
- user passwordserver
- Must be either a valid JDBC URL for the type of JDBC driver you are using,
or must be a valid JNDIContext from which to get the database connectiontrue
on authentication successjava.lang.Exception