public class JDBCLoginService extends LoginService
| Constructor | Description |
|---|---|
JDBCLoginService() |
Default JavaBean constructor
|
JDBCLoginService(String jndiContext) |
Create a new JDBCLoginService and initializes it to connect to a
database using the given params.
|
JDBCLoginService(String driver,
String url) |
Create a new JDBCLoginService and initializes it to connect to a
database using the given params.
|
JDBCLoginService(String driver,
String url,
Properties props) |
Create a new JDBCLoginService and initializes it to connect to a
database using the given params.
|
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
authenticate(String name,
char[] password,
String server) |
This method is intended to be implemented by clients wishing to
authenticate a user with a given password.
|
Connection |
getConnection() |
|
Properties |
getProperties() |
|
String |
getUrl() |
|
void |
setConnection(Connection conn) |
|
void |
setProperties(Properties properties) |
|
void |
setUrl(String url) |
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, clone, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListeneraddLoginListener, cancelAuthentication, getServer, getSynchronous, getUserRoles, removeLoginListener, setServer, setSynchronous, startAuthenticationpublic JDBCLoginService(String driver, String url)
driver - url - public JDBCLoginService(String driver, String url, Properties props)
driver - url - props - public JDBCLoginService(String jndiContext)
jndiContext - public JDBCLoginService()
public String getUrl()
public void setUrl(String url)
url - set the JDBC connection urlpublic Properties getProperties()
public void setProperties(Properties properties)
properties - miscellaneous JDBC properties to use when connecting
to the database via the JDBC driverpublic Connection getConnection()
public void setConnection(Connection conn)
public boolean authenticate(String name, char[] password, String server) throws Exception
LoginServiceauthenticate in class LoginServicename - 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 successExceptionCopyright © 2018. All rights reserved.