Package com.impossibl.postgres.jdbc
Class AbstractDataSource
- java.lang.Object
-
- com.impossibl.postgres.jdbc.AbstractDataSource
-
- All Implemented Interfaces:
CommonDataSource
- Direct Known Subclasses:
com.impossibl.postgres.jdbc.AbstractGeneratedDataSource
public abstract class AbstractDataSource extends Object implements CommonDataSource
Abstract 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(String username, String password)Create a connectionprotected abstract ReferencecreateReference()Create a reference using the correct ObjectFactory instanceStringgetClientEncoding()abstract StringgetDescription()StringgetHost()intgetLoginTimeout()PrintWritergetLogWriter()LoggergetParentLogger()intgetPort()ReferencegetReference()StringgetUrl()voidinit(Reference reference)InitvoidsetClientEncoding(String v)voidsetHost(String v)voidsetLoginTimeout(int seconds)voidsetLogWriter(PrintWriter out)voidsetPort(int v)voidsetUrl(String v)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.sql.CommonDataSource
createShardingKeyBuilder
-
-
-
-
Field Detail
-
settings
protected Settings settings
-
-
Method Detail
-
createConnection
protected PGDirectConnection createConnection(String username, String password) throws SQLException
Create a connection- Parameters:
username- The user namepassword- The password- Returns:
- The connection
- Throws:
SQLException- Thrown in case of an error
-
createReference
protected abstract Reference createReference()
Create a reference using the correct ObjectFactory instance- Returns:
- The reference
-
getReference
public Reference getReference()
-
init
public void init(Reference reference)
Init- Parameters:
reference- The reference
-
getDescription
public abstract String getDescription()
-
getLoginTimeout
public int getLoginTimeout()
- Specified by:
getLoginTimeoutin interfaceCommonDataSource
-
setLoginTimeout
public void setLoginTimeout(int seconds)
- Specified by:
setLoginTimeoutin interfaceCommonDataSource
-
getLogWriter
public PrintWriter getLogWriter()
- Specified by:
getLogWriterin interfaceCommonDataSource
-
setLogWriter
public void setLogWriter(PrintWriter out)
- Specified by:
setLogWriterin interfaceCommonDataSource
-
getParentLogger
public Logger getParentLogger()
- Specified by:
getParentLoggerin interfaceCommonDataSource
-
getUrl
public String getUrl()
-
setUrl
public void setUrl(String v)
-
getHost
public String getHost()
-
setHost
public void setHost(String v)
-
getPort
public int getPort()
-
setPort
public void setPort(int v)
-
getClientEncoding
public String getClientEncoding()
-
setClientEncoding
public void setClientEncoding(String v)
-
-