public class Postgres extends JdbcConnectionResource
_conn, _driver, _flags, _host, _isEmulatePrepares, _port, _socket, _sqlParseToken, _url
Constructor and Description |
---|
Postgres(Env env,
java.lang.String host,
java.lang.String user,
java.lang.String password,
java.lang.String db,
int port,
java.lang.String driver,
java.lang.String url) |
Modifier and Type | Method and Description |
---|---|
protected void |
clearErrors()
This function is overriden in Postgres to clear
any postgres specific server error message
|
protected ConnectionEntry |
connectImpl(Env env,
java.lang.String host,
java.lang.String userName,
java.lang.String password,
java.lang.String dbname,
int port,
java.lang.String socket,
int flags,
java.lang.String driver,
java.lang.String url,
boolean isNewLink,
boolean isEmulatePrepares)
Connects to the underlying database.
|
protected JdbcResultResource |
createResult(java.sql.Statement stmt,
java.sql.ResultSet rs)
Creates a database-specific result.
|
protected PostgresStatement |
createStatementResource(Env env) |
PostgresResult |
getAsynchronousResult() |
PostgresStatement |
getAsynchronousStatement() |
java.lang.String |
getClientEncoding()
Return the "client_encoding" property.
|
protected java.lang.String |
getDriverName() |
protected java.lang.Object |
getServerErrorMessage()
Return the postgres server specific error message
|
PostgresStatement |
getStatement(java.lang.String name) |
protected void |
keepResourceValues(java.sql.Statement stmt)
This function is overriden in Postgres to keep
result set references for php/430a (see also php/1f33)
|
protected boolean |
keepStatementOpen()
This function is overriden in Postgres to keep
statement references for php/430a
|
static StringValue |
pgRealEscapeString(StringValue str) |
PostgresStatement |
prepare(Env env,
java.lang.String query)
returns a prepared statement
|
void |
putStatement(java.lang.String name,
PostgresStatement stmt) |
PostgresResult |
query(Env env,
java.lang.String sql)
Executes a query.
|
protected StringValue |
realEscapeString(StringValue str)
Escape the given string for SQL statements.
|
PostgresStatement |
removeStatement(java.lang.String name) |
protected void |
saveErrors(java.sql.SQLException e)
This function is overriden in Postgres to save
the postgres specific server error message
|
void |
setAsynchronousResult(PostgresResult asyncResult) |
void |
setAsynchronousStatement(PostgresStatement asyncStmt) |
boolean |
setClientEncoding(java.lang.String encoding)
Set the "client_encoding" property.
|
java.lang.String |
toString()
Converts to a string.
|
cleanup, close, closeStatement, commit, connectInternal, createJavaStatement, createStatement, error, getAffectedRows, getAutoCommit, getCatalog, getCatalogs, getCharacterSetName, getClientInfo, getClientInfo, getConnection, getDbName, getDriver, getErrorCode, getErrorMessage, getException, getFieldCount, getHost, getHostInfo, getJavaConnection, getPassword, getPort, getResultResource, getResultSet, getServerInfo, getServerStat, getTableMetaData, getUrl, getURL, getUserName, getWarnings, infoToVersion, isConnected, isEmulatePrepares, isSeekable, parseSqlToken, ping, realEscapeString, realQuery, rollback, setAffectedRows, setAutoCommit, setCatalog, setResultResource, setWarnings, toObject, validateConnection
public Postgres(Env env, java.lang.String host, java.lang.String user, java.lang.String password, java.lang.String db, int port, java.lang.String driver, java.lang.String url)
protected java.lang.String getDriverName()
getDriverName
in class JdbcConnectionResource
protected ConnectionEntry connectImpl(Env env, java.lang.String host, java.lang.String userName, java.lang.String password, java.lang.String dbname, int port, java.lang.String socket, int flags, java.lang.String driver, java.lang.String url, boolean isNewLink, boolean isEmulatePrepares)
connectImpl
in class JdbcConnectionResource
public PostgresStatement prepare(Env env, java.lang.String query)
prepare
in class JdbcConnectionResource
protected PostgresStatement createStatementResource(Env env)
createStatementResource
in class JdbcConnectionResource
public PostgresResult query(Env env, java.lang.String sql)
sql
- the escaped query string
(can contain escape sequences like `\n' and `\Z')JdbcResultResource
, or null for failureprotected JdbcResultResource createResult(java.sql.Statement stmt, java.sql.ResultSet rs)
createResult
in class JdbcConnectionResource
public void setAsynchronousResult(PostgresResult asyncResult)
public PostgresResult getAsynchronousResult()
public PostgresStatement getAsynchronousStatement()
public void setAsynchronousStatement(PostgresStatement asyncStmt)
public void putStatement(java.lang.String name, PostgresStatement stmt)
public PostgresStatement getStatement(java.lang.String name)
public PostgresStatement removeStatement(java.lang.String name)
protected void keepResourceValues(java.sql.Statement stmt)
keepResourceValues
in class JdbcConnectionResource
protected boolean keepStatementOpen()
keepStatementOpen
in class JdbcConnectionResource
public static StringValue pgRealEscapeString(StringValue str)
protected StringValue realEscapeString(StringValue str)
str
- a stringprotected void clearErrors()
clearErrors
in class JdbcConnectionResource
protected void saveErrors(java.sql.SQLException e)
saveErrors
in class JdbcConnectionResource
protected java.lang.Object getServerErrorMessage()
public java.lang.String toString()
JdbcConnectionResource
toString
in class JdbcConnectionResource
public java.lang.String getClientEncoding()
getClientEncoding
in class JdbcConnectionResource
public boolean setClientEncoding(java.lang.String encoding)
setClientEncoding
in class JdbcConnectionResource