public class SQLDatabase extends Object implements LookupService, LifeCycle
| Modifier and Type | Field and Description |
|---|---|
(package private) String[] |
columns |
(package private) Connection |
connection |
(package private) DatabaseDialect |
dialect |
(package private) static org.slf4j.Logger |
log |
(package private) String |
password |
(package private) String |
select |
(package private) PreparedStatement |
statement |
(package private) SourceURL |
url |
(package private) String |
username |
| Constructor and Description |
|---|
SQLDatabase() |
| Modifier and Type | Method and Description |
|---|---|
void |
finish() |
String |
getPassword() |
String |
getSelect() |
SourceURL |
getUrl() |
String |
getUsername() |
void |
init(ApplicationContext context) |
Data |
lookup(String key) |
void |
reset() |
void |
setPassword(String password) |
void |
setSelect(String select) |
void |
setUrl(SourceURL url) |
void |
setUsername(String username) |
static org.slf4j.Logger log
@Parameter(description="The database URL. This is expected to be JDBC compatible URL.") SourceURL url
@Parameter(description="The user to connect to the database.") String username
@Parameter(description="The password for connecting to the database.") String password
@Parameter(description="The SQL query to call for the lookup. The \'?\' character is used as placeholder for the ID value.") String select
String[] columns
DatabaseDialect dialect
transient Connection connection
transient PreparedStatement statement
public void reset()
throws Exception
reset in interface ServiceExceptionService.reset()public void init(ApplicationContext context) throws Exception
public void finish()
throws Exception
finish in interface LifeCycleExceptionLifeCycle.finish()public Data lookup(String key)
lookup in interface LookupServiceLookupService.lookup(java.lang.String)public SourceURL getUrl()
public void setUrl(SourceURL url)
url - the url to setpublic String getSelect()
public void setSelect(String select)
select - the select to setpublic String getUsername()
public void setUsername(String username)
username - the username to setpublic String getPassword()
public void setPassword(String password)
password - the password to setCopyright © 2018. All rights reserved.