[JDBC] Strange behaviour of trigger functions when initiated via jdbc

2001-07-11 Thread Sebastian Schuette
Hello! We are evaluating postgres 7.1 and the beta jdbc-driver and found some irritating problem: There are some trigger functions registered in the database that create records in a log table, when a record in a datatable gets changed. If we change records of the datatable via psql or via pg

[JDBC] : SQLException.getErrorCode() : Where can I find list of error code and description ?

2001-07-11 Thread Steve SAUTETNER
Hi everybody, i use the postgresql jdbc driver and i need to get error code's of the thrown SQLException's in order to treat these as fatal errors or simple warnings. Where can I find the list of error codes and description of the postgresql.Driver.SQLException ?  

[JDBC] jdbc and unix signals

2001-07-11 Thread Nikk Anderson
Title: jdbc and unix signals Hi, I am using the postgres jdbc which was compiled on Solaris as part of the postgres 7.1 installation. I have a program which runs as a deamon, and connects to postgres for data.  As it is running as a deamon, we have included some signal handling routines. 

Re: [JDBC] Strange behaviour of trigger functions when initiated via jdbc

2001-07-11 Thread Tom Lane
Sebastian Schuette <[EMAIL PROTECTED]> writes: > There are some trigger functions registered in the database that > create records in a log table, when a record in a datatable gets > changed. If we change records of the datatable via psql or via > pgaccess everything works fine. If we change recor

[JDBC] can't write a BLOB, 7.1.2

2001-07-11 Thread Dejan Vucinic
Greetings, I'm trying to create a BLOB with the 7.1.2 JDBC driver and both setBytes() and setBinaryStream() fail with this message: FastPath call returned ERROR: lo_write: invalid large obj descriptor (0) Any ideas? Thanks, --dv _

[JDBC] [PATCH] setTimestamp(int, Timestamp) fails on null timestamp

2001-07-11 Thread Dejan Vucinic
Greetings, The 7.1.2 JDBC driver has a bug in setTimestamp(int, Timestamp), it throws a NullPointerException if the Timestamp is set to null. Looking at the code, this seems to be the case for the other form of setTimestamp as well, in both jdbc1/PreparedStatement.java and jdbc2/PreparedStatement

Re: [JDBC] can't write a BLOB, 7.1.2

2001-07-11 Thread Tom Lane
"Dejan Vucinic" <[EMAIL PROTECTED]> writes: > I'm trying to create a BLOB with the 7.1.2 JDBC driver and both > setBytes() and setBinaryStream() fail with this message: > FastPath call returned ERROR: lo_write: invalid large obj descriptor (0) Probably you are not wrapping the operation into a

Re: [JDBC] can't write a BLOB, 7.1.2

2001-07-11 Thread Dejan Vucinic
>"Dejan Vucinic" <[EMAIL PROTECTED]> writes: > > I'm trying to create a BLOB with the 7.1.2 JDBC driver and both > > setBytes() and setBinaryStream() fail with this message: > > FastPath call returned ERROR: lo_write: invalid large obj descriptor >(0) >From: Tom Lane <[EMAIL PROTECTED]> >Prob

Re: [JDBC] can't write a BLOB, 7.1.2

2001-07-11 Thread Tom Lane
"Dejan Vucinic" <[EMAIL PROTECTED]> writes: >> From: Tom Lane <[EMAIL PROTECTED]> >> Probably you are not wrapping the operation into a transaction >> (BEGIN/COMMIT). Large object descriptors are only good to the end of >> the current transaction. > I believe I am, the code looks like this: >

RE: [JDBC] can't write a BLOB, 7.1.2

2001-07-11 Thread Joe Shevland
This normally should work (calling con.setAutoCommit(false);) for large objects. Are you using the latest JDBC driver or the one that came with 7.1.2? Here's a standard kind of method I use to store a BLOB, this is against 7.1 RC1 with the JDBC source that came with it: --- try { con

[JDBC] setXXX patches

2001-07-11 Thread Dave Cramer
Bruce, Here are the patches. I haven't tested them personally, but I did build a jar for the guy who asked for it. He downloaded it, and said it worked. The jdbc1 patch is completely untested. They are simple enough that they should work (The little guy on my left shoulder is saying sure, su

[JDBC] Re: setXXX patches

2001-07-11 Thread Bruce Momjian
> re: the spacing, I recall there is an app in the distibution to format the c > code. I am betting that this will work with java. We should probably run the > source through it. I tried pgindent but it doesn't understand Java and made a mess of it. I used astyle with the options: $ a

RE: [JDBC] jdbc and unix signals

2001-07-11 Thread Peter Eisentraut
Nikk Anderson writes: > You can catch OS signals in java, although there are different signals for > each OS. The following packages have signal functionality: sun.misc.Signal, > sun.misc.SignalHandler. The JDBC driver doesn't use these. -- Peter Eisentraut [EMAIL PROTECTED] http://funktu

RE: [JDBC] [PATCH] setTimestamp(int, Timestamp) fails on null timestamp

2001-07-11 Thread Dave Cramer
Dejan, This has already been done in cvs, please get the binaries from http://jdbc.fastcrypt.com Dave -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Dejan Vucinic Sent: July 11, 2001 5:43 PM To: [EMAIL PROTECTED] Subject: [JDBC] [PATCH] setTimestamp

[JDBC] Re: : SQLException.getErrorCode() : Where can I find list of error code and description ?

2001-07-11 Thread Barry Lind
Steve, Postgres doesn't yet have a notion of error code at the server level. Therefore the JDBC driver also doesn't have a notion of error codes. As far are the exceptions themselves go, all errors on the backend are fatal in the sense that they abort the current transaction and require a rol

RE: [JDBC] [PATCH] setTimestamp(int, Timestamp) fails on null timestamp

2001-07-11 Thread Dejan Vucinic
Dave, >This has already been done in cvs, please get the binaries from >http://jdbc.fastcrypt.com I just downloaded jdbc7.1-1.3.jar and I'm still seeing the same problem: java.lang.NullPointerException at org.postgresql.jdbc2.PreparedStatement.setTimestamp(PreparedStatement.java:381)

[JDBC] Re: jdbc and unix signals

2001-07-11 Thread Joseph Shraibman
Run your program using nohup. In general java programs don't get unix signals. > Nikk Anderson wrote: > > Hi, > > I am using the postgres jdbc which was compiled on Solaris as part of > the postgres 7.1 installation. > > I have a program which runs as a deamon, and connects to postgres for >

[JDBC] Re: [INTERFACES] New code for JDBC driver

2001-07-11 Thread Michael Stephenson
> I agree that it probably is. Unfortunately, as I mentioned in my previous > post,no one is going to be entering in SQL queries directly through our > interface. We're not doing it and if someone is, he's up to no good. e.g. > > "update users set name='"+name+"'" > > If there's a text box in whic

RE: [JDBC] jdbc and unix signals

2001-07-11 Thread Nikk Anderson
Title: RE: [JDBC] jdbc and unix signals Hi, Peter Eisentraut writes: >You can't catch signals in Java, because not all systems have signals. >You might be able to write native methods to do so, but consider >reconsidering your design. You can catch OS signals in java, although there are d

Re: [JDBC] jdbc and unix signals

2001-07-11 Thread Peter Eisentraut
Nikk Anderson writes: > Does the postgres driver catch the signals, thus overiding my attempts to > catch them? You can't catch signals in Java, because not all systems have signals. You might be able to write native methods to do so, but consider reconsidering your design. -- Peter Eisentraut

Re: [JDBC] : SQLException.getErrorCode() : Where can I find list oferror code and description ?

2001-07-11 Thread Peter Eisentraut
Steve SAUTETNER writes: > Where can I find the list of error codes and description of the > postgresql.Driver.SQLException ? PostgreSQL doesn't provide any error codes yet. Sorry. -- Peter Eisentraut [EMAIL PROTECTED] http://funkturm.homeip.net/~peter ---(end of

RE: [JDBC] JDBC and stored procedures

2001-07-11 Thread Dave Cramer
The getProcedures api is on the todo list, but I don't think it returns stored procs. Dave -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Tony Grant Sent: July 11, 2001 11:16 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re

Re: [JDBC] JDBC and stored procedures

2001-07-11 Thread Tony Grant
On 11 Jul 2001 10:20:29 -0400, Dave Cramer wrote: > The GetProcedures function in the driver does not work. OK. I bet it is on the todo list =:-D > You should be able to a simple select of the stored proc however Yes! thank you very much!!! SELECT getcountryname(director.country) did the tri

[JDBC] JDBC and stored procedures

2001-07-11 Thread Tony Grant
Hello, I am trying to use a stored procedure via JDBC. The objective is to be able to get data from more than one table. My procedure is a simple get country name from table countries where contry code = $1 copied from Bruces book. Ultradev is giving me "Error calling GetProcedures: An unidentif

Re: [JDBC] JDBC and stored procedures

2001-07-11 Thread Dave Cramer
Tony, The GetProcedures function in the driver does not work. You should be able to a simple select of the stored proc however Dave On July 11, 2001 09:06 am, Tony Grant wrote: > Hello, > > I am trying to use a stored procedure via JDBC. The objective is to be > able to get data from more than

Re: [JDBC] Re: [HACKERS] JDBC adaptor issue

2001-07-11 Thread Bruce Momjian
> Actually the problem is worse than I thought. Not only do all the > get/setXXXStream methods assume the datatype is a BLOB, but also the > get/setBytes methods. This means that it isn't possible to support > bytea as the binary datatype without also breaking some backward > compatability.