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.CommonDataSource
Abstract DataSource implementation
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractDataSource()
Constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected PGDirectConnection
createConnection(java.lang.String username, java.lang.String password)
Create a connectionprotected abstract javax.naming.Reference
createReference()
Create a reference using the correct ObjectFactory instancejava.lang.String
getClientEncoding()
abstract java.lang.String
getDescription()
java.lang.String
getHost()
int
getLoginTimeout()
java.io.PrintWriter
getLogWriter()
java.util.logging.Logger
getParentLogger()
int
getPort()
javax.naming.Reference
getReference()
void
init(javax.naming.Reference reference)
Initvoid
setClientEncoding(java.lang.String v)
void
setHost(java.lang.String v)
void
setLoginTimeout(int seconds)
void
setLogWriter(java.io.PrintWriter out)
void
setPort(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:
getLoginTimeout
in interfacejavax.sql.CommonDataSource
- Throws:
java.sql.SQLException
-
setLoginTimeout
public void setLoginTimeout(int seconds) throws java.sql.SQLException
- Specified by:
setLoginTimeout
in interfacejavax.sql.CommonDataSource
- Throws:
java.sql.SQLException
-
getLogWriter
public java.io.PrintWriter getLogWriter() throws java.sql.SQLException
- Specified by:
getLogWriter
in interfacejavax.sql.CommonDataSource
- Throws:
java.sql.SQLException
-
setLogWriter
public void setLogWriter(java.io.PrintWriter out) throws java.sql.SQLException
- Specified by:
setLogWriter
in interfacejavax.sql.CommonDataSource
- Throws:
java.sql.SQLException
-
getParentLogger
public java.util.logging.Logger getParentLogger() throws java.sql.SQLFeatureNotSupportedException
- Specified by:
getParentLogger
in 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)
-
-