Subject Re: GDS in Java file
Author ren_breeze@yahoo.com
Hi,

Today I had free time for debugging an Example GDS-API and has found
there one place which causes in me difficulty:

We have private declaration variable:

// Temporal response packet data
private int resp_object;
private long resp_blob_id;
private byte[] resp_data;

and method for recive responce from server
private boolean receiveResponse(Object[] status, isc_db_handle_impl
db) {
try {
System.out.print("op_response ");
if (readOperation(db) == op_response) {
resp_object = db.in.readInt();
resp_blob_id = db.in.readLong();
resp_data = db.in.readBuffer();
readStatusVector(status, db);
System.out.println("received");
return true;
} else {
System.out.println("not received");
error(status, isc_net_read_err);
return false;
}
} catch (IOException ex) {
error(status, isc_net_read_err);
ex.printStackTrace();
return false;
}
}

After return from this method resp_object==0 but methot returns true
and further we use resp_object value in db.Rdb_id.
Even if I connect to the existing database - I have the same result -
resp_object==0 I do not know the reason -:(.

Db.Rdb_id - is number of identification of a Database? I am right?

>
> Hi,
> Yes, I use interbase on the windows. and I modified path to a
checked
> database. (My path : "localhost:C:\\interbase\\Test.gdb")
> I use standard Interbase 6.0, but FireBird return The same result
>
> May be debugging information can help to be defined my problem?
>
>
>
> op_connect sent
> op_accept received
> op_create sent
> op_response received
> isc_create_database = 335544472
> op_detach sent
> op_response (System error message) java.net.SocketException:
> Connection reset by peer: JVM_recv in socket input stream read
> at java.net.SocketInputStream.socketRead(Native Method)
> at java.net.SocketInputStream.read(SocketInputStream.java:86)
> at java.net.SocketInputStream.read(SocketInputStream.java:102)
> at org.firebirdsql.jgds.XdrInputStream.readInt
> (XdrInputStream.java:48)
> at org.firebirdsql.jgds.GDS_Impl.nextOperation
> (GDS_Impl.java:1110)
> at org.firebirdsql.jgds.GDS_Impl.readOperation
> (GDS_Impl.java:1119)
> at org.firebirdsql.jgds.GDS_Impl.receiveResponse
> (GDS_Impl.java:1089)
> at org.firebirdsql.jgds.GDS_Impl.isc_detach_database
> (GDS_Impl.java:303)
> at org.firebirdsql.Example1.<init>(Example1.java:64)
> at org.firebirdsql.Example1.main(Example1.java:224)
> isc_detach_database = 335544726
> isc_attach_database = 335544721
> op_transaction isc_start_transaction = 335544721
> op_exec_immediate isc_dsql_exec_inmed2 = 335544726
> op_commit java.lang.NullPointerException
> at org.firebirdsql.jgds.GDS_Impl.isc_commit_transaction
> (GDS_Impl.java:393)
> at org.firebirdsql.Example1.<init>(Example1.java:92)
> at org.firebirdsql.Example1.main(Example1.java:224)
> Exception in thread "main" Process exited with exit code 1
>
>