com.amazon.carbonado.repo.jdbc
Class SimpleDataSource
java.lang.Object
com.amazon.carbonado.repo.jdbc.SimpleDataSource
- All Implemented Interfaces:
- Wrapper, CommonDataSource, DataSource
public class SimpleDataSource
- extends Object
- implements DataSource
SimpleDataSource does not implement any connection pooling.
- Author:
- Brian S O'Neill
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimpleDataSource
public SimpleDataSource(String driverClass,
String driverURL,
Properties properties)
throws SQLException
- Parameters:
driverClass - JDBC driver to load; can pass null if already loadeddriverURL - JDBC driver URLproperties - optional connection properties
- Throws:
SQLException- Since:
- 1.2
SimpleDataSource
public SimpleDataSource(String driverClass,
String driverURL,
String username,
String password)
throws SQLException
- Parameters:
driverClass - JDBC driver to load; can pass null if already loadeddriverURL - JDBC driver URLusername - optional username to connect withpassword - optional password to connect with
- Throws:
SQLException
SimpleDataSource
public SimpleDataSource(String driverClass,
String driverURL,
String username,
String password,
Properties properties)
throws SQLException
- Parameters:
driverClass - JDBC driver to load; can pass null if already loadeddriverURL - JDBC driver URLusername - optional username to connect withpassword - optional password to connect withproperties - optional connection properties
- Throws:
SQLException- Since:
- 1.2
getConnection
public Connection getConnection()
throws SQLException
- Specified by:
getConnection in interface DataSource
- Throws:
SQLException
getConnection
public Connection getConnection(String username,
String password)
throws SQLException
- Specified by:
getConnection in interface DataSource
- Throws:
SQLException
getLogWriter
public PrintWriter getLogWriter()
throws SQLException
- Specified by:
getLogWriter in interface CommonDataSource
- Throws:
SQLException
setLogWriter
public void setLogWriter(PrintWriter writer)
throws SQLException
- Specified by:
setLogWriter in interface CommonDataSource
- Throws:
SQLException
setLoginTimeout
public void setLoginTimeout(int seconds)
throws SQLException
- Specified by:
setLoginTimeout in interface CommonDataSource
- Throws:
SQLException
getLoginTimeout
public int getLoginTimeout()
throws SQLException
- Specified by:
getLoginTimeout in interface CommonDataSource
- Throws:
SQLException
close
public void close()
throws SQLException
- Throws:
SQLException- Since:
- 1.2
unwrap
public <T> T unwrap(Class<T> iface)
throws SQLException
- Specified by:
unwrap in interface Wrapper
- Throws:
SQLException- Since:
- 1.2
isWrapperFor
public boolean isWrapperFor(Class<?> iface)
throws SQLException
- Specified by:
isWrapperFor in interface Wrapper
- Throws:
SQLException- Since:
- 1.2
Copyright © 2006-2009 Amazon Technologies, Inc.. All Rights Reserved.