|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object pgj
Nested Class Summary | |
static class |
pgj.AuthReply
|
static class |
pgj.BackendKeyData
|
static class |
pgj.BindComplete
|
static class |
pgj.ChunkReadThread
Reads and parses input stream, storing to queue and printing. |
static class |
pgj.CloseComplete
|
static class |
pgj.CommandComplete
|
static class |
pgj.CopyData
|
static class |
pgj.CopyDone
|
static class |
pgj.DataRow
|
static class |
pgj.EmitQueryResponse
|
static class |
pgj.ErrorResponse
|
static class |
pgj.FunctionCallResponse
|
static class |
pgj.NoData
|
static class |
pgj.NotificationResponse
|
static class |
pgj.ParameterDescription
|
static class |
pgj.ParameterStatus
|
static class |
pgj.ParseComplete
|
static class |
pgj.PortalSuspended
|
static interface |
pgj.ProtocolChunk
tagging interface. |
static class |
pgj.ReadyForQuery
|
static class |
pgj.RowDescription
|
Field Summary | |
static byte |
describePortal
|
static byte |
describeStatement
|
Constructor Summary | |
pgj()
|
Method Summary | |
void |
addChunk(pgj.ProtocolChunk it)
add a chunk to the queue. |
int |
availableChunks()
how many ProtocolChunks do we have from the server? |
void |
bind(java.lang.String portal,
java.lang.String statementName,
short[] paramFormats,
byte[][] parameters,
short[] resultFormats)
|
void |
bindOrFunc(java.lang.String portal,
java.lang.String statementName,
short[] paramFormats,
byte[][] parameters,
short[] resultFormats,
byte op)
|
void |
cancelRequest(int pid,
int key)
send CancelRequest messsage |
void |
close(byte mode,
java.lang.String name)
|
void |
closeConnection()
send the terminate message and close the secket |
void |
copyData(byte[] data)
sends data. |
java.io.OutputStream |
copyDataStart(int len)
sends a copy data header. |
void |
copyDone()
sends CopyDone message |
void |
copyFail(java.lang.String message)
sends CopyFail message |
void |
describe(byte mode,
java.lang.String name)
|
void |
execute(java.lang.String name,
int rowlimit)
execute a bound portal |
void |
flush()
sends Flush message |
void |
functionCall(java.lang.String portal,
java.lang.String statementName,
short[] paramFormats,
byte[][] parameters,
short[] resultFormats)
|
pgj.ProtocolChunk |
getChunk(long timeoutMillis)
get the first chunk off the queue. |
static int |
intFromByteArray(byte[] a,
int p)
|
static void |
intToByteArray(byte[] a,
int pos,
int i)
|
static void |
main(java.lang.String[] args)
|
void |
openConnection(java.lang.String server,
int port,
java.lang.String[] params)
|
void |
parse(java.lang.String statementName,
java.lang.String query,
int[] paramTypes)
|
void |
passwordMessage(java.lang.String message)
sends PasswordMessage message |
void |
query(java.lang.String message)
simple Query |
void |
run()
|
void |
sendString(java.lang.String message,
byte op)
send a string for various simple operations |
static short |
shortFromByteArray(byte[] a,
int p)
|
static void |
shortToByteArray(byte[] a,
int pos,
int i)
|
void |
sslRequest()
send SSLRequest message |
void |
sync()
send sync message |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final byte describeStatement
public static final byte describePortal
Constructor Detail |
public pgj()
Method Detail |
public void openConnection(java.lang.String server, int port, java.lang.String[] params) throws java.lang.Exception
server
- something like "localhost" or "db.a.com"port
- 5432 is commonparams
- "name","value","name","value",...
java.lang.Exception
public void closeConnection() throws java.lang.Exception
java.lang.Exception
public void parse(java.lang.String statementName, java.lang.String query, int[] paramTypes) throws java.lang.Exception
statementName
- null for unnamed statement, otherwise a name for preparing a statementquery
- sql query textparamTypes
- oid type of parameters
java.lang.Exception
public void bind(java.lang.String portal, java.lang.String statementName, short[] paramFormats, byte[][] parameters, short[] resultFormats) throws java.lang.Exception
portal
- null for unnamed portal, a name otherwisestatementName
- null for unnamed portal, a name previously parse()d otherwiseparamFormats
- 0 = text, 1 = binary, {0} = all text, {1} = all binary, null = all textparameters
- data in appropriate formatresultFormats
- 0 = text, 1 = binary, {0} = all text, {1} = all binary, null = all text
java.lang.Exception
public void functionCall(java.lang.String portal, java.lang.String statementName, short[] paramFormats, byte[][] parameters, short[] resultFormats) throws java.lang.Exception
portal
- null for unnamed portal, a name otherwisestatementName
- null for unnamed portal, a name previously parse()d otherwiseparamFormats
- 0 = text, 1 = binary, {0} = all text, {1} = all binary, null = all textparameters
- data in appropriate formatresultFormats
- 0 = text, 1 = binary, {0} = all text, {1} = all binary, null = all text
java.lang.Exception
public void bindOrFunc(java.lang.String portal, java.lang.String statementName, short[] paramFormats, byte[][] parameters, short[] resultFormats, byte op) throws java.lang.Exception
portal
- null for unnamed portal, a name otherwisestatementName
- null for unnamed portal, a name previously parse()d otherwiseparamFormats
- 0 = text, 1 = binary, {0} = all text, {1} = all binary, null = all textparameters
- data in appropriate formatresultFormats
- 0 = text, 1 = binary, {0} = all text, {1} = all binary, null = all textop
- 'B' or 'F'
java.lang.Exception
public void describe(byte mode, java.lang.String name) throws java.lang.Exception
mode
- describeStatement or describePortalname
- null for unnamed statement or portal, otherwise a name parse()d or bind()ed
java.lang.Exception
public void execute(java.lang.String name, int rowlimit) throws java.lang.Exception
name
- null for unnamed portal, otherwise a name previously bind()edrowlimit
- 0 for no limit, otherwise the maximum number of rows to return
java.lang.Exception
public void close(byte mode, java.lang.String name) throws java.lang.Exception
java.lang.Exception
public void sync() throws java.lang.Exception
java.lang.Exception
public void cancelRequest(int pid, int key) throws java.lang.Exception
pid
- data received at connect timekey
- data received at connect time
java.lang.Exception
public void sslRequest() throws java.lang.Exception
java.lang.Exception
public void copyData(byte[] data) throws java.lang.Exception
data
- sent in a CopyData message to db server
java.lang.Exception
public java.io.OutputStream copyDataStart(int len) throws java.lang.Exception
len
- length of data to copy
java.lang.Exception
public void copyDone() throws java.lang.Exception
java.lang.Exception
public void copyFail(java.lang.String message) throws java.lang.Exception
message
- description of error
java.lang.Exception
public void passwordMessage(java.lang.String message) throws java.lang.Exception
message
- password
java.lang.Exception
public void query(java.lang.String message) throws java.lang.Exception
message
- sql text
java.lang.Exception
public void sendString(java.lang.String message, byte op) throws java.lang.Exception
message
- string to sendop
- f,p,Q,(future protocol expansion?)
java.lang.Exception
public void flush() throws java.lang.Exception
java.lang.Exception
public int availableChunks()
public void addChunk(pgj.ProtocolChunk it)
it
- a ProtocolChunkpublic pgj.ProtocolChunk getChunk(long timeoutMillis)
timeoutMillis
- max millis to wait()
public void run()
run
in interface java.lang.Runnable
public static void main(java.lang.String[] args)
public static void intToByteArray(byte[] a, int pos, int i)
public static void shortToByteArray(byte[] a, int pos, int i)
public static int intFromByteArray(byte[] a, int p)
public static short shortFromByteArray(byte[] a, int p)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |