|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.postgresql.ds.common.BaseDataSource
public abstract class BaseDataSource
Base class for data sources and related classes.
Constructor Summary | |
---|---|
BaseDataSource()
|
Method Summary | |
---|---|
protected Reference |
createReference()
Generates a reference using the appropriate object factory. |
String |
getCompatible()
|
Connection |
getConnection()
Gets a connection to the PostgreSQL database. |
Connection |
getConnection(String user,
String password)
Gets a connection to the PostgreSQL database. |
String |
getDatabaseName()
Gets the name of the PostgreSQL database, running on the server identified by the serverName property. |
abstract String |
getDescription()
Gets a description of this DataSource-ish thing. |
int |
getLoginTimeout()
|
PrintWriter |
getLogWriter()
Gets the log writer used to log connections opened. |
String |
getPassword()
Gets the password to connect with by default. |
int |
getPortNumber()
Gets the port which the PostgreSQL server is listening on for TCP/IP connections. |
int |
getPrepareThreshold()
Gets the default threshold for enabling server-side prepare. |
Reference |
getReference()
|
String |
getServerName()
Gets the name of the host the PostgreSQL database is running on. |
int |
getSocketTimeout()
|
boolean |
getSsl()
Gets SSL encryption setting. |
String |
getSslfactory()
Gets the name of the SSLSocketFactory used for connections. |
boolean |
getTcpKeepAlive()
|
int |
getUnknownLength()
|
String |
getUser()
Gets the user to connect as by default. |
void |
initializeFrom(BaseDataSource source)
|
protected void |
readBaseObject(ObjectInputStream in)
|
void |
setCompatible(String compatible)
|
void |
setDatabaseName(String databaseName)
Sets the name of the PostgreSQL database, running on the server identified by the serverName property. |
void |
setLoginTimeout(int i)
Set the login timeout, in seconds. |
void |
setLogWriter(PrintWriter printWriter)
The DataSource will note every connection opened to the provided log writer. |
void |
setPassword(String password)
Sets the password to connect with by default. |
void |
setPortNumber(int portNumber)
Gets the port which the PostgreSQL server is listening on for TCP/IP connections. |
void |
setPrepareThreshold(int count)
Sets the default threshold for enabling server-side prepare. |
void |
setServerName(String serverName)
Sets the name of the host the PostgreSQL database is running on. |
void |
setSocketTimeout(int seconds)
Sets the socket timeout (SOTimeout), in seconds |
void |
setSsl(boolean enabled)
Set whether the connection will be SSL encrypted or not. |
void |
setSslfactory(String classname)
Set the name of the SSLSocketFactory to use for connections. |
void |
setTcpKeepAlive(boolean enabled)
|
void |
setUnknownLength(int unknownLength)
|
void |
setUser(String user)
Sets the user to connect as by default. |
protected void |
writeBaseObject(ObjectOutputStream out)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BaseDataSource()
Method Detail |
---|
public Connection getConnection() throws SQLException
SQLException
- Occurs when the database connection cannot be established.public Connection getConnection(String user, String password) throws SQLException
SQLException
- Occurs when the database connection cannot be established.public int getLoginTimeout() throws SQLException
SQLException
public void setLoginTimeout(int i) throws SQLException
SQLException
public PrintWriter getLogWriter() throws SQLException
SQLException
public void setLogWriter(PrintWriter printWriter) throws SQLException
SQLException
public String getServerName()
public void setServerName(String serverName)
public String getCompatible()
public void setCompatible(String compatible)
public String getDatabaseName()
public void setDatabaseName(String databaseName)
public abstract String getDescription()
public String getUser()
public void setUser(String user)
public String getPassword()
public void setPassword(String password)
public int getPortNumber()
public void setPortNumber(int portNumber)
public void setPrepareThreshold(int count)
PGConnection.setPrepareThreshold(int)
for details.
count
- the number of times a statement object must be reused before server-side
prepare is enabled.public int getPrepareThreshold()
setPrepareThreshold(int)
public void setUnknownLength(int unknownLength)
public int getUnknownLength()
public void setSocketTimeout(int seconds)
public int getSocketTimeout()
public void setSsl(boolean enabled)
enabled
- if true
, connect with SSL.public boolean getSsl()
true
if connections will be encrypted with SSL.public void setSslfactory(String classname)
SSLSocketFactory
to use for connections.
Use org.postgresql.ssl.NonValidatingFactory
if you don't want certificate validation.
classname
- name of a subclass of javax.net.ssl.SSLSocketFactory
or null
for the default implementation.public String getSslfactory()
SSLSocketFactory
used for connections.
null
if the default implementation is used.public void setTcpKeepAlive(boolean enabled)
public boolean getTcpKeepAlive()
protected Reference createReference()
public Reference getReference() throws NamingException
getReference
in interface Referenceable
NamingException
protected void writeBaseObject(ObjectOutputStream out) throws IOException
IOException
protected void readBaseObject(ObjectInputStream in) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
public void initializeFrom(BaseDataSource source) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |