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 protected
AbstractDataSource()
Constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected PGDirectConnection
createConnection(String username, String password)
Create a connectionprotected abstract Reference
createReference()
Create a reference using the correct ObjectFactory instanceString
getClientEncoding()
abstract String
getDescription()
String
getHost()
int
getLoginTimeout()
PrintWriter
getLogWriter()
Logger
getParentLogger()
int
getPort()
Reference
getReference()
String
getUrl()
void
init(Reference reference)
Initvoid
setClientEncoding(String v)
void
setHost(String v)
void
setLoginTimeout(int seconds)
void
setLogWriter(PrintWriter out)
void
setPort(int v)
void
setUrl(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:
getLoginTimeout
in interfaceCommonDataSource
-
setLoginTimeout
public void setLoginTimeout(int seconds)
- Specified by:
setLoginTimeout
in interfaceCommonDataSource
-
getLogWriter
public PrintWriter getLogWriter()
- Specified by:
getLogWriter
in interfaceCommonDataSource
-
setLogWriter
public void setLogWriter(PrintWriter out)
- Specified by:
setLogWriter
in interfaceCommonDataSource
-
getParentLogger
public Logger getParentLogger()
- Specified by:
getParentLogger
in 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)
-
-