Package com.impossibl.postgres.jdbc
Class AbstractDataSource
- java.lang.Object
-
- com.impossibl.postgres.jdbc.AbstractDataSource
-
- All Implemented Interfaces:
javax.sql.CommonDataSource
- Direct Known Subclasses:
com.impossibl.postgres.jdbc.AbstractGeneratedDataSource
public abstract class AbstractDataSource extends java.lang.Object implements javax.sql.CommonDataSourceAbstract DataSource implementation
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractDataSource()Constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected PGDirectConnectioncreateConnection(java.lang.String username, java.lang.String password)Create a connectionprotected abstract javax.naming.ReferencecreateReference()Create a reference using the correct ObjectFactory instancejava.lang.StringgetClientEncoding()abstract java.lang.StringgetDescription()java.lang.StringgetHost()intgetLoginTimeout()java.io.PrintWritergetLogWriter()java.util.logging.LoggergetParentLogger()intgetPort()javax.naming.ReferencegetReference()voidinit(javax.naming.Reference reference)InitvoidsetClientEncoding(java.lang.String v)voidsetHost(java.lang.String v)voidsetLoginTimeout(int seconds)voidsetLogWriter(java.io.PrintWriter out)voidsetPort(int v)
-
-
-
Field Detail
-
settings
protected Settings settings
-
-
Method Detail
-
createConnection
protected PGDirectConnection createConnection(java.lang.String username, java.lang.String password) throws java.sql.SQLException
Create a connection- Parameters:
username- The user namepassword- The password- Returns:
- The connection
- Throws:
java.sql.SQLException- Thrown in case of an error
-
createReference
protected abstract javax.naming.Reference createReference()
Create a reference using the correct ObjectFactory instance- Returns:
- The reference
-
getReference
public javax.naming.Reference getReference()
-
init
public void init(javax.naming.Reference reference)
Init- Parameters:
reference- The reference
-
getDescription
public abstract java.lang.String getDescription()
-
getLoginTimeout
public int getLoginTimeout() throws java.sql.SQLException- Specified by:
getLoginTimeoutin interfacejavax.sql.CommonDataSource- Throws:
java.sql.SQLException
-
setLoginTimeout
public void setLoginTimeout(int seconds) throws java.sql.SQLException- Specified by:
setLoginTimeoutin interfacejavax.sql.CommonDataSource- Throws:
java.sql.SQLException
-
getLogWriter
public java.io.PrintWriter getLogWriter() throws java.sql.SQLException- Specified by:
getLogWriterin interfacejavax.sql.CommonDataSource- Throws:
java.sql.SQLException
-
setLogWriter
public void setLogWriter(java.io.PrintWriter out) throws java.sql.SQLException- Specified by:
setLogWriterin interfacejavax.sql.CommonDataSource- Throws:
java.sql.SQLException
-
getParentLogger
public java.util.logging.Logger getParentLogger() throws java.sql.SQLFeatureNotSupportedException- Specified by:
getParentLoggerin interfacejavax.sql.CommonDataSource- Throws:
java.sql.SQLFeatureNotSupportedException
-
getHost
public java.lang.String getHost()
-
setHost
public void setHost(java.lang.String v)
-
getPort
public int getPort()
-
setPort
public void setPort(int v)
-
getClientEncoding
public java.lang.String getClientEncoding()
-
setClientEncoding
public void setClientEncoding(java.lang.String v)
-
-