org.sourceforge.jxdbcon.postgresql
Class IntConnection
java.lang.Object
|
+--org.sourceforge.jxdbcon.AbstractConnection
|
+--org.sourceforge.jxdbcon.postgresql.PGConnection
|
+--org.sourceforge.jxdbcon.postgresql.IntConnection
- All Implemented Interfaces:
- Cloneable, Connection, InfoKeys, PGInfoKeys, Runnable
- public class IntConnection
- extends PGConnection
- implements Runnable
This class implements PGConnection via a special Socket connection.
It will be used once a proper java enabled procedural language is
implemented. Currently it is designed to work against the preliminary
sample implementation pl/jx that is part of jxDBCon.
- Version:
- $Revision: 1.5 $
- Author:
- Keve Müller
Methods inherited from class org.sourceforge.jxdbcon.postgresql.PGConnection |
close, commit, createStatement, exec, executeBatch, executeSQL, fillPropertyInfo, findFunc, findFunc, getAutoCommit, getConversionContext, getEscapeContext, getGeneratedKeys, getMetaData, getProtocol, getResultSet, getResultSet, getType, getType, getTypeOid, open, prepareCall, prepareStatement, res2Types, rollback, setAutoCommit, setCatalog, setTransactionIsolation, takeOver, toString |
Methods inherited from class org.sourceforge.jxdbcon.AbstractConnection |
clearWarnings, clone, createStatement, createStatement, duplicate, finalize, getCatalog, getHoldability, getInfo, getTypeMap, getWarnings, isClosed, isReadOnly, nativeSQL, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, rollback, setHoldability, setReadOnly, setSavepoint, setSavepoint, setTypeMap |
conninstance
private static ThreadLocal conninstance
functionCache
Map functionCache
proto
private IntProtocol proto
scratchDir
File scratchDir
scratchLoader
ClassLoader scratchLoader
IntConnection
public IntConnection(IntProtocol proto)
throws SQLException
- Construct the connection instance.
connect
protected PGProtocol connect(Properties info)
- Description copied from class:
PGConnection
- Open a connection.
- Specified by:
connect
in class PGConnection
doFunctionCall
Object doFunctionCall(long funcOid,
String src,
Object[] paramObject,
AbstractType rt,
AbstractType[] at)
throws SQLException,
IOException
SQLException
IOException
exec
public PGFuncResult exec(long funcOid,
byte[][] param)
- Overrides:
exec
in class PGConnection
exec
public PGExecResult exec(String sql)
- Overrides:
exec
in class PGConnection
findFunc
public PGFunc[] findFunc(long funcOid,
int argLen)
throws SQLException
- Description copied from class:
PGConnection
- Find a PostgreSQL function by oid and parameter list length.
- Overrides:
findFunc
in class PGConnection
- Returns:
- a zero length array if the function is not found, or a one length array if it is.
SQLException
getTransactionIsolation
public int getTransactionIsolation()
throws SQLException
- Description copied from class:
AbstractConnection
- Get the transaction isolation level.
- Specified by:
getTransactionIsolation
in interface Connection
- Overrides:
getTransactionIsolation
in class PGConnection
- Returns:
- TRANSACTION_NONE.
- Throws:
SQLException
- if a database error occurs
getTypeFromOid
AbstractType getTypeFromOid(long oid)
throws IOException
- Get the AbstractType for an oid.
If the oid is known already, return the cached type.
If not, send down the query for the type to the backend and
prepare the results.
IOException
internalConnection
public static IntConnection internalConnection()
manageComment
void manageComment(IntProtocol.CommentQuery q)
throws IOException
IOException
manageConnect
void manageConnect(IntProtocol.ConnectQuery q)
throws IOException
IOException
manageFunctionCall
void manageFunctionCall(IntProtocol.FunctionCallQuery q)
throws IOException
- High level communcation function to execute a locally known function and
return its result.
IOException
prepareClassLoader
void prepareClassLoader()
throws IOException
IOException
queryType
IntProtocol.Type queryType(long oid)
throws IOException
- High level communication function for querying pg_type given the oid.
IOException
run
public void run()
- Specified by:
run
in interface Runnable
setCopyInStream
public void setCopyInStream(InputStream in)
setCopyOutStream
public void setCopyOutStream(OutputStream out)
Copyright © 2001,2002 Keve Müller; see LICENSE file for details.