@JavaBean public class JDBCLoginService extends LoginService
Constructor and 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 and 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) |
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(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
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 successException
Copyright © 2017. All rights reserved.