|
|||||||||
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 javax.naming.Reference |
createReference()
Generates a reference using the appropriate object factory. |
java.sql.Connection |
getConnection()
Gets a connection to the PostgreSQL database. |
java.sql.Connection |
getConnection(java.lang.String user,
java.lang.String password)
Gets a connection to the PostgreSQL database. |
java.lang.String |
getDatabaseName()
Gets the name of the PostgreSQL database, running on the server identified by the serverName property. |
abstract java.lang.String |
getDescription()
Gets a description of this DataSource-ish thing. |
int |
getLoginTimeout()
|
java.io.PrintWriter |
getLogWriter()
Gets the log writer used to log connections opened. |
java.lang.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. |
javax.naming.Reference |
getReference()
|
java.lang.String |
getServerName()
Gets the name of the host the PostgreSQL database is running on. |
java.lang.String |
getUser()
Gets the user to connect as by default. |
protected void |
readBaseObject(java.io.ObjectInputStream in)
|
void |
setDatabaseName(java.lang.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(java.io.PrintWriter printWriter)
The DataSource will note every connection opened to the provided log writer. |
void |
setPassword(java.lang.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(java.lang.String serverName)
Sets the name of the host the PostgreSQL database is running on. |
void |
setUser(java.lang.String user)
Sets the user to connect as by default. |
protected void |
writeBaseObject(java.io.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 java.sql.Connection getConnection() throws java.sql.SQLException
java.sql.SQLException
- Occurs when the database connection cannot be established.public java.sql.Connection getConnection(java.lang.String user, java.lang.String password) throws java.sql.SQLException
java.sql.SQLException
- Occurs when the database connection cannot be established.public int getLoginTimeout() throws java.sql.SQLException
java.sql.SQLException
public void setLoginTimeout(int i) throws java.sql.SQLException
java.sql.SQLException
public java.io.PrintWriter getLogWriter() throws java.sql.SQLException
java.sql.SQLException
public void setLogWriter(java.io.PrintWriter printWriter) throws java.sql.SQLException
java.sql.SQLException
public java.lang.String getServerName()
public void setServerName(java.lang.String serverName)
public java.lang.String getDatabaseName()
public void setDatabaseName(java.lang.String databaseName)
public abstract java.lang.String getDescription()
public java.lang.String getUser()
public void setUser(java.lang.String user)
public java.lang.String getPassword()
public void setPassword(java.lang.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)
protected javax.naming.Reference createReference()
public javax.naming.Reference getReference() throws javax.naming.NamingException
getReference
in interface javax.naming.Referenceable
javax.naming.NamingException
protected void writeBaseObject(java.io.ObjectOutputStream out) throws java.io.IOException
java.io.IOException
protected void readBaseObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |