|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.j256.ormlite.support.SimpleDataSource
public class SimpleDataSource
Implementation of the DataSource interface that supports what is needed by ORMLite. This is not thread-safe
nor synchronized. For multi-threaded, high-performance data sources, see Apache DBCP, CP30, or BoneCP.
NOTE: If you are using the Spring type wiring in Java, initialize() should be called after all of the
set methods. In Spring XML, init-method="initialize" should be used.
| Constructor Summary | |
|---|---|
SimpleDataSource()
Constructor for Spring type wiring if you are using the set methods. |
|
SimpleDataSource(String url)
Create a data source for a particular database URL. |
|
SimpleDataSource(String url,
String username,
String password)
Create a data source for a particular database URL with username and password permissions. |
|
| Method Summary | ||
|---|---|---|
void |
close()
Close any connections opened by the data source. |
|
void |
destroy()
Cleanup method to close any open connections and do other cleanups. |
|
Connection |
getConnection()
|
|
Connection |
getConnection(String username,
String password)
|
|
int |
getLoginTimeout()
|
|
PrintWriter |
getLogWriter()
|
|
String |
getUrl()
|
|
void |
initialize()
If you are using the Spring type wiring, this should be called after all of the set methods. |
|
boolean |
isWrapperFor(Class<?> iface)
NOTE: this is part of the Java6 JDK definition for DataSource. |
|
void |
setLoginTimeout(int loginTimeoutSecs)
|
|
void |
setLogWriter(PrintWriter printWriter)
|
|
void |
setPassword(String password)
|
|
void |
setUrl(String url)
|
|
void |
setUsername(String username)
|
|
|
unwrap(Class<T> iface)
NOTE: this is part of the Java6 JDK definition for DataSource. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleDataSource()
public SimpleDataSource(String url)
public SimpleDataSource(String url,
String username,
String password)
| Method Detail |
|---|
public void initialize()
public void destroy()
throws SQLException
SQLException
public void close()
throws SQLException
SQLExceptionpublic String getUrl()
public void setUrl(String url)
public Connection getConnection()
throws SQLException
getConnection in interface DataSourceSQLException
public Connection getConnection(String username,
String password)
throws SQLException
getConnection in interface DataSourceSQLExceptionpublic PrintWriter getLogWriter()
getLogWriter in interface CommonDataSourcepublic void setLogWriter(PrintWriter printWriter)
setLogWriter in interface CommonDataSourcepublic int getLoginTimeout()
getLoginTimeout in interface CommonDataSourcepublic void setLoginTimeout(int loginTimeoutSecs)
setLoginTimeout in interface CommonDataSourcepublic void setUsername(String username)
public void setPassword(String password)
public boolean isWrapperFor(Class<?> iface)
throws SQLException
DataSource.
isWrapperFor in interface WrapperSQLException
public <T> T unwrap(Class<T> iface)
throws SQLException
DataSource.
unwrap in interface WrapperSQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||