Re: [JDBC] JDBC SQLCodes or Error Numbers - Or how to handle errors
Is there a "better" way to test for duplicate rows than by first do a select to see if the key already exists? Henry D. Rene Pijlman wrote: > On Sun, 28 Oct 2001 00:33:07 -0700, you wrote: > >I'm used to just doing the insert and catching the SQLCODE -803 > >on DB2 to know that the row I'm trying to insert already exists. > > > >Is there an easy way to do this using Postgresql and JDBC? > > I'm afraid not. > > "SQLException.getErrorCode() always returns 0. The PostgreSQL > backend currently doesn't provide error codes. This issue is on > the TODO list (Admin: 'Allow elog() to return error codes'). > Once it is fixed in the backend and the FE/BE protocol, it can > be fixed in the JDBC driver as well." > http://lab.applinet.nl/postgresql-jdbc/#SQLException > > Regards, > René Pijlman <[EMAIL PROTECTED]> > > ---(end of broadcast)--- > TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED] ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Re: [JDBC] DatabaseMetaData.getTables()
Well I think we can restore the orignal functionality of getBytes so that it returns a byte array for other objects As long as we preserve the functionality for bytea types, and LargeObjects Dave -Original Message- From: Jason Davies [mailto:[EMAIL PROTECTED]] Sent: October 28, 2001 8:34 AM To: Dave Cramer Cc: [EMAIL PROTECTED] Subject: Re: [JDBC] DatabaseMetaData.getTables() On Sun, Oct 28, 2001 at 07:14:42AM -0500, Dave Cramer wrote: > It appears the getBytes was previously being used to return a byte > array of any arbitrary column. > > Fixes for blobs seem to have broken this. The question is as Jason > pointed out which do we fix. > > It doesn't seem unreasonable to be able to return a byte array for any > arbitray column. On the other hand is this the intended use? This is what the documentation says: public byte[] getBytes(int columnIndex) throws SQLException Retrieves the value of the designated column in the current row of this ResultSet object as a byte array in the Java programming language. The bytes represent the raw values returned by the driver. It seems to imply that it _should_ return a byte array for any arbitary column. But as usual, it's up to us to decide. I think it's reasonable, since we are working with byte arrays in the code anyway. -- Jason Davies [EMAIL PROTECTED] ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
Re: [JDBC] DatabaseMetaData.getTables()
On Sun, Oct 28, 2001 at 07:14:42AM -0500, Dave Cramer wrote: > It appears the getBytes was previously being used to return a byte array > of any arbitrary column. > > Fixes for blobs seem to have broken this. The question is as Jason > pointed out which do we fix. > > It doesn't seem unreasonable to be able to return a byte array for any > arbitray column. On the other hand is this the intended use? This is what the documentation says: public byte[] getBytes(int columnIndex) throws SQLException Retrieves the value of the designated column in the current row of this ResultSet object as a byte array in the Java programming language. The bytes represent the raw values returned by the driver. It seems to imply that it _should_ return a byte array for any arbitary column. But as usual, it's up to us to decide. I think it's reasonable, since we are working with byte arrays in the code anyway. -- Jason Davies [EMAIL PROTECTED] PGP signature
Re: [JDBC] DatabaseMetaData.getTables()
I forgot to mention I'm using the current CVS. On Sun, Oct 28, 2001 at 10:07:06AM +0100, Rene Pijlman wrote: > On Sat, 27 Oct 2001 19:25:49 -0500, you wrote: > >There seems to be a problem with DatabaseMetaData.getTables() > [...] > >It throws a NullPointerException: > > This may have been fixed by now: > http://fts.postgresql.org/db/mw/msg.html?mid=1021572 > > Regards, > René Pijlman <[EMAIL PROTECTED]> -- Jason Davies [EMAIL PROTECTED] PGP signature
Re: [JDBC] DatabaseMetaData.getTables()
It appears the getBytes was previously being used to return a byte array of any arbitrary column. Fixes for blobs seem to have broken this. The question is as Jason pointed out which do we fix. It doesn't seem unreasonable to be able to return a byte array for any arbitray column. On the other hand is this the intended use? Dave -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Jason Davies Sent: October 27, 2001 8:26 PM To: [EMAIL PROTECTED] Subject: [JDBC] DatabaseMetaData.getTables() Hi, There seems to be a problem with DatabaseMetaData.getTables() when I do the following: ResultSet R=conn.getMetaData().getTables(null, null, "%", null); It throws a NullPointerException: java.lang.NullPointerException at org.postgresql.jdbc2.DatabaseMetaData.getTables(DatabaseMetaData.java:17 32) at Test.main(Test.java:66) Looking at the source, ResultSet.getBytes() is called and it returns null, causing this exception to be thrown. However I can use ResultSet.getString() without a problem. I'm using 7.1.3 at the moment. Does ResultSet.getBytes() need to be fixed or should getTables() be modified? I'd be grateful for any insights. Or you can just tell me to use the latest cvs version of PostgreSQL :) What is the consensus on supporting older versions, will you phase out old code when 7.2 comes out? -- Jason Davies [EMAIL PROTECTED] ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
Re: [JDBC] DatabaseMetaData.getTables()
Yes, I had a look at this, and it is confirmed to be broken in the CVS tip. You can try the driver from jdbc.postgresql.org. It may be more stable. This did work recently ;( Dave -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Jason Davies Sent: October 27, 2001 8:26 PM To: [EMAIL PROTECTED] Subject: [JDBC] DatabaseMetaData.getTables() Hi, There seems to be a problem with DatabaseMetaData.getTables() when I do the following: ResultSet R=conn.getMetaData().getTables(null, null, "%", null); It throws a NullPointerException: java.lang.NullPointerException at org.postgresql.jdbc2.DatabaseMetaData.getTables(DatabaseMetaData.java:17 32) at Test.main(Test.java:66) Looking at the source, ResultSet.getBytes() is called and it returns null, causing this exception to be thrown. However I can use ResultSet.getString() without a problem. I'm using 7.1.3 at the moment. Does ResultSet.getBytes() need to be fixed or should getTables() be modified? I'd be grateful for any insights. Or you can just tell me to use the latest cvs version of PostgreSQL :) What is the consensus on supporting older versions, will you phase out old code when 7.2 comes out? -- Jason Davies [EMAIL PROTECTED] ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Re: [JDBC] JDBC SQLCodes or Error Numbers - Or how to handle errors
On Sun, 28 Oct 2001 00:33:07 -0700, you wrote: >I'm used to just doing the insert and catching the SQLCODE -803 >on DB2 to know that the row I'm trying to insert already exists. > >Is there an easy way to do this using Postgresql and JDBC? I'm afraid not. "SQLException.getErrorCode() always returns 0. The PostgreSQL backend currently doesn't provide error codes. This issue is on the TODO list (Admin: 'Allow elog() to return error codes'). Once it is fixed in the backend and the FE/BE protocol, it can be fixed in the JDBC driver as well." http://lab.applinet.nl/postgresql-jdbc/#SQLException Regards, René Pijlman <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
Re: [JDBC] DatabaseMetaData.getTables()
On Sat, 27 Oct 2001 19:25:49 -0500, you wrote: >There seems to be a problem with DatabaseMetaData.getTables() [...] >It throws a NullPointerException: This may have been fixed by now: http://fts.postgresql.org/db/mw/msg.html?mid=1021572 Regards, René Pijlman <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
[JDBC] JDBC SQLCodes or Error Numbers - Or how to handle errors
I'm new to postgresql and it's JDBC driver, although an old hand a relation databases. I'm trying to rely on past practices in developing some code using Java and postgresql. I'm trying to do a INSERT into a table with the full knowledge that I might be trying to insert a duplicate row (which won't be allowed by the Primary Key). Since 80% of the inserts will succeed (because I don't expect many duplicates) I didn't want to waste programming time or runtime by doing a select to first see if the data existed. I'm used to just doing the insert and catching the SQLCODE -803 on DB2 to know that the row I'm trying to insert already exists. Is there an easy way to do this using Postgresql and JDBC? Postgresql version is 7.1.3 JDBC driver is the one that I compiled from the 7.1.3 installation I'm using the Java SDK 1.3.1_01 -- So is my only hope trying to "match" the error text and determine what when wrong? Thanks, Henry ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
[JDBC] DatabaseMetaData.getTables()
Hi, There seems to be a problem with DatabaseMetaData.getTables() when I do the following: ResultSet R=conn.getMetaData().getTables(null, null, "%", null); It throws a NullPointerException: java.lang.NullPointerException at org.postgresql.jdbc2.DatabaseMetaData.getTables(DatabaseMetaData.java:1732) at Test.main(Test.java:66) Looking at the source, ResultSet.getBytes() is called and it returns null, causing this exception to be thrown. However I can use ResultSet.getString() without a problem. I'm using 7.1.3 at the moment. Does ResultSet.getBytes() need to be fixed or should getTables() be modified? I'd be grateful for any insights. Or you can just tell me to use the latest cvs version of PostgreSQL :) What is the consensus on supporting older versions, will you phase out old code when 7.2 comes out? -- Jason Davies [EMAIL PROTECTED] PGP signature
Re: [JDBC] Ant installation (and other) issues!
Because many developers of postgres work over dialup modems at speeds of 32k. 500KB over a 32Kb line is a problem. Especially if you aren't even planning on using jdbc, you still pay the price when doing a CVS checkout. --Barry Rene Pijlman wrote: > On Mon, 22 Oct 2001 19:22:19 -0400, Tom Lane wrote: > >>500k of binaries? You just lost the argument. That's not an acceptable >>amount of overhead to add to the Postgres distribution. >> > > Why? 500K can easily fit on a floppy, and that's technology from > the 1980's. > > Regards, > René Pijlman <[EMAIL PROTECTED]> > > ---(end of broadcast)--- > TIP 4: Don't 'kill -9' the postmaster > > ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
Re: [JDBC] JDBC executeUpdate() does not return the number of rows effected
Barry, I was using Postgresql V7.1.3 and driver version 7.1-1.2. However, last night I downloaded 7.1-1.2 again and noticed that it was a few K larger, even though it had the exact same version number. When I tested with the "new" 7.1-1.2 (93,011 bytes vs approx 88K), executeUpdate() *did* return the correct row count. Go figure!? So it appears to be fixed in the newest code base. Thanks, Rob -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Barry Lind Sent: Friday, October 26, 2001 11:27 PM To: Robert Dyas Cc: [EMAIL PROTECTED] Subject: Re: [JDBC] JDBC executeUpdate() does not return the number of rows effected Robert, What version of the driver and database are you using? I have code that gets the update count back from executeUpdate(). So I suspect this may be fixed in a more recent version. thanks, --Barry Robert Dyas wrote: > Hi all, > > I have been using the JDBC driver for a couple of months now. The only > limitation I have run into for my own uses is that calling executeUpdate() > does not return the number of rows effected by update or delete statement -- > it always returns 0. > > Is this a limitation of Postgresql (i.e. the backend does not provide this > info) or a limitation of the JDBC driver? > > If it is not a limitation of the backend, does anyone have an idea if this > bug would be as easy to fix as it appears on the surface? > > Rob > > > ---(end of broadcast)--- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED]) > > ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html
Re: [JDBC] PostgreSQL, JDBC, and Druid
On Fri, 26 Oct 2001 10:30:25 -0700, you wrote: >I use Druid to design my PG database. >I never got the jdbc driver to work. >Any idea of what's going on? It seems that the PostgreSQL JDBC driver doesn't work with various applications (Druid, StarOffice, DbVisualizer,...) because it does not yet properly implement all of the metadata methods. Fixing this would be a lofty goal for 7.3 I think. Regards, René Pijlman <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
Re: [JDBC] alternative driver jxDBCon
On Wed, 24 Oct 2001 12:58:55 +0200, you wrote: >has anyone made some experience using the jdbc driver jxDBCon for PostgreSQL? >it is an alternative to the driver released by PostgreSQL. >(http://jxdbcon.sourceforge.net) Its been mentioned a couple of times on this list, but I haven't seen any report of anyone actually trying to use it. That's a pitty, because it does look interesting. Regards, René Pijlman <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html
Re: [JDBC] Error: ClassNotFoundException
On Fri, 26 Oct 2001 21:34:37 -0600, you wrote: >I have successfully installed >PostgreSQL on my Mac G4 running Mac OS X 10.1. I have no experience with this platform, but... >"Class.forName("org.postgresql.Driver");" returns the error >"java.lang.ClassNotFoundException: org.postgresql.Driver". ... typically means that the driver's jar file is not found or cannot be read by the Java runtime. Regards, René Pijlman <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
Re: [JDBC] Ant installation (and other) issues!
On Mon, 22 Oct 2001 19:22:19 -0400, Tom Lane wrote: >500k of binaries? You just lost the argument. That's not an acceptable >amount of overhead to add to the Postgres distribution. Why? 500K can easily fit on a floppy, and that's technology from the 1980's. Regards, René Pijlman <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
Re: [JDBC] j2ee compatiable jdbc driver on jdbc.postgresql.org?
* Ned Wolpert <[EMAIL PROTECTED]> wrote: | Humm... are you saying that the class PostgresqlDataSource doesn't work? I | guess I'm not sure what doesn't work with the driver. (Course, I've been using | PoolMan as the datasource to wrap the postgresql default connection rather than | using the datasource object, so I haven't been testing this myself, yet.) I think the datasource class is required to use pgsql with Castor. If I remember correctly I think it was contributed by the main author of Castor. I haven't used it myself for ages though... cheers, Gunnar -- Gunnar Rønning - [EMAIL PROTECTED] Senior Consultant, Polygnosis AS, http://www.polygnosis.com/ ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
Re: [JDBC] DatabaseMetaData.getImported/ExportedKeys() patch
Hi all, I'm not sure, but these are the methods which allow an external application (i.e. an ERD tool) to query a database and know the relationships between the tables aren't they? If so, this is a very important feature which, once implemented properly, will allow Java tools and programs (for example the ERD tool "DbDesigner", etc) to work correctly with PostgreSQL. Given that these are the methods I'm thinking about, I hope this patch is completed properly and accepted into the JDBC driver asap, even though we are in beta. We have plenty of time to ensure things work properly before final release. :-) Regards and best wishes, Justin Clift Jason Davies wrote: > > On Fri, Oct 26, 2001 at 09:52:11AM -0700, Barry Lind wrote: > > Jason, > > > > Can you explain what this patch is attempting to fix? Given that we are > > in beta with 7.2, I want to fully understand the problem here before > > applying this patch. (Especially given that the diff is pretty large and > > not a one or two line change). > > I guess "fix" is slightly misleading. This patch implements >DatabaseMetaData.getExportedKeys() which was previously not implemented, and provides >a better implementation of DatabaseMetaData.getImportedKeys() which was previously >half-implemented. > > The methods are identical for both jdbc1 and jdbc2 so that's why the diff is quite >large. Perhaps identical code should be put into a single class and have the code >which differs in jdbc1 and jdbc2 in subclasses? > > > Also what testing have you done on this? (When you ask us to 'check > > that it works', it doesn't give me a high level of confidence that this > > is well tested). > > :-) I have tested it but only with 7.1.3 at the moment. What I meant to say is >please check in case something major has been changed in 7.2. Also if the queries I'm >using can be optimized in any way that would be great. > > At the moment a value for PK_NAME (primary key name) is not returned but the main >part is implemented. > > Sorry for the lack of info, I'll try and be more helpful next time :) > > Jason Davies > > > thanks, > > --Barry > > > > > > Jason Davies wrote: > > > > > Hi, > > > > > > Here is a diff for DatabaseMetaData.getImportedKeys() and > > > DatabaseMetaData.getExportedKeys(). Please check that it works :) > > > > > > Thanks, > > > Jason Davies > > > > > > [EMAIL PROTECTED] > > > > > > > > > > > > > > > Index: jdbc1/DatabaseMetaData.java > > > === > > > RCS file: >/projects/cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/DatabaseMetaData.java,v > > > retrieving revision 1.35 > > > diff -c -r1.35 DatabaseMetaData.java > > > *** jdbc1/DatabaseMetaData.java 2001/10/25 05:59:59 1.35 > > > --- jdbc1/DatabaseMetaData.java 2001/10/26 01:21:02 > > > *** > > > *** 2260,2345 > > > > ); > > > } > > > > > > ! private void importLoop(Vector tuples, java.sql.ResultSet keyRelation) >throws SQLException > > > ! { > > > ! String s, s2; > > > ! String origTable = null, primTable = new String(""), schema; > > > ! int i; > > > ! Vector v = new Vector(); > > > ! > > > ! s = keyRelation.getString(1); > > > ! s2 = s; > > > ! //System.out.println(s); > > > ! > > > ! for (i = 0;;i++) > > > ! { > > > ! s = s.substring(s.indexOf("\\000") + 4); > > > ! if (s.compareTo("") == 0) > > > ! { > > > ! //System.out.println(); > > > ! break; > > > ! } > > > ! s2 = s.substring(0, s.indexOf("\\000")); > > > ! switch (i) > > > ! { > > > ! case 0: > > > ! origTable = s2; > > > ! break; > > > ! case 1: > > > ! primTable = s2; > >
[JDBC] Error: ClassNotFoundException
Hello All, I'm a fairly experienced developer, however, a complete newbie when it comes to using PostgreSQL and JDBC. I have successfully installed PostgreSQL on my Mac G4 running Mac OS X 10.1. I'm able to start the DB daemon (with -i extension), I've created and populated a database (can query the database, etc.). When I installed PostgreSQL, I created a user account named "postgres" on my computer, and start the DB daemon while logged onto that account (in a console window after logging into the postgres account using 'su - postgres'). I've downloaded the pre-compliled jdbc7.1-1.1.jar JDBC driver. I put the JDBC driver file in /usr/local/pgsql/share/java. I've been trying to use JDBC to connect to a database and started with Marc Liyanage's example source file. When I try and run the executable after compilation I get an error. Specifically, the line of code in "Class.forName("org.postgresql.Driver");" returns the error "java.lang.ClassNotFoundException: org.postgresql.Driver". I'm at a bit of a loss. Do I have to register the JDBC driver? If I do, how do I do that? Could this be because the PostgreSQL daemon is running from a different account than I am running the JDBC test application from? Did I put the JDBC driver in the wrong directory? Would really appreciate the help. Thanks, Craig Lawton ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Re: [JDBC] JDBC executeUpdate() does not return the number of rows effected
Robert, What version of the driver and database are you using? I have code that gets the update count back from executeUpdate(). So I suspect this may be fixed in a more recent version. thanks, --Barry Robert Dyas wrote: > Hi all, > > I have been using the JDBC driver for a couple of months now. The only > limitation I have run into for my own uses is that calling executeUpdate() > does not return the number of rows effected by update or delete statement -- > it always returns 0. > > Is this a limitation of Postgresql (i.e. the backend does not provide this > info) or a limitation of the JDBC driver? > > If it is not a limitation of the backend, does anyone have an idea if this > bug would be as easy to fix as it appears on the surface? > > Rob > > > ---(end of broadcast)--- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED]) > > ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
[JDBC] JDBC executeUpdate() does not return the number of rows effected
Hi all, I have been using the JDBC driver for a couple of months now. The only limitation I have run into for my own uses is that calling executeUpdate() does not return the number of rows effected by update or delete statement -- it always returns 0. Is this a limitation of Postgresql (i.e. the backend does not provide this info) or a limitation of the JDBC driver? If it is not a limitation of the backend, does anyone have an idea if this bug would be as easy to fix as it appears on the surface? Rob ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
Re: [JDBC] j2ee compatiable jdbc driver on jdbc.postgresql.org?
Ned, This is a community of volunteers. So if someone wants to work on JDBC3 that is fine. We don't have the option of telling people how they should spend their time. But I agree that jdbc2 still has a bunch of stuff that could be done. Although much if what remains undone isn't required by the spec. thanks, --Barry Ned Wolpert wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > > Ok, I understand. > > So, why are people talking about support for JDBC3 where JDBC2 support isn't > even there? > > On 26-Oct-2001 Barry Lind wrote: > >>Ned, >> >>It may or may not work. That file hasn't been changed in a long time, >>so I doubt anyone is using it and therefore it may no longer work. >> >>I don't want to give people the false impression that the javax.sql set >>of extensions to JDBC2 is supported by the jdbc driver by providing a >>jdbc7.2-1.2ee.jar file when we only implement 1 interface out of the 13 >>defined in that package. >> >>thanks, >>--Barry >> >> >> >>Ned Wolpert wrote: >> >> >>>-BEGIN PGP SIGNED MESSAGE- >>>Hash: SHA1 >>> >>>Humm... are you saying that the class PostgresqlDataSource doesn't work? I >>>guess I'm not sure what doesn't work with the driver. (Course, I've been >>>using >>>PoolMan as the datasource to wrap the postgresql default connection rather >>>than >>>using the datasource object, so I haven't been testing this myself, yet.) >>> >>> >>> >>>On 26-Oct-2001 Barry Lind wrote: >>> >>> >>>>Ned, >>>> >>>>There really isn't a j2ee driver for postgres. If you build the j2ee >>>>driver it is essentially the same as the j2se driver. So I don't see >>>>any reason to confuse people by letting them think there really is a >>>>difference by having two different java2 drivers to choose from on the >>>>web site. >>>> >>>>The only difference is some code that I consider questionable, and I >>>>don't think even works. >>>> >>>>thanks, >>>>--Barry >>>> >>>> >>>> >>>>Ned Wolpert wrote: >>>> >>>> >>>> >>>>>-BEGIN PGP SIGNED MESSAGE- >>>>>Hash: SHA1 >>>>> >>>>>Folks- >>>>> >>>>> I checked out the jdbc driver for 7.2b1 on the jdbc.postgresql.org >>>>> website >>>>>(http://jdbc.postgresql.org/download/jdbc7.2b1-1.2.jar) and I was going to >>>>>submit it for testing with the castor project. One problem... it's only >>>>>the >>>>>default driver. I think the website should have the default one, and the >>>>>j2ee >>>>>(jdk1.2e+) one available. Thoughts? >>>>> >>>>> >>>>>Virtually, >>>>>Ned Wolpert <[EMAIL PROTECTED]> >>>>> >>>>>D08C2F45: 28E7 56CB 58AC C622 5A51 3C42 8B2B 2739 D08C 2F45 >>>>>-BEGIN PGP SIGNATURE- >>>>>Version: GnuPG v1.0.6 (GNU/Linux) >>>>>Comment: For info see http://www.gnupg.org >>>>> >>>>>iD8DBQE72J4xiysnOdCML0URAvl6AJ90aNX33co+5BH23/kgeK2YX/OlvwCdHbMV >>>>>voujwk16eZ04pJvH5iTCJTQ= >>>>>=36ME >>>>>-END PGP SIGNATURE- >>>>> >>>>>---(end of broadcast)--- >>>>>TIP 2: you can get off all lists at once with the unregister command >>>>> (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED]) >>>>> >>>>> >>>>> >>>>> >>> >>>Virtually, >>>Ned Wolpert <[EMAIL PROTECTED]> >>> >>>D08C2F45: 28E7 56CB 58AC C622 5A51 3C42 8B2B 2739 D08C 2F45 >>>-BEGIN PGP SIGNATURE- >>>Version: GnuPG v1.0.6 (GNU/Linux) >>>Comment: For info see http://www.gnupg.org >>> >>>iD8DBQE72YusiysnOdCML0URApmaAJ9rHvs0TGF0FdgKTq+ZE86bi7o4jgCfYJ7a >>>/QTFI0POE6TO6hQEBwidE3g= >>>=YFMc >>>-END PGP SIGNATURE- >>> >>> >>> > > > Virtually, > Ned Wolpert <[EMAIL PROTECTED]> > > D08C2F45: 28E7 56CB 58AC C622 5A51 3C42 8B2B 2739 D08C 2F45 > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.0.6 (GNU/Linux) > Comment: For info see http://www.gnupg.org > > iD8DBQE72aI7iysnOdCML0URApAJAJ0eDaIF+I81WoA+NI2kBeD2vpCmRgCfZriP > dcEU0c1UR2fZI3RTJkGddpw= > =DQ7t > -END PGP SIGNATURE- > > ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html
Re: [JDBC] j2ee compatiable jdbc driver on jdbc.postgresql.org?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 26-Oct-2001 Barry Lind wrote: > This is a community of volunteers. So if someone wants to work on JDBC3 > that is fine. We don't have the option of telling people how they > should spend their time. My bad. I didn't mean to alienate. Sorry if I came off that way. Virtually, Ned Wolpert <[EMAIL PROTECTED]> D08C2F45: 28E7 56CB 58AC C622 5A51 3C42 8B2B 2739 D08C 2F45 -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE72bgRiysnOdCML0URAs3XAJ9iH9XCAl2sCGnEH75deA6dmtwHXQCcCFDk G1hiweqEK9YGKsiMsXNQtYA= =ZU7Y -END PGP SIGNATURE- ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
Re: [JDBC] JDBC driver implementation
The jdbc driver does not support updateable result sets. If you want to update the data you need to do it the old fashioned way (i.e. use update SQL statements). thanks, --Barry Robinson wrote: > Hello, > > I have a situation where I just want the changes to be made temporarily > in the ResultSet. I don't want to commit the changes to the > database. When I use the ResultSet.updateString(...), > ResultSet.updateBoolean(...), or ResultSet.updateObject(...) methods; I > get the message "This method is not yet implemented." Looks like the > implementation for the above methods has not yet been provided in > version 7.1.2 > > I don't know if I am alone in this situation. Has anyone encountered > such a problem? And how have you gotten around solving the it. > > The problem: > - Being unable to update an updatable resultset in PostgreSQL 7.1.2 > > Thanks > > > > *Do You Yahoo!?* > Make a great connection at Yahoo! Personals > <http://rd.yahoo.com/mktg/mail/txt/tagline/?http://personals.yahoo.com>. ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
[JDBC] JDBC driver implementation
Hello, I have a situation where I just want the changes to be made temporarily in the ResultSet. I don't want to commit the changes to the database. When I use the ResultSet.updateString(...), ResultSet.updateBoolean(...), or ResultSet.updateObject(...) methods; I get the message "This method is not yet implemented." Looks like the implementation for the above methods has not yet been provided in version 7.1.2 I don't know if I am alone in this situation. Has anyone encountered such a problem? And how have you gotten around solving the it.The problem:- Being unable to update an updatable resultset in PostgreSQL 7.1.2ThanksDo You Yahoo!? Make a great connection at Yahoo! Personals.
Re: [JDBC] PostgreSQL, JDBC, and Druid
It is a problem with some of the metadata calls, I am looking into it -Original Message- From: Dado Feigenblatt [mailto:[EMAIL PROTECTED]] Sent: October 26, 2001 1:30 PM To: [EMAIL PROTECTED]; pgsql-jdbc; [EMAIL PROTECTED] Subject: PostgreSQL, JDBC, and Druid Hi Rene. Hi Dave. (No, you don't know me :) I use Druid to design my PG database. I never got the jdbc driver to work. Have you? I'm using this URL jdbc:postgresql://:/ then I get this message Trying to connect... Raised SQL Exception: Message: postgresql.stat.maxfieldsize Code : 0 State : null Any idea of what's going on? Thanks -- Dado Feigenblatt Wild Brain, Inc. Technical Director (415) 216-2053 [EMAIL PROTECTED] San Francisco, CA. Dave Cramer wrote: >Hi All, > >This is due to the current incompleteness of the jdbc driver; >specifically the metadata functionality. > >Rene; a better piece of software to test for completeness is druid, >which is a database design tool; it makes heavy use of the metadata >features > >Dave > >-Original Message- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED]] On Behalf Of Rene Pijlman >Sent: August 15, 2001 6:30 AM >To: Arnaud ESPANEL >Cc: [EMAIL PROTECTED] >Subject: Re: [JDBC] Postgresql 7.1.2 and StarOffice 5.2 > > >On Wed, 15 Aug 2001 12:16:40 +0200 (MET DST), you wrote: > >>Using Debian package for Postgres 7.1.2 and Debian >>jdbc Driver, i managed to connect to the database >>but the list of tables is empty ! >> > >I'm afraid you'll have to be more specific. What functionality in what >piece of software are you using to retrieve a list of tables? > >How is this software configured to use JDBC? > >Are there any error messages interactively, or in a log file? > >Does it work with other databases? > >Regards, >René Pijlman > >---(end of >broadcast)--- >TIP 2: you can get off all lists at once with the unregister command >(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED]) > > > >---(end of >broadcast)--- >TIP 4: Don't 'kill -9' the postmaster > ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Re: [JDBC] DatabaseMetaData.getImported/ExportedKeys() patch
On Fri, Oct 26, 2001 at 09:52:11AM -0700, Barry Lind wrote: > Jason, > > Can you explain what this patch is attempting to fix? Given that we are > in beta with 7.2, I want to fully understand the problem here before > applying this patch. (Especially given that the diff is pretty large and > not a one or two line change). I guess "fix" is slightly misleading. This patch implements DatabaseMetaData.getExportedKeys() which was previously not implemented, and provides a better implementation of DatabaseMetaData.getImportedKeys() which was previously half-implemented. The methods are identical for both jdbc1 and jdbc2 so that's why the diff is quite large. Perhaps identical code should be put into a single class and have the code which differs in jdbc1 and jdbc2 in subclasses? > Also what testing have you done on this? (When you ask us to 'check > that it works', it doesn't give me a high level of confidence that this > is well tested). :-) I have tested it but only with 7.1.3 at the moment. What I meant to say is please :check in case something major has been changed in 7.2. Also if the queries I'm using :can be optimized in any way that would be great. At the moment a value for PK_NAME (primary key name) is not returned but the main part is implemented. Sorry for the lack of info, I'll try and be more helpful next time :) Jason Davies > thanks, > --Barry > > > Jason Davies wrote: > > > Hi, > > > > Here is a diff for DatabaseMetaData.getImportedKeys() and > > DatabaseMetaData.getExportedKeys(). Please check that it works :) > > > > Thanks, > > Jason Davies > > > > [EMAIL PROTECTED] > > > > > > > > > > Index: jdbc1/DatabaseMetaData.java > > === > > RCS file: >/projects/cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/DatabaseMetaData.java,v > > retrieving revision 1.35 > > diff -c -r1.35 DatabaseMetaData.java > > *** jdbc1/DatabaseMetaData.java 2001/10/25 05:59:59 1.35 > > --- jdbc1/DatabaseMetaData.java 2001/10/26 01:21:02 > > *** > > *** 2260,2345 > > > ); > > } > > > > ! private void importLoop(Vector tuples, java.sql.ResultSet keyRelation) throws >SQLException > > ! { > > ! String s, s2; > > ! String origTable = null, primTable = new String(""), schema; > > ! int i; > > ! Vector v = new Vector(); > > ! > > ! s = keyRelation.getString(1); > > ! s2 = s; > > ! //System.out.println(s); > > ! > > ! for (i = 0;;i++) > > ! { > > ! s = s.substring(s.indexOf("\\000") + 4); > > ! if (s.compareTo("") == 0) > > ! { > > ! //System.out.println(); > > ! break; > > ! } > > ! s2 = s.substring(0, s.indexOf("\\000")); > > ! switch (i) > > ! { > > ! case 0: > > ! origTable = s2; > > ! break; > > ! case 1: > > ! primTable = s2; > > ! break; > > ! case 2: > > ! schema = s2; > > ! break; > > ! default: > > ! v.addElement(s2); > > ! } > > ! } > > ! > > ! java.sql.ResultSet rstmp = connection.ExecSQL("select * from " + >origTable + " where 1=0"); > > ! java.sql.ResultSetMetaData origCols = rstmp.getMetaData(); > > ! > > ! String stmp; > > ! // Vector tuples=new Vector(); > > ! byte tuple[][]; > > ! > > ! // the foreign keys are only on even positions in the Vector. > > ! for (i = 0;i < v.size();i += 2) > > { > > ! stmp = (String)v.elementAt(i); > > ! > > ! for (int j = 1;j <= origCols.getColumnCount();j++) > > { > > ! if (stmp.compareTo(origCols.getColumnName(j)) == 0) > >
Re: [JDBC] j2ee compatiable jdbc driver on jdbc.postgresql.org?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ok, I understand. So, why are people talking about support for JDBC3 where JDBC2 support isn't even there? On 26-Oct-2001 Barry Lind wrote: > Ned, > > It may or may not work. That file hasn't been changed in a long time, > so I doubt anyone is using it and therefore it may no longer work. > > I don't want to give people the false impression that the javax.sql set > of extensions to JDBC2 is supported by the jdbc driver by providing a > jdbc7.2-1.2ee.jar file when we only implement 1 interface out of the 13 > defined in that package. > > thanks, > --Barry > > > > Ned Wolpert wrote: > >> -BEGIN PGP SIGNED MESSAGE- >> Hash: SHA1 >> >> Humm... are you saying that the class PostgresqlDataSource doesn't work? I >> guess I'm not sure what doesn't work with the driver. (Course, I've been >> using >> PoolMan as the datasource to wrap the postgresql default connection rather >> than >> using the datasource object, so I haven't been testing this myself, yet.) >> >> >> >> On 26-Oct-2001 Barry Lind wrote: >> >>>Ned, >>> >>>There really isn't a j2ee driver for postgres. If you build the j2ee >>>driver it is essentially the same as the j2se driver. So I don't see >>>any reason to confuse people by letting them think there really is a >>>difference by having two different java2 drivers to choose from on the >>>web site. >>> >>>The only difference is some code that I consider questionable, and I >>>don't think even works. >>> >>>thanks, >>>--Barry >>> >>> >>> >>>Ned Wolpert wrote: >>> >>> >>>>-BEGIN PGP SIGNED MESSAGE- >>>>Hash: SHA1 >>>> >>>>Folks- >>>> >>>> I checked out the jdbc driver for 7.2b1 on the jdbc.postgresql.org >>>> website >>>>(http://jdbc.postgresql.org/download/jdbc7.2b1-1.2.jar) and I was going to >>>>submit it for testing with the castor project. One problem... it's only >>>>the >>>>default driver. I think the website should have the default one, and the >>>>j2ee >>>>(jdk1.2e+) one available. Thoughts? >>>> >>>> >>>>Virtually, >>>>Ned Wolpert <[EMAIL PROTECTED]> >>>> >>>>D08C2F45: 28E7 56CB 58AC C622 5A51 3C42 8B2B 2739 D08C 2F45 >>>>-BEGIN PGP SIGNATURE- >>>>Version: GnuPG v1.0.6 (GNU/Linux) >>>>Comment: For info see http://www.gnupg.org >>>> >>>>iD8DBQE72J4xiysnOdCML0URAvl6AJ90aNX33co+5BH23/kgeK2YX/OlvwCdHbMV >>>>voujwk16eZ04pJvH5iTCJTQ= >>>>=36ME >>>>-END PGP SIGNATURE- >>>> >>>>---(end of broadcast)--- >>>>TIP 2: you can get off all lists at once with the unregister command >>>>(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED]) >>>> >>>> >>>> >> >> >> Virtually, >> Ned Wolpert <[EMAIL PROTECTED]> >> >> D08C2F45: 28E7 56CB 58AC C622 5A51 3C42 8B2B 2739 D08C 2F45 >> -BEGIN PGP SIGNATURE- >> Version: GnuPG v1.0.6 (GNU/Linux) >> Comment: For info see http://www.gnupg.org >> >> iD8DBQE72YusiysnOdCML0URApmaAJ9rHvs0TGF0FdgKTq+ZE86bi7o4jgCfYJ7a >> /QTFI0POE6TO6hQEBwidE3g= >> =YFMc >> -END PGP SIGNATURE- >> >> Virtually, Ned Wolpert <[EMAIL PROTECTED]> D08C2F45: 28E7 56CB 58AC C622 5A51 3C42 8B2B 2739 D08C 2F45 -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE72aI7iysnOdCML0URApAJAJ0eDaIF+I81WoA+NI2kBeD2vpCmRgCfZriP dcEU0c1UR2fZI3RTJkGddpw= =DQ7t -END PGP SIGNATURE- ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Re: [JDBC] j2ee compatiable jdbc driver on jdbc.postgresql.org?
Ned, It may or may not work. That file hasn't been changed in a long time, so I doubt anyone is using it and therefore it may no longer work. I don't want to give people the false impression that the javax.sql set of extensions to JDBC2 is supported by the jdbc driver by providing a jdbc7.2-1.2ee.jar file when we only implement 1 interface out of the 13 defined in that package. thanks, --Barry Ned Wolpert wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Humm... are you saying that the class PostgresqlDataSource doesn't work? I > guess I'm not sure what doesn't work with the driver. (Course, I've been using > PoolMan as the datasource to wrap the postgresql default connection rather than > using the datasource object, so I haven't been testing this myself, yet.) > > > > On 26-Oct-2001 Barry Lind wrote: > >>Ned, >> >>There really isn't a j2ee driver for postgres. If you build the j2ee >>driver it is essentially the same as the j2se driver. So I don't see >>any reason to confuse people by letting them think there really is a >>difference by having two different java2 drivers to choose from on the >>web site. >> >>The only difference is some code that I consider questionable, and I >>don't think even works. >> >>thanks, >>--Barry >> >> >> >>Ned Wolpert wrote: >> >> >>>-BEGIN PGP SIGNED MESSAGE- >>>Hash: SHA1 >>> >>>Folks- >>> >>> I checked out the jdbc driver for 7.2b1 on the jdbc.postgresql.org website >>>(http://jdbc.postgresql.org/download/jdbc7.2b1-1.2.jar) and I was going to >>>submit it for testing with the castor project. One problem... it's only the >>>default driver. I think the website should have the default one, and the >>>j2ee >>>(jdk1.2e+) one available. Thoughts? >>> >>> >>>Virtually, >>>Ned Wolpert <[EMAIL PROTECTED]> >>> >>>D08C2F45: 28E7 56CB 58AC C622 5A51 3C42 8B2B 2739 D08C 2F45 >>>-BEGIN PGP SIGNATURE- >>>Version: GnuPG v1.0.6 (GNU/Linux) >>>Comment: For info see http://www.gnupg.org >>> >>>iD8DBQE72J4xiysnOdCML0URAvl6AJ90aNX33co+5BH23/kgeK2YX/OlvwCdHbMV >>>voujwk16eZ04pJvH5iTCJTQ= >>>=36ME >>>-END PGP SIGNATURE- >>> >>>---(end of broadcast)--- >>>TIP 2: you can get off all lists at once with the unregister command >>>(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED]) >>> >>> >>> > > > Virtually, > Ned Wolpert <[EMAIL PROTECTED]> > > D08C2F45: 28E7 56CB 58AC C622 5A51 3C42 8B2B 2739 D08C 2F45 > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.0.6 (GNU/Linux) > Comment: For info see http://www.gnupg.org > > iD8DBQE72YusiysnOdCML0URApmaAJ9rHvs0TGF0FdgKTq+ZE86bi7o4jgCfYJ7a > /QTFI0POE6TO6hQEBwidE3g= > =YFMc > -END PGP SIGNATURE- > > ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Re: [JDBC] DatabaseMetaData.getImported/ExportedKeys() patch
Jason, Can you explain what this patch is attempting to fix? Given that we are in beta with 7.2, I want to fully understand the problem here before applying this patch. (Especially given that the diff is pretty large and not a one or two line change). Also what testing have you done on this? (When you ask us to 'check that it works', it doesn't give me a high level of confidence that this is well tested). thanks, --Barry Jason Davies wrote: > Hi, > > Here is a diff for DatabaseMetaData.getImportedKeys() and > DatabaseMetaData.getExportedKeys(). Please check that it works :) > > Thanks, > Jason Davies > > [EMAIL PROTECTED] > > > > > Index: jdbc1/DatabaseMetaData.java > === > RCS file: >/projects/cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/DatabaseMetaData.java,v > retrieving revision 1.35 > diff -c -r1.35 DatabaseMetaData.java > *** jdbc1/DatabaseMetaData.java 2001/10/25 05:59:59 1.35 > --- jdbc1/DatabaseMetaData.java 2001/10/26 01:21:02 > *** > *** 2260,2345 > > ); > } > > ! private void importLoop(Vector tuples, java.sql.ResultSet keyRelation) throws >SQLException > ! { > ! String s, s2; > ! String origTable = null, primTable = new String(""), schema; > ! int i; > ! Vector v = new Vector(); > ! > ! s = keyRelation.getString(1); > ! s2 = s; > ! //System.out.println(s); > ! > ! for (i = 0;;i++) > ! { > ! s = s.substring(s.indexOf("\\000") + 4); > ! if (s.compareTo("") == 0) > ! { > ! //System.out.println(); > ! break; > ! } > ! s2 = s.substring(0, s.indexOf("\\000")); > ! switch (i) > ! { > ! case 0: > ! origTable = s2; > ! break; > ! case 1: > ! primTable = s2; > ! break; > ! case 2: > ! schema = s2; > ! break; > ! default: > ! v.addElement(s2); > ! } > ! } > ! > ! java.sql.ResultSet rstmp = connection.ExecSQL("select * from " + >origTable + " where 1=0"); > ! java.sql.ResultSetMetaData origCols = rstmp.getMetaData(); > ! > ! String stmp; > ! // Vector tuples=new Vector(); > ! byte tuple[][]; > ! > ! // the foreign keys are only on even positions in the Vector. > ! for (i = 0;i < v.size();i += 2) > { > ! stmp = (String)v.elementAt(i); > ! > ! for (int j = 1;j <= origCols.getColumnCount();j++) > { > ! if (stmp.compareTo(origCols.getColumnName(j)) == 0) > { > ! tuple = new byte[14][0]; > ! > ! for (int k = 0;k < 14;k++) > ! tuple[k] = null; > ! > ! //PKTABLE_NAME > ! tuple[2] = primTable.getBytes(); > ! //PKTABLE_COLUMN > ! stmp = (String)v.elementAt(i + 1); > ! tuple[3] = stmp.getBytes(); > ! //FKTABLE_NAME > ! tuple[6] = origTable.getBytes(); > ! //FKCOLUMN_NAME > ! tuple[7] = >origCols.getColumnName(j).getBytes(); > ! //KEY_SEQ > ! tuple[8] = Integer.toString(j).getBytes(); > ! > ! tuples.addElement(tuple); > ! > ! //System.out.println(origCols.getColumnName(j)+ > ! //": "+j+" -> "+primTable+": "+ > !
[JDBC] PostgreSQL, JDBC, and Druid
Hi Rene. Hi Dave. (No, you don't know me :) I use Druid to design my PG database. I never got the jdbc driver to work. Have you? I'm using this URL jdbc:postgresql://:/ then I get this message Trying to connect... Raised SQL Exception: Message: postgresql.stat.maxfieldsize Code : 0 State : null Any idea of what's going on? Thanks -- Dado Feigenblatt Wild Brain, Inc. Technical Director (415) 216-2053 [EMAIL PROTECTED] San Francisco, CA. Dave Cramer wrote: >Hi All, > >This is due to the current incompleteness of the jdbc driver; >specifically the metadata functionality. > >Rene; a better piece of software to test for completeness is druid, >which is a database design tool; it makes heavy use of the metadata >features > >Dave > >-Original Message- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED]] On Behalf Of Rene Pijlman >Sent: August 15, 2001 6:30 AM >To: Arnaud ESPANEL >Cc: [EMAIL PROTECTED] >Subject: Re: [JDBC] Postgresql 7.1.2 and StarOffice 5.2 > > >On Wed, 15 Aug 2001 12:16:40 +0200 (MET DST), you wrote: > >>Using Debian package for Postgres 7.1.2 and Debian >>jdbc Driver, i managed to connect to the database >>but the list of tables is empty ! >> > >I'm afraid you'll have to be more specific. What functionality in what >piece of software are you using to retrieve a list of tables? > >How is this software configured to use JDBC? > >Are there any error messages interactively, or in a log file? > >Does it work with other databases? > >Regards, >René Pijlman > >---(end of broadcast)--- >TIP 2: you can get off all lists at once with the unregister command >(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED]) > > > >---(end of broadcast)--- >TIP 4: Don't 'kill -9' the postmaster > ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Re: [JDBC] j2ee compatiable jdbc driver on jdbc.postgresql.org?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Humm... are you saying that the class PostgresqlDataSource doesn't work? I guess I'm not sure what doesn't work with the driver. (Course, I've been using PoolMan as the datasource to wrap the postgresql default connection rather than using the datasource object, so I haven't been testing this myself, yet.) On 26-Oct-2001 Barry Lind wrote: > Ned, > > There really isn't a j2ee driver for postgres. If you build the j2ee > driver it is essentially the same as the j2se driver. So I don't see > any reason to confuse people by letting them think there really is a > difference by having two different java2 drivers to choose from on the > web site. > > The only difference is some code that I consider questionable, and I > don't think even works. > > thanks, > --Barry > > > > Ned Wolpert wrote: > >> -BEGIN PGP SIGNED MESSAGE- >> Hash: SHA1 >> >> Folks- >> >> I checked out the jdbc driver for 7.2b1 on the jdbc.postgresql.org website >> (http://jdbc.postgresql.org/download/jdbc7.2b1-1.2.jar) and I was going to >> submit it for testing with the castor project. One problem... it's only the >> default driver. I think the website should have the default one, and the >> j2ee >> (jdk1.2e+) one available. Thoughts? >> >> >> Virtually, >> Ned Wolpert <[EMAIL PROTECTED]> >> >> D08C2F45: 28E7 56CB 58AC C622 5A51 3C42 8B2B 2739 D08C 2F45 >> -BEGIN PGP SIGNATURE- >> Version: GnuPG v1.0.6 (GNU/Linux) >> Comment: For info see http://www.gnupg.org >> >> iD8DBQE72J4xiysnOdCML0URAvl6AJ90aNX33co+5BH23/kgeK2YX/OlvwCdHbMV >> voujwk16eZ04pJvH5iTCJTQ= >> =36ME >> -END PGP SIGNATURE- >> >> ---(end of broadcast)--- >> TIP 2: you can get off all lists at once with the unregister command >> (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED]) >> >> Virtually, Ned Wolpert <[EMAIL PROTECTED]> D08C2F45: 28E7 56CB 58AC C622 5A51 3C42 8B2B 2739 D08C 2F45 -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE72YusiysnOdCML0URApmaAJ9rHvs0TGF0FdgKTq+ZE86bi7o4jgCfYJ7a /QTFI0POE6TO6hQEBwidE3g= =YFMc -END PGP SIGNATURE- ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
[JDBC] versions/changelogs
I'm about to upgrade to the new release of SuSE, which will take me from 7.0 to 7.1 of Postgres. Which is the best JDBC driver to use, and where is the best place to look for a list of what changed between 7.0 and 7.1? -- Glenn Holmer [EMAIL PROTECTED] Programmer/Analyst phone: 414.908.1809 Weyco Group, Inc. fax: 414.908.1601 ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
[JDBC] DatabaseMetaData.getImported/ExportedKeys() patch
Hi, Here is a diff for DatabaseMetaData.getImportedKeys() and DatabaseMetaData.getExportedKeys(). Please check that it works :) Thanks, Jason Davies [EMAIL PROTECTED] Index: jdbc1/DatabaseMetaData.java === RCS file: /projects/cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/DatabaseMetaData.java,v retrieving revision 1.35 diff -c -r1.35 DatabaseMetaData.java *** jdbc1/DatabaseMetaData.java 2001/10/25 05:59:59 1.35 --- jdbc1/DatabaseMetaData.java 2001/10/26 01:21:02 *** *** 2260,2345 ); } ! private void importLoop(Vector tuples, java.sql.ResultSet keyRelation) throws SQLException ! { ! String s, s2; ! String origTable = null, primTable = new String(""), schema; ! int i; ! Vector v = new Vector(); ! ! s = keyRelation.getString(1); ! s2 = s; ! //System.out.println(s); ! ! for (i = 0;;i++) ! { ! s = s.substring(s.indexOf("\\000") + 4); ! if (s.compareTo("") == 0) ! { ! //System.out.println(); ! break; ! } ! s2 = s.substring(0, s.indexOf("\\000")); ! switch (i) ! { ! case 0: ! origTable = s2; ! break; ! case 1: ! primTable = s2; ! break; ! case 2: ! schema = s2; ! break; ! default: ! v.addElement(s2); ! } ! } ! ! java.sql.ResultSet rstmp = connection.ExecSQL("select * from " + origTable + " where 1=0"); ! java.sql.ResultSetMetaData origCols = rstmp.getMetaData(); ! ! String stmp; ! // Vector tuples=new Vector(); ! byte tuple[][]; ! ! // the foreign keys are only on even positions in the Vector. ! for (i = 0;i < v.size();i += 2) { ! stmp = (String)v.elementAt(i); ! ! for (int j = 1;j <= origCols.getColumnCount();j++) { ! if (stmp.compareTo(origCols.getColumnName(j)) == 0) { ! tuple = new byte[14][0]; ! ! for (int k = 0;k < 14;k++) ! tuple[k] = null; ! ! //PKTABLE_NAME ! tuple[2] = primTable.getBytes(); ! //PKTABLE_COLUMN ! stmp = (String)v.elementAt(i + 1); ! tuple[3] = stmp.getBytes(); ! //FKTABLE_NAME ! tuple[6] = origTable.getBytes(); ! //FKCOLUMN_NAME ! tuple[7] = origCols.getColumnName(j).getBytes(); ! //KEY_SEQ ! tuple[8] = Integer.toString(j).getBytes(); ! ! tuples.addElement(tuple); ! ! //System.out.println(origCols.getColumnName(j)+ ! //": "+j+" -> "+primTable+": "+ ! //(String)v.elementAt(i+1)); ! break; } } } ! //return tuples; } /** --- 2260,2330 ); } ! private byte[][] parseConstraint(java.sql.ResultSet keyRelation) throws SQLException ! { ! byte tuple[][]=new byte[14][0]; ! for (int k = 0;k < 14;k++) ! tuple[k] = null; ! String s=keyRelation.getString(1); ! int pos=s.indexOf("\\000"); ! if(pos>-1) ! { ! tuple[11]=s.substring(0,pos).getBytes();; // FK_NAME ! int pos2=s.indexOf("\\000", pos+1); ! if(pos2>-1) { ! tuple[
Re: [JDBC] j2ee compatiable jdbc driver on jdbc.postgresql.org?
Ned, There really isn't a j2ee driver for postgres. If you build the j2ee driver it is essentially the same as the j2se driver. So I don't see any reason to confuse people by letting them think there really is a difference by having two different java2 drivers to choose from on the web site. The only difference is some code that I consider questionable, and I don't think even works. thanks, --Barry Ned Wolpert wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Folks- > > I checked out the jdbc driver for 7.2b1 on the jdbc.postgresql.org website > (http://jdbc.postgresql.org/download/jdbc7.2b1-1.2.jar) and I was going to > submit it for testing with the castor project. One problem... it's only the > default driver. I think the website should have the default one, and the j2ee > (jdk1.2e+) one available. Thoughts? > > > Virtually, > Ned Wolpert <[EMAIL PROTECTED]> > > D08C2F45: 28E7 56CB 58AC C622 5A51 3C42 8B2B 2739 D08C 2F45 > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.0.6 (GNU/Linux) > Comment: For info see http://www.gnupg.org > > iD8DBQE72J4xiysnOdCML0URAvl6AJ90aNX33co+5BH23/kgeK2YX/OlvwCdHbMV > voujwk16eZ04pJvH5iTCJTQ= > =36ME > -END PGP SIGNATURE- > > ---(end of broadcast)--- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED]) > > ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
[JDBC] j2ee compatiable jdbc driver on jdbc.postgresql.org?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Folks- I checked out the jdbc driver for 7.2b1 on the jdbc.postgresql.org website (http://jdbc.postgresql.org/download/jdbc7.2b1-1.2.jar) and I was going to submit it for testing with the castor project. One problem... it's only the default driver. I think the website should have the default one, and the j2ee (jdk1.2e+) one available. Thoughts? Virtually, Ned Wolpert <[EMAIL PROTECTED]> D08C2F45: 28E7 56CB 58AC C622 5A51 3C42 8B2B 2739 D08C 2F45 -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE72J4xiysnOdCML0URAvl6AJ90aNX33co+5BH23/kgeK2YX/OlvwCdHbMV voujwk16eZ04pJvH5iTCJTQ= =36ME -END PGP SIGNATURE- ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
Re: [JDBC] "No Suitable Driver"
Guy, Send me the pertinent code where you are loading the driver Dave -Original Message- From: Guy McArthur [mailto:[EMAIL PROTECTED]] Sent: October 25, 2001 6:28 PM To: Dave Cramer Cc: [EMAIL PROTECTED] Subject: RE: [JDBC] "No Suitable Driver" Huh. Well I have set up Jive Forums 2.1.1 (jivesoftware.com) using postgres jdbc and it seems to work fine. Also in the Resin java web-app server I set up a DataSource pool of postgres connections, and that seems to work fine, fetching a connection, doing a query and all that. I haven't looked at the source to see how they are doing it. But it absolutely does not work from my command-line test app no matter which way I've tried it. ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
[JDBC] 7.2beta1 Jar files available for download from jdbc.postgresql.org
Subject pretty much says it all. I have posted the 7.2beta1 jar files up on the web site (jdbc.postgresql.org) for people to test if you don't want to built it yourselves. thanks, --Barry ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html
[JDBC] Logging in the driver
I am looking at trying to debug the driver for staroffice. Unless someone can tell me otherwise, this requires logging. Currently the driver has a rudimentary mechanism for logging DriverManager.println() This is ok, but it doesn't provide for various levels of debugging. One possibility is to use something like log4j, but given the recent distaste for adding binaries to the download I am reluctant to add a library. At this point I will probably add for my own purposes a simple logging system that can be controlled by level. A while ago someone posted a message which suggested that they had added instrumentation to the driver. If this person is still on the list, please contact me. Cheers, Dave ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html
Re: [JDBC] Code Fixes
Paul, The best way to get this patched in is to send a patch (diff -c format) of the changes diffed against current sources to this list. Someone from here will look at it and apply it to CVS. A comment for you on your fixes. Have you looked at current CVS sources to see if your problems still exist in the latest code? There have been a number of fixes that have gone into the DatabaseMetaData classes since 7.1. thanks, --Barry Paul wrote: > Hi, > > I have been working with your driver along with Forte for Java and it's not > so Transparent Persistence. > > In trying to use your driver along with PostgreSQl 7.1 I have found some > problems and fixed them in the DatabaseMetaData class. > > I am not an expert on Postgres, JDBC drivers or open source but I have been > around the coding block a few times. Anyway Transparent Persistence now > works with your driver and these fixes. So if I can assume Sun has > implemented there end correctly my fixes should be correct. > > Anyway if you are interested in this code I can send it. > > Or you can explain how I can put it into your code base or send a link with > an explanation. > > Thanks, > Paul Vickerman > Technical Architect > Higher Ground Software Inc. > > ---(end of broadcast)--- > TIP 4: Don't 'kill -9' the postmaster > > ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
Re: [JDBC] Logging in the driver
* "Dave Cramer" <[EMAIL PROTECTED]> wrote: | | This is ok, but it doesn't provide for various levels of debugging. | | One possibility is to use something like log4j, but given the recent | distaste for adding binaries to the download I am reluctant to add a | library. log4j support would have been cool, has we then would have much better mechanism for controlling logging. Have you had a look at log4j micro edition ? The API is drop in replacement for the real thing and the jar file only 25,281 bytes. The size shouldn't scare anybody, but it would be a required runtime component and that warrants some discussion... Check : http://qos.ch/ -- Gunnar Rønning - [EMAIL PROTECTED] Senior Consultant, Polygnosis AS, http://www.polygnosis.com/ ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
[JDBC] Logging in the driver
I am looking at trying to debug the driver for staroffice. Unless someone can tell me otherwise, this requires logging. Currently the driver has a rudimentary mechanism for logging DriverManager.println() This is ok, but it doesn't provide for various levels of debugging. One possibility is to use something like log4j, but given the recent distaste for adding binaries to the download I am reluctant to add a library. At this point I will probably add for my own purposes a simple logging system that can be controlled by level. A while ago someone posted a message which suggested that they had added instrumentation to the driver. If this person is still on the list, please contact me. Cheers, Dave ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
[JDBC] Proposal to remove Serialize from the JDBC driver
Hi folks I would like to propose removing the Serialize code from the driver. My reasons for doing so include: 1) It adds unnecessary complexity to the driver 2) I don't think this is the correct place for this code 3) There are much better ways to achieve persistence available. http://www.ambysoft.com/persistenceLayer.html If anyone has any objections, or comments please let them be known Dave ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
Re: [JDBC] Code Fixes
Paul, Please send a patch to this list Thanks, Dave -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Paul Sent: October 24, 2001 8:47 PM To: [EMAIL PROTECTED] Subject: [JDBC] Code Fixes Hi, I have been working with your driver along with Forte for Java and it's not so Transparent Persistence. In trying to use your driver along with PostgreSQl 7.1 I have found some problems and fixed them in the DatabaseMetaData class. I am not an expert on Postgres, JDBC drivers or open source but I have been around the coding block a few times. Anyway Transparent Persistence now works with your driver and these fixes. So if I can assume Sun has implemented there end correctly my fixes should be correct. Anyway if you are interested in this code I can send it. Or you can explain how I can put it into your code base or send a link with an explanation. Thanks, Paul Vickerman Technical Architect Higher Ground Software Inc. ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
[JDBC] Code Fixes
Hi, I have been working with your driver along with Forte for Java and it's not so Transparent Persistence. In trying to use your driver along with PostgreSQl 7.1 I have found some problems and fixed them in the DatabaseMetaData class. I am not an expert on Postgres, JDBC drivers or open source but I have been around the coding block a few times. Anyway Transparent Persistence now works with your driver and these fixes. So if I can assume Sun has implemented there end correctly my fixes should be correct. Anyway if you are interested in this code I can send it. Or you can explain how I can put it into your code base or send a link with an explanation. Thanks, Paul Vickerman Technical Architect Higher Ground Software Inc. ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
Re: [JDBC] [PATCHES] DatabaseMetadata patch
JDBC1 patch attached. I don't have a JDBC1 environment (that I know of) so I haven't even compiled this... sorry :( I also attach a very small patch to correct my email address in the JDBC 2 patch. Apply it or not, it's not important, I just noticed it. Thanks again Cheers Mark > I have applied the jdbc2 version. It would be nice to have a jdbc1 > version too. Thanks. Index: org/postgresql/jdbc1/DatabaseMetaData.java === RCS file: /cvs/pgjdbc71/org/postgresql/jdbc1/DatabaseMetaData.java,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 DatabaseMetaData.java --- org/postgresql/jdbc1/DatabaseMetaData.java 2001/10/04 05:01:32 1.1.1.1 +++ org/postgresql/jdbc1/DatabaseMetaData.java 2001/10/25 01:04:58 @@ -1932,7 +1932,19 @@ tuple[7] = null;// Buffer length - tuple[8] = "0".getBytes(); // Decimal Digits - how to get this? +// Decimal digits = scale +// From the source (see e.g. backend/utils/adt/numeric.c, +// function numeric()) the scale and precision can be calculated +// from the typmod value. [EMAIL PROTECTED] +if (typname.equals("numeric") || typname.equals("decimal")) +{ + int attypmod = r.getInt(8); + tuple[8] = +Integer.toString((attypmod & 0x) - VARHDRSZ).getBytes(); +} +else + tuple[8] = "0".getBytes(); + tuple[9] = "10".getBytes(); // Num Prec Radix - assume decimal // tuple[10] is below Index: org/postgresql/jdbc2/DatabaseMetaData.java === RCS file: /cvs/pgjdbc71/org/postgresql/jdbc2/DatabaseMetaData.java,v retrieving revision 1.2 diff -u -r1.2 DatabaseMetaData.java --- org/postgresql/jdbc2/DatabaseMetaData.java 2001/10/23 09:44:30 1.2 +++ org/postgresql/jdbc2/DatabaseMetaData.java 2001/10/25 01:09:09 @@ -1935,7 +1935,7 @@ // Decimal digits = scale // From the source (see e.g. backend/utils/adt/numeric.c, // function numeric()) the scale and precision can be calculated -// from the typmod value. [EMAIL PROTECTED] +// from the typmod value. [EMAIL PROTECTED] if (typname.equals("numeric") || typname.equals("decimal")) { int attypmod = r.getInt(8); PGP signature
Re: [JDBC] Accents bug ?
On 24 Oct 2001 17:51:56 +0200, Denis Bucher wrote: > You exactely have the same problem as I have. > And my base is also UNICODE... > Well, are you sure ? With *all* tools, that can be psql or pgdump_all, > everything seems > right, look at an extract of a dump : > 6 6 PPN Nigiri mixtet t > 7 7 PNS Nigiri saké t t > 8 8 PNT Nigiri maguro t t > 9 9 PNM Nigiri saké maguro t t > 43 43 PSM Petit Nigiri maguro t t > 44 44 PSS Petit Nigiri saké t t Maybe you'll just have to force charset at connexion opening just like this : Connection conn = DriverManager.getConnection("jdbc:postgresql://myDataBase?charSet=iso-8859-1",uid,pw); You can force charSet to different values. There's a complete paragraph on Postgresql doc on supported charsets. Hope it would help. -- Jean-Christophe ARNU s/w developer Paratronic France Dans un premier temps, ayons l'esprit large et naviguons à la voile et à la vapeur. Si la promiscuité entre les deux communautés devient insupportable, il sera toujours temps d'organiser l'apartheid. -+- PM in: Guide du Cabaliste Usenet - Bien séparer les enfilades -+- ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Re: [JDBC] "No Suitable Driver"
You need to load the driver first and then get the connection, also the url for the connection s/b jdbc:postgresql://hostname/test&user=test&password=test" Assuming your database name is test So your code needs to execute Class.forName("org.postgresql.Driver") And then Connection db = DriverManager.getConnection("jdbc:postgresql://hostname/test"test",test" ); Dave -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Guy McArthur Sent: October 24, 2001 7:13 PM To: [EMAIL PROTECTED] Subject: [JDBC] "No Suitable Driver" Hi, I'm trying to get a small test program going. I have built PostgreSQL 7.1.3 on RedHat 6.2 with --java, installed and created databases, verified with psql. The postgresql.jar is on my classpath. My pg_hba.conf has: localall password host all 127.0.0.1 255.255.255.255 password Here is my code: import java.sql.*; public class PostgresTest { public static void main(String[] args) { try { Connection db = DriverManager.getConnection("jdbc.postgresql:test&user=test&password=tes t"); // I've also tried all the permutations of getConnection() and urls. // db, user, and password names have been changed to protect the innocent // I've also tried Class.forName("org.postgresql.Driver") and // Class.forName("org.postgresql.Driver").newInstance() instead of the arg. db.close(); } catch(Throwable t) { t.printStackTrace(System.out); } } } -- Running it with: java -Djdbc.drivers=org.postgresql.Driver PostgresTest where the db has been started by user postgres with: /usr/local/pgsql/bin/postmaster -i -D /data/pgsql >/data/pgsql/pgsql.log 2>&1 & And the error is: java.sql.SQLException: No suitable driver at java.sql.DriverManager.getConnection(DriverManager.java:537) at java.sql.DriverManager.getConnection(DriverManager.java:199) at PostgresTest.main(PostgresTest.java:6) What is wrong? -- Guy McArthur * email{[EMAIL PROTECTED]} http{guymcarthur.com} ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
[JDBC] "No Suitable Driver"
Hi, I'm trying to get a small test program going. I have built PostgreSQL 7.1.3 on RedHat 6.2 with --java, installed and created databases, verified with psql. The postgresql.jar is on my classpath. My pg_hba.conf has: localall password host all 127.0.0.1 255.255.255.255 password Here is my code: import java.sql.*; public class PostgresTest { public static void main(String[] args) { try { Connection db = DriverManager.getConnection("jdbc.postgresql:test&user=test&password=test"); // I've also tried all the permutations of getConnection() and urls. // db, user, and password names have been changed to protect the innocent // I've also tried Class.forName("org.postgresql.Driver") and // Class.forName("org.postgresql.Driver").newInstance() instead of the arg. db.close(); } catch(Throwable t) { t.printStackTrace(System.out); } } } -- Running it with: java -Djdbc.drivers=org.postgresql.Driver PostgresTest where the db has been started by user postgres with: /usr/local/pgsql/bin/postmaster -i -D /data/pgsql >/data/pgsql/pgsql.log 2>&1 & And the error is: java.sql.SQLException: No suitable driver at java.sql.DriverManager.getConnection(DriverManager.java:537) at java.sql.DriverManager.getConnection(DriverManager.java:199) at PostgresTest.main(PostgresTest.java:6) What is wrong? -- Guy McArthur * email{[EMAIL PROTECTED]} http{guymcarthur.com} ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Re: [JDBC] [PATCHES] DatabaseMetadata patch
> The patch is missing the corresponding fix for > jdbc1/DatabaseMetaData.java. Can you resubmit the patch with a fix for > both occurances of the problem? Otherwise the fix looks fine. I have applied the jdbc2 version. It would be nice to have a jdbc1 version too. Thanks. -- Bruce Momjian| http://candle.pha.pa.us [EMAIL PROTECTED] | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup.| Drexel Hill, Pennsylvania 19026 ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
Re: [JDBC] [PATCHES] DatabaseMetadata patch
The patch is missing the corresponding fix for jdbc1/DatabaseMetaData.java. Can you resubmit the patch with a fix for both occurances of the problem? Otherwise the fix looks fine. thanks, --Barry Bruce Momjian wrote: > Here is a patch for DatabaseMetaData to show precision properly. It is > from Mark Lillywhite. I am adding to the patch queue. > > > > > > Index: org/postgresql/jdbc2/DatabaseMetaData.java > === > RCS file: /cvs/pgjdbc71/org/postgresql/jdbc2/DatabaseMetaData.java,v > retrieving revision 1.1 > retrieving revision 1.2 > diff -u -r1.1 -r1.2 > --- org/postgresql/jdbc2/DatabaseMetaData.java2001/10/04 05:01:32 1.1 > +++ org/postgresql/jdbc2/DatabaseMetaData.java2001/10/23 09:44:30 1.2 > @@ -1932,7 +1932,19 @@ > > tuple[7] = null;// Buffer length > > - tuple[8] = "0".getBytes(); // Decimal Digits - how to get this? > +// Decimal digits = scale > +// From the source (see e.g. backend/utils/adt/numeric.c, > +// function numeric()) the scale and precision can be calculated > +// from the typmod value. [EMAIL PROTECTED] > +if (typname.equals("numeric") || typname.equals("decimal")) > +{ > + int attypmod = r.getInt(8); > + tuple[8] = > +Integer.toString((attypmod & 0x) - VARHDRSZ).getBytes(); > +} > +else > + tuple[8] = "0".getBytes(); > + > tuple[9] = "10".getBytes(); // Num Prec Radix - assume decimal > > // tuple[10] is below > > > > > > ---(end of broadcast)--- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to [EMAIL PROTECTED] so that your > message can get through to the mailing list cleanly > ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
Re: [JDBC] [PATCHES] DatabaseMetadata patch
Patch applied. Thanks. If you can send a jdbc1 version, that would be great. --- > Here is a patch for DatabaseMetaData to show precision properly. It is > from Mark Lillywhite. I am adding to the patch queue. > > -- > Bruce Momjian| http://candle.pha.pa.us > [EMAIL PROTECTED] | (610) 853-3000 > + If your life is a hard drive, | 830 Blythe Avenue > + Christ can be your backup.| Drexel Hill, Pennsylvania 19026 > Index: org/postgresql/jdbc2/DatabaseMetaData.java > === > RCS file: /cvs/pgjdbc71/org/postgresql/jdbc2/DatabaseMetaData.java,v > retrieving revision 1.1 > retrieving revision 1.2 > diff -u -r1.1 -r1.2 > --- org/postgresql/jdbc2/DatabaseMetaData.java2001/10/04 05:01:32 1.1 > +++ org/postgresql/jdbc2/DatabaseMetaData.java2001/10/23 09:44:30 1.2 > @@ -1932,7 +1932,19 @@ > > tuple[7] = null;// Buffer length > > - tuple[8] = "0".getBytes(); // Decimal Digits - how to get this? > +// Decimal digits = scale > +// From the source (see e.g. backend/utils/adt/numeric.c, > +// function numeric()) the scale and precision can be calculated > +// from the typmod value. [EMAIL PROTECTED] > +if (typname.equals("numeric") || typname.equals("decimal")) > +{ > + int attypmod = r.getInt(8); > + tuple[8] = > +Integer.toString((attypmod & 0x) - VARHDRSZ).getBytes(); > +} > +else > + tuple[8] = "0".getBytes(); > + > tuple[9] = "10".getBytes(); // Num Prec Radix - assume decimal > > // tuple[10] is below -- Bruce Momjian| http://candle.pha.pa.us [EMAIL PROTECTED] | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup.| Drexel Hill, Pennsylvania 19026 ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
Re: [JDBC] [PATCHES] DatabaseMetadata patch
Bruce Momjian <[EMAIL PROTECTED]> writes: > + tuple[8] = > +Integer.toString((attypmod & 0x) - VARHDRSZ).getBytes(); In the backend sources, we subtract VARHDRSZ *first* and then AND with . Not sure if this will ever yield a different result, but I'd say it should be kept consistent ... regards, tom lane ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
Re: [JDBC] Accents bug ?
At 16:15 04.10.01 -0700, you wrote: Hello ! Not reading the mailing-list very often I only answer now. I suppose I started the thread about this bug... >This is a follow-up to my post a few days ago about the JDBC driver >chopping of strings at non-ASCII characters. First a brief summary of >the problem: >[...] You exactely have the same problem as I have. And my base is also UNICODE... >I guess this is some initialization queries the driver does on >startup. Then to my query. I summarized the results in a table to >make it easier to follow. > >Inserted The JDBC driver byte bufferJDBC string >--- >abcdefgh 61 62 63 64 65 66 67 68abcdefgh >abæøå61 62 e6 f8 e5 ab >ab² 61 62 b2 ab >ß÷¥£ df f7 a5 a3 > >The byte buffer seems to be in the ISO8859-1 character set and not >UTF8 as the UNICODE database encoding expects. The error was probably >introduced during the INSERT. Well, are you sure ? With *all* tools, that can be psql or pgdump_all, everything seems right, look at an extract of a dump : 6 6 PPN Nigiri mixtet t 7 7 PNS Nigiri saké t t 8 8 PNT Nigiri maguro t t 9 9 PNM Nigiri saké maguro t t 43 43 PSM Petit Nigiri maguro t t 44 44 PSS Petit Nigiri saké t t As you can see it *works* for a dump. > I guess I should submit this as a bug >to the maintainers of the psql program. Are you sure the problem is in the INSERT ? And let's admit you're right, isn't there a way to do something in the JDBC driver ? Or is there a way to correct the database ? Denis ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
Re: [JDBC] StarOffice question
On Wed, 2001-10-24 at 12:53, Dave Cramer wrote: > It has to go into the staroffice/lib directory if you are using > staroffice6. > > I quickly tried it and it fails due to a nullpointer exception. It is on > my todo list to figure out. > > If you get it working let me know The message says "unable to load driver..." I would put StarOffice compatibility way up in the top 5... Cheers Tony -- RedHat Linux on Sony Vaio C1XD/S http://www.animaproductions.com/linux2.html Macromedia UltraDev with PostgreSQL http://www.animaproductions.com/ultra.html ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
Re: [JDBC] StarOffice question
I'm afraid you should use ODBC instead of JDBC with StarOffice. See http://odbc.postgresql.org I have just checked it out, and have been unable to find what I had found about StarOffice. Hope that helps. Antonio tony wrote: > where do I put the postgresql.jar to connect StarOffice to Postgres? > > I have it in the /usr/java/jdk1.3/lib directory on the client machine > (the one running staroffice) > > Cheers > > Tony Grant > > -- > RedHat Linux on Sony Vaio C1XD/S > http://www.animaproductions.com/linux2.html > Macromedia UltraDev with PostgreSQL > http://www.animaproductions.com/ultra.html > > ---(end of broadcast)--- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to [EMAIL PROTECTED] so that your > message can get through to the mailing list cleanly ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Re: [JDBC] StarOffice question
It has to go into the staroffice/lib directory if you are using staroffice6. I quickly tried it and it fails due to a nullpointer exception. It is on my todo list to figure out. If you get it working let me know Dave -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of tony Sent: October 24, 2001 4:58 AM To: [EMAIL PROTECTED] Subject: [JDBC] StarOffice question where do I put the postgresql.jar to connect StarOffice to Postgres? I have it in the /usr/java/jdk1.3/lib directory on the client machine (the one running staroffice) Cheers Tony Grant -- RedHat Linux on Sony Vaio C1XD/S http://www.animaproductions.com/linux2.html Macromedia UltraDev with PostgreSQL http://www.animaproductions.com/ultra.html ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html
[JDBC] alternative driver jxDBCon
dear all, has anyone made some experience using the jdbc driver jxDBCon for PostgreSQL? it is an alternative to the driver released by PostgreSQL. (http://jxdbcon.sourceforge.net) chantal ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
[JDBC] StarOffice question
where do I put the postgresql.jar to connect StarOffice to Postgres? I have it in the /usr/java/jdk1.3/lib directory on the client machine (the one running staroffice) Cheers Tony Grant -- RedHat Linux on Sony Vaio C1XD/S http://www.animaproductions.com/linux2.html Macromedia UltraDev with PostgreSQL http://www.animaproductions.com/ultra.html ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
Re: [JDBC] Compliance? Plans?
Per-Olof, Thanks for the constructive feedback. Let me try to answer your questions: > 1. How is the driver compliance tests carried out? The test harness from > sun? The sun test harness has been run. However the sun test harness is only for jdbc2 + the enterprise extensions. As far as I know there isn't a test suite for plane jdbc2. Little if any work has been done to support the enterprise extensions to jdbc2, however a quite a bit of work has gone into the vanilla jdbc2 stuff. There is a list of non-compiance issues at http://lab.applinet.nl/postgresql-jdbc > > 2. How often is compliance tests carried out? Not that frequently since we know what the existing issues are and are working to address them as contributors contribute fixes. > > 3. Is there a policy for those issues where postgres has limited backend > support for the jdbc API functions? > If the server is lacking a feature, this would get added to the general todo list for the server. And when that feature is implemented in the server, then it could be added to the jdbc client. > 4. Is there a development plan for the jdbc package, similar to that of > the server itself? > Both the server and the jdbc driver have todo lists. These are as much of a development plan as exists. Anyone who wants to contribute can sign up to do a todo item. Things get done as volunteers work on todo items. > > > lastly, while I´m at it :-) > > Is there a known problem with the implementation of > java.sql.Blob.getBinaryStream() implmentation? > > I get the size of the blob with length() and its correct > > While reading the Stream I get returncode -1 immediatly > > server is 7.1.3 jdbc built on jdk 1.3 on linux. Same error appears on > win2000 (using the same driver) I don't know of any bugs in this code. Do you have a test case you could submit for someone on the list to look at? thanks, --Barry Per-Olof Norén wrote: > Hi again all, > > > > First off, I´d like to declare that my intention is not to be a pain in > the B** :-) > > > > Working on customer´s campuses equipped with laptop and a viennaSQL (a > pure java sql client) i have had > > the need for many different drivers for different dbmses. The effort > involved getting a working jdbc driver > > for the dbms at hand has varied; from extremely easy to almost impossible. > > As I´m currently promoting postgreSQL as an Orcacle alternative, I have > been working in parallell with both > > drivers and the driver´s compliance to the api differs, which has really > been a hazzle. > > > > My questions to the people actively developing the driver is: > > > > 1. How is the driver compliance tests carried out? The test harness from > sun? > > 2. How often is compliance tests carried out? > > 3. Is there a policy for those issues where postgres has limited backend > support for the jdbc API functions? > > 4. Is there a development plan for the jdbc package, similar to that of > the server itself? > > > > lastly, while I´m at it :-) > > Is there a known problem with the implementation of > java.sql.Blob.getBinaryStream() implmentation? > > I get the size of the blob with length() and its correct > > While reading the Stream I get returncode -1 immediatly > > server is 7.1.3 jdbc built on jdk 1.3 on linux. Same error appears on > win2000 (using the same driver) > > > > Regards, > > Per-Olof Norén > > Stockholm, Sweden > ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html
Re: [JDBC] JDBC issues for JDK1.4
Mark, Any help on moving the jdbc code base forward is more than welcome. In briefly looking over your suggestions below they all seem fine to me. (Of course the devil is in the details). I would also suggest looking at http://lab.applinet.nl/postgresql-jdbc for a list of where we are lacking in jdbc2 support. thanks, --Barry Mark Lillywhite (pg-jdbc) wrote: > Hi folks > > I'd like to make the JDBC driver comple with JDK1.4. I've got the > following list of errors and potential remedies. Does anyone have any > objections if I start work on this? > > The following are the methods defined in JDK1.4 which are not currently > implemented in the JDBC driver: > > javax.transaction.RollbackException is not defined in 1.4. > -- this appears to be renamed to TransationRolledbackException > > Statement.getMoreResults(int) > -- defines the behaviour of the current ResultSet when the next one is > retrieved. Appears that we need to simply perform appropriate operations > on the result instance field of jdbc2.Statement. > > PreparedStatement.setURL(java.net.URL) > -- Presumably convert the URL to a string and set it like everything > else? > > CallableStatement.registerOutParameter(String, int) > -- There are a bunch of these actually, javac is only listing one. They > all take parameter names rather than indexes. Should be straightforward > to fix? > > Connection.setHoldability(int) > -- Not too sure about this. It defines the "holdability" of result sets > between commits. Need to investigate further (tips?) > > DataBaseMetaData.supportsSavepoints() > -- Presumably: "return false;" > > ResultSet.getURL(int) > -- Presumably, "return new URL(getParameter...));" > > PGblob.setBytes(long, byte[]) > PGclob.setString(long, String) > -- This stuff looks harder, there are setBinaryStream() etc methods. Not > sure how to go about this at this stage. Maybe an Unsupported exception? > > ClientConnection.setHoldability(int) > -- presumably, pass the call to Connection.setHoldability()? > > Feedback/comments welcome. > > Cheers > Mark > > > ---(end of broadcast)--- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to [EMAIL PROTECTED] so that your > message can get through to the mailing list cleanly > > ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
Re: [JDBC] [PATCHES] Ant configuration
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 23-Oct-2001 Peter Eisentraut wrote: > Gunnar Rønning writes: >> | * In numerous attempts I have failed to convince Ant to place the built >> | files in a tree different from the source tree. This really makes it a >> | pain to build for multiple architectures (in Java, architecture = >> | different jdk). >> >> > destdir="${build}" >> classpath="xyz.jar" >> debug="on" >> /> >> >> >> Is that what you want ? > > Yes, but ant refused to recognize the srcdir as absolute and thinks it's > relative to the build dir. (Or at least it was something stupid like > that; it's been a while.) That should work fine. I've been doing that since Ant version 1.3. Do you have a specific case that doesn't work? (You can always specify absolute paths in the properties, if you like...) >> >From the Ant manual : >> >> It is possible to use different compilers. This can be selected with >> the "build.compiler" property. > > Yeah, but how do you set the "build.compiler" property? This requires > pretty advanced knowledge. You can either set-it in the build.xml file via a property tag or during the startup of ant using the -D flag. (set the ANT_OPTS var to "-Dbuild.compiler=jikes" in your environment before running ant) Virtually, Ned Wolpert <[EMAIL PROTECTED]> D08C2F45: 28E7 56CB 58AC C622 5A51 3C42 8B2B 2739 D08C 2F45 -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE71etAiysnOdCML0URAkk6AJ9Op2uOIfbd4UokyhsJqS1/S4ZgjQCeJZd4 vmRbTwuQadIuhyez/86OpF0= =xk1y -END PGP SIGNATURE- ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html
Re: [JDBC] [PATCHES] DatabaseMetadata patch
Here is a patch for DatabaseMetaData to show precision properly. It is from Mark Lillywhite. I am adding to the patch queue. -- Bruce Momjian| http://candle.pha.pa.us [EMAIL PROTECTED] | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup.| Drexel Hill, Pennsylvania 19026 Index: org/postgresql/jdbc2/DatabaseMetaData.java === RCS file: /cvs/pgjdbc71/org/postgresql/jdbc2/DatabaseMetaData.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- org/postgresql/jdbc2/DatabaseMetaData.java 2001/10/04 05:01:32 1.1 +++ org/postgresql/jdbc2/DatabaseMetaData.java 2001/10/23 09:44:30 1.2 @@ -1932,7 +1932,19 @@ tuple[7] = null;// Buffer length - tuple[8] = "0".getBytes(); // Decimal Digits - how to get this? +// Decimal digits = scale +// From the source (see e.g. backend/utils/adt/numeric.c, +// function numeric()) the scale and precision can be calculated +// from the typmod value. [EMAIL PROTECTED] +if (typname.equals("numeric") || typname.equals("decimal")) +{ + int attypmod = r.getInt(8); + tuple[8] = +Integer.toString((attypmod & 0x) - VARHDRSZ).getBytes(); +} +else + tuple[8] = "0".getBytes(); + tuple[9] = "10".getBytes(); // Num Prec Radix - assume decimal // tuple[10] is below ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
Re: [JDBC] [PATCHES] DatabaseMetadata patch
> Attached is a unified diff to DatabaseMetadata from the jdbc2 interface. > It fixes a bug where the metadata does not include the scale/precision > of the database columns. > > We have been using this patch successfully for about 2 years, it would > be great to finally get it into the sources. > > Suggestions/comments welcome. There is no patch attached. Also, have you checkes our current CVS/snapshots to make sure this is still a problem? -- Bruce Momjian| http://candle.pha.pa.us [EMAIL PROTECTED] | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup.| Drexel Hill, Pennsylvania 19026 ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Re: FW: Re: [JDBC] [PATCHES] Ant configuration
> Gunnar R?nning writes: > > > Seriously would installing GNU Make be enough, or would you need to install > > Cygwin and other packages as well ? > > GNU make runs natively on Windows. We do allow ODBC to be built natively on MS Windows. Does that require gmake or can it use native MSWin buildfiles? I see win32.mak but that looks like a standard Makefile. If we require gmake on Win32 to build ODBC, can't we require it for jdbc? -- Bruce Momjian| http://candle.pha.pa.us [EMAIL PROTECTED] | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup.| Drexel Hill, Pennsylvania 19026 ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
Re: [JDBC] FW: Re: [PATCHES] Ant configuration
Added to TODO: o Move to using 'make' rather than 'ant'(?) At least we know it is an issue for final decision. --- -- Start of PGP signed section. > On 23-Oct-2001 Jayesh K. Parayali wrote: > > Just a thought. Why not separate postgres and postgres jdbc in that > > case? > > To be honest, this is the one thing I want to avoid if possible. Its important > that the postgres build system builds the 'official' interfaces as well, since > it keeps the two connect tightly. > > I prefer to use ant to build Java code, but to be honest, I really just want to > be able to type either of the following, in the src/interfaces/jdbc directory: > > ant jar > or > make jar > > Both should give the same results. (Its kinda silly that the current technique > has 'make' call 'ant', but anyways...) The only two issues are multiple build > tools and ease for building the jdbc driver for non-UNIX users. > > And to be more honest, I think we've spent too much time on this as is. If we > can't decide as a group, we should either a) vote on it (Least the CVS > committers should) or b) leave it for now. Either way, I'm going to stay out > of this discussion for now. > > > Virtually, > Ned Wolpert <[EMAIL PROTECTED]> > > D08C2F45: 28E7 56CB 58AC C622 5A51 3C42 8B2B 2739 D08C 2F45 -- End of PGP signed section. -- Bruce Momjian| http://candle.pha.pa.us [EMAIL PROTECTED] | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup.| Drexel Hill, Pennsylvania 19026 ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html
Re: [JDBC] FW: Re: [PATCHES] Ant configuration
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 23-Oct-2001 Shevland, Joseph (AU - Hobart) wrote: >> Does anyone know if we could include ANT into our CVS and >> redistribute it in order to build the jdbc code? Are their license >> incompatibilities between the Apache License and the PostgreSQL license >> that would prevent this? > > Should be fine to do, as long as we include the Apache license that comes > with Ant along with the distribution. Point 3 of the license states that we > should add something like: > > "This product includes software developed by the Apache Software > Foundation..." > > in the documentation too; I'm not sure if this is really necessary with Ant > as its a build tool, but couldn't hurt I guess. No, we're using the ant tool, not incorporating ant into our executable(s). We only need the license in the cvs part that includes ant. Virtually, Ned Wolpert <[EMAIL PROTECTED]> D08C2F45: 28E7 56CB 58AC C622 5A51 3C42 8B2B 2739 D08C 2F45 -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE71fntiysnOdCML0URAitbAJsFE56VzukAAjnMlHKgHHRW039lYwCdFEYc Jat/lyrxApC7uDZoIFHJrq0= =sAWr -END PGP SIGNATURE- ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
Re: FW: Re: [JDBC] [PATCHES] Ant configuration
* Peter Eisentraut <[EMAIL PROTECTED]> wrote: | | > Seriously would installing GNU Make be enough, or would you need to install | > Cygwin and other packages as well ? | | GNU make runs natively on Windows. I know and I've used GNU Make when working with Windows, but that taught me that you often need alot more than GNU Make to port a makefile to Windows. Maybe maintaining two versions would be the best, ie. Make is used when building the distribution and Ant makefiles are provided for the convenience of users that think Ant works better. Then you could probably setup some very simple Makefile without full dependency graph(if you want that you need rely on a tool like jikes to generate it for you). That basically means that you need to recompile all *.java files when you have edited one Java file. -- Gunnar Rønning - [EMAIL PROTECTED] Senior Consultant, Polygnosis AS, http://www.polygnosis.com/ ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html
[JDBC] gcj
I compiled postgres jdbc jar into jdbc.so using gcj and moved it into usr/local/gcc/lib which is in my LD_LIBRARY_PATH Then I created an application which uses jdbc and compiled it to native code using gcj now when I run the application, it's not able to find(load) the jdbc driver. Note that the application works fine 1.) If I add the jdbc jar file to my CLASSPATH 2.) Or compile the application with jdbc.so Anyone knows what's going on here? My apologies if this is not the appropriate place for this question. Thanks, Jayesh ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
Re: [JDBC] FW: Re: [PATCHES] Ant configuration
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 23-Oct-2001 Jayesh K. Parayali wrote: > Just a thought. Why not separate postgres and postgres jdbc in that > case? To be honest, this is the one thing I want to avoid if possible. Its important that the postgres build system builds the 'official' interfaces as well, since it keeps the two connect tightly. I prefer to use ant to build Java code, but to be honest, I really just want to be able to type either of the following, in the src/interfaces/jdbc directory: ant jar or make jar Both should give the same results. (Its kinda silly that the current technique has 'make' call 'ant', but anyways...) The only two issues are multiple build tools and ease for building the jdbc driver for non-UNIX users. And to be more honest, I think we've spent too much time on this as is. If we can't decide as a group, we should either a) vote on it (Least the CVS committers should) or b) leave it for now. Either way, I'm going to stay out of this discussion for now. Virtually, Ned Wolpert <[EMAIL PROTECTED]> D08C2F45: 28E7 56CB 58AC C622 5A51 3C42 8B2B 2739 D08C 2F45 -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE71bdxiysnOdCML0URAoXlAJ4w6Nd9pXuCoJAawEpxBaE/DADsRwCfS0dK tjPvtMsIWudhz641Ro12SgE= =/uGM -END PGP SIGNATURE- ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
[JDBC] DatabaseMetadata patch
Hi Attached is a unified diff to DatabaseMetadata from the jdbc2 interface. It fixes a bug where the metadata does not include the scale/precision of the database columns. We have been using this patch successfully for about 2 years, it would be great to finally get it into the sources. Suggestions/comments welcome. Cheers Mark PGP signature
Re: [JDBC] [PATCHES] Ant configuration
Ned Wolpert writes: > Actuall, it does. peter ~$ ant -version Ant version 1.3 compiled on March 22 2001 peter ~$ echo $? 0 peter ~$ ant Buildfile: build.xml does not exist! Build failed peter ~$ echo $? 0 -- Peter Eisentraut [EMAIL PROTECTED] http://funkturm.homeip.net/~peter ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Re: [JDBC] FW: Re: [PATCHES] Ant configuration
> If we can include the ANT libraries in our CVS then my > objection to ANT (requiring users to trackdown and download ANT) goes > away, and I would then suggest we continue to use ANT for the other > reasons you mention. > > Does anyone know if we could include ANT into our CVS and > redistribute > it in order to build the jdbc code? Are their license > incompatibilities > between the Apache License and the PostgreSQL license that > would prevent > this? Should be fine to do, as long as we include the Apache license that comes with Ant along with the distribution. Point 3 of the license states that we should add something like: "This product includes software developed by the Apache Software Foundation..." in the documentation too; I'm not sure if this is really necessary with Ant as its a build tool, but couldn't hurt I guess. Cheers, Joe > > thanks, > --Barry > > > Ned Wolpert wrote: > > > I meant to send this to the group... > > > > -FW: <[EMAIL PROTECTED]>- > > > > Date: Fri, 19 Oct 2001 10:45:43 -0700 (MST) > > Sender: [EMAIL PROTECTED] > > From: Ned Wolpert <[EMAIL PROTECTED]> > > To: Barry Lind <[EMAIL PROTECTED]> > > Subject: Re: [JDBC] [PATCHES] Ant configuration > > > > -BEGIN PGP SIGNED MESSAGE- > > Hash: SHA1 > > > > Two cents with of thought... :-) > > > > On 18-Oct-2001 Barry Lind wrote: > > > >>>* People with Java background probably know Ant better that > >>> 'make'. Ant seems to become 'build tool of choice' in > >>> Java world. > >>> > >>Perhaps, but I'm not convinced that either of these > arguments is true. > >>I have seen make used by more projects than ant, and a developer > >>building postgres from source, certainly needs to be > familiar with make. > >> > > > > Ant is great in a pure-java project. I have seen ant used > as the primary > > build engine in many Java projects, and it works great for > me. But, here are > > some (conflicting) thoughts. > > > > 1) To some degree, the make process of PostgreSQL should be > consistant. Ant > > and Make are two seperate building systems. Its easier to > put the JDBC driver > > into make than it is to put postgresql into ant. > > > > 2) Correct me if I'm wrong, but currently, Make is needed > to run Ant in the > > JDBC driver anyways, right? (To grab the version numbers > and set the properties > > when running ant) > > > > Yet... > > > > 3) Java is system independant, and the JDBC driver is a > client piece. I should > > be able to compile the JDBC driver outside of PostgreSQL > server if I wanted to, > > right? Example, I can't compile PostgreSQL on windozes 95. > But I could > > compile the JDBC driver via ant if Java and ant are > installed. (Or, rather, I > > should be able to) > > > > 4) Ant doesn't need to be 'installed' in other projects. > Rather, they include > > the needed ant libs in the CVS, which is allowed by the > license, and create a > > build script to call the ant process to build. (Usually a > build.sh and a > > build.bat) We could do that to also set the version numbers > rather than have > > make do it. > > > > I guess I can make an argument either way. The real way to > answer this is to > > ask if one cares if you can build the JDBC driver on > window's only platform > > without cygwin installed. > > > > -If the answer is no, that one wouldn't build the JDBC > driver without building > >the rest of postgresql, then the build process should be > tied to make, like > >the rest of postgresql, for simplisity in maintence. > > > > -However, if the JDBC driver should be able to be built > without having to > >build postgresql, (on platforms without > UNIX-compatiablity layer like cygwin) > >for client use only, then yes, use Ant to achive > platform-independance. > > > > I'm lucky enough to only work with Linux, so I don't really > care on the outcome > > of this :-) I can work with either. > > > > > > Virtually, > > Ned Wolpert <[EMAIL PROTECTED]> > > > > D08C2F45: 28E7 56CB 58AC C622 5A51 3C42 8B2B 2739 D08C 2F45 > > -BEGIN PGP SIGNATURE- > > Version: GnuPG v1.0.6 (GNU/Linux) > > Comment: For info see http://www.gnupg.org > > > > iD8DBQE70GbGiysnOdCML0URAnl5AJ9V
Re: FW: Re: [JDBC] [PATCHES] Ant configuration
Gunnar Rønning writes: > Seriously would installing GNU Make be enough, or would you need to install > Cygwin and other packages as well ? GNU make runs natively on Windows. -- Peter Eisentraut [EMAIL PROTECTED] http://funkturm.homeip.net/~peter ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
Re: [JDBC] FW: Re: [PATCHES] Ant configuration
Tom, My reasons for not wanting to depend on Ant are: Many binary distributions of Postgres are not including the JDBC code because of the added overhead of the jdbc build process (i.e. getting Ant installed). Users have complained to the mail lists in the past about the requirement for Ant (they expect make; make install to work for jdbc just like it does for the rest of the postgres). (However I realize there are equally good arguments on why depending on Ant is a good thing.) Thus I thought a good compromise was to include the Ant libraries in postgres for building, however after seeing the size of them, I agree that is clearly not an option. Your rationale with regards to "since you require java to build, what is one more dependency" is a little flawed. The java dependency is both a build time and runtime dependency. In order to use the result of the build you need java so the expectation that you will have java if you are dealing with jdbc is high (otherwise why would you bother). However the dependency on Ant is only for building. The one thing this thread has made abundantly clear for me it that we are far from agreement on what the ideal solution is (and there probably isn't an ideal solution), thus I feel we should stick with status quo for 7.2 and deal with all of this in a few months after 7.2 is production. thanks, --Barry Tom Lane wrote: > Barry Lind <[EMAIL PROTECTED]> writes: > >>If we can include the ANT libraries in our CVS then my >>objection to ANT (requiring users to trackdown and download ANT) goes >>away, and I would then suggest we continue to use ANT for the other >>reasons you mention. >> > > The sheer bulk of the ANT libraries rules that out, even if there > weren't a management/synchronization issue: do you want a PG release to > be using an older ANT than what you have already installed locally? > > On the other hand, I can see no reason why we shouldn't say that you > *must* have ANT installed to build the JDBC driver. You've gotta have > Java to build JDBC, no? Seems like ANT is just one more dependency, > and hardly an unreasonable one if it's the standard for Java projects. > > What's wrong with saying "we don't build the JDBC driver if ANT isn't > installed"? > > regards, tom lane > > ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
Re: [JDBC] [PATCHES] Ant configuration
Gunnar Rønning writes: > | * In numerous attempts I have failed to convince Ant to place the built > | files in a tree different from the source tree. This really makes it a > | pain to build for multiple architectures (in Java, architecture = > | different jdk). > > destdir="${build}" > classpath="xyz.jar" > debug="on" > /> > > > Is that what you want ? Yes, but ant refused to recognize the srcdir as absolute and thinks it's relative to the build dir. (Or at least it was something stupid like that; it's been a while.) > >From the Ant manual : > > It is possible to use different compilers. This can be selected with > the "build.compiler" property. Yeah, but how do you set the "build.compiler" property? This requires pretty advanced knowledge. -- Peter Eisentraut [EMAIL PROTECTED] http://funkturm.homeip.net/~peter ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html
Re: [JDBC] [PATCHES] Ant configuration
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I'm using ant 1.4.1 Also, try using it with a valid build.xml file and see how that works when the build fails or succedes On 23-Oct-2001 Peter Eisentraut wrote: > Ned Wolpert writes: > >> Actuall, it does. > > peter ~$ ant -version > Ant version 1.3 compiled on March 22 2001 > > peter ~$ echo $? > 0 > peter ~$ ant > Buildfile: build.xml does not exist! > Build failed > peter ~$ echo $? > 0 > > -- > Peter Eisentraut [EMAIL PROTECTED] http://funkturm.homeip.net/~peter Virtually, Ned Wolpert <[EMAIL PROTECTED]> D08C2F45: 28E7 56CB 58AC C622 5A51 3C42 8B2B 2739 D08C 2F45 -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE71b0giysnOdCML0URAidXAJ9XbycCgTWv+PslM3uuLVMP9SpwUwCeJyDo IEBCQYLE8EpHmCw1DwMRfYk= =iM2v -END PGP SIGNATURE- ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
Re: [JDBC] FW: Re: [PATCHES] Ant configuration
Barry Lind writes: > If we can include the ANT libraries in our CVS then my > objection to ANT (requiring users to trackdown and download ANT) goes > away, and I would then suggest we continue to use ANT for the other > reasons you mention. My problem with Ant isn't primarily the availability or what's standard or not. My problem is simply that it doesn't work the way I want the build system to work (see recently listed issues such as exit status and multiple build dirs). If we can get these fixed then I have no problem, but otherwise Ant introduces bugs into the build system and those will be fixed, no matter what's the standard today. -- Peter Eisentraut [EMAIL PROTECTED] http://funkturm.homeip.net/~peter ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
Re: [JDBC] FW: Re: [PATCHES] Ant configuration
Just a thought. Why not separate postgres and postgres jdbc in that case? Jayesh > -Original Message- > From: Bruce Momjian [SMTP:[EMAIL PROTECTED]] > Sent: Monday, October 22, 2001 5:56 PM > To: Barry Lind > Cc: [EMAIL PROTECTED] > Subject: Re: [JDBC] FW: Re: [PATCHES] Ant configuration > > > If we can include the ANT libraries in our CVS then my > > objection to ANT (requiring users to trackdown and download ANT) > goes > > away, and I would then suggest we continue to use ANT for the other > > reasons you mention. > > > > Does anyone know if we could include ANT into our CVS and > redistribute > > it in order to build the jdbc code? Are their license > incompatibilities > > between the Apache License and the PostgreSQL license that would > prevent > > this? > > I don't think we want to go there. Too much bloat to add it. Looks > like 600k. > > -- > Bruce Momjian| http://candle.pha.pa.us > [EMAIL PROTECTED] | (610) 853-3000 > + If your life is a hard drive, | 830 Blythe Avenue > + Christ can be your backup.| Drexel Hill, Pennsylvania > 19026 > > ---(end of > broadcast)--- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to [EMAIL PROTECTED] so that your > message can get through to the mailing list cleanly ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
Re: [JDBC] Ant installation (and other) issues!
Title: RE: [JDBC] Ant installation (and other) issues! Why is this such a big issue? Shipping the Ant binary would be like shipping the make binary, which seems silly to me. However, I would far prefer to use Ant to build the JDBC driver. So, is it not possible to simply maintain a Makefile.in, and a build.xml, and then people can specify --with-java-ant or --with-java-make on the configure command line? And if you specify --with-java without specifying a build tool, then it uses make. And the build.xml should be for the current production version of Ant, unless otherwise agreed by the developers for some or other good reason. At the end of the day, there are some versions of make which just won't build Postgres, because of some or other proprietary stuff, or because they are buggy, or whatever. Same goes for Ant. If you want to use Ant, you either use the latest production release, or you're on your own. What's the big deal? I'm sure there is at least one person in each 'camp' who is willing to maintain the Makefile.in or build.xml respectively. Isn't there? MikeA -Original Message- From: Per-Olof Norén To: Gunnar Rønning; Tom Lane Cc: [EMAIL PROTECTED] Sent: 10-23-01 9:38 AM Subject: Re: [JDBC] Ant installation (and other) issues! Seems like the debate has flared again. - Original Message - From: "Tom Lane" <[EMAIL PROTECTED]> To: "Gunnar Rønning" <[EMAIL PROTECTED]> Cc: "Peter Eisentraut" <[EMAIL PROTECTED]>; "Per-Olof Norén" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, October 23, 2001 1:22 AM Subject: Re: [JDBC] Ant installation (and other) issues! > Gunnar =?iso-8859-1?q?R=F8nning?= <[EMAIL PROTECTED]> writes: > > But anyway this off topic, what need to have is a build process that works > > nicely and I think including the ant binaries(around 500k) would be the > > best solution here. > > 500k of binaries? You just lost the argument. That's not an acceptable > amount of overhead to add to the Postgres distribution. I don´t see why the size of ant will be a problem. Could you please explain to me? ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org This e-mail and any attachments are confidential and may also be privileged and/or copyright material of Intec Telecom Systems PLC (or its affiliated companies). If you are not an intended or authorised recipient of this e-mail or have received it in error, please delete it immediately and notify the sender by e-mail. In such a case, reading, reproducing, printing or further dissemination of this e-mail is strictly prohibited and may be unlawful. Intec Telecom Systems PLC. does not represent or warrant that an attachment hereto is free from computer viruses or other defects. The opinions expressed in this e-mail and any attachments may be those of the author and are not necessarily those of Intec Telecom Systems PLC. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses.
[JDBC] JDBC issues for JDK1.4
Hi folks I'd like to make the JDBC driver comple with JDK1.4. I've got the following list of errors and potential remedies. Does anyone have any objections if I start work on this? The following are the methods defined in JDK1.4 which are not currently implemented in the JDBC driver: javax.transaction.RollbackException is not defined in 1.4. -- this appears to be renamed to TransationRolledbackException Statement.getMoreResults(int) -- defines the behaviour of the current ResultSet when the next one is retrieved. Appears that we need to simply perform appropriate operations on the result instance field of jdbc2.Statement. PreparedStatement.setURL(java.net.URL) -- Presumably convert the URL to a string and set it like everything else? CallableStatement.registerOutParameter(String, int) -- There are a bunch of these actually, javac is only listing one. They all take parameter names rather than indexes. Should be straightforward to fix? Connection.setHoldability(int) -- Not too sure about this. It defines the "holdability" of result sets between commits. Need to investigate further (tips?) DataBaseMetaData.supportsSavepoints() -- Presumably: "return false;" ResultSet.getURL(int) -- Presumably, "return new URL(getParameter...));" PGblob.setBytes(long, byte[]) PGclob.setString(long, String) -- This stuff looks harder, there are setBinaryStream() etc methods. Not sure how to go about this at this stage. Maybe an Unsupported exception? ClientConnection.setHoldability(int) -- presumably, pass the call to Connection.setHoldability()? Feedback/comments welcome. Cheers Mark ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
[JDBC] Compliance? Plans?
Hi again all, First off, I´d like to declare that my intention is not to be a pain in the B** :-) Working on customer´s campuses equipped with laptop and a viennaSQL (a pure java sql client) i have had the need for many different drivers for different dbmses. The effort involved getting a working jdbc driver for the dbms at hand has varied; from extremely easy to almost impossible. As I´m currently promoting postgreSQL as an Orcacle alternative, I have been working in parallell with both drivers and the driver´s compliance to the api differs, which has really been a hazzle. My questions to the people actively developing the driver is: 1. How is the driver compliance tests carried out? The test harness from sun? 2. How often is compliance tests carried out? 3. Is there a policy for those issues where postgres has limited backend support for the jdbc API functions? 4. Is there a development plan for the jdbc package, similar to that of the server itself? lastly, while I´m at it :-) Is there a known problem with the implementation of java.sql.Blob.getBinaryStream() implmentation? I get the size of the blob with length() and its correct While reading the Stream I get returncode -1 immediatly server is 7.1.3 jdbc built on jdk 1.3 on linux. Same error appears on win2000 (using the same driver) Regards, Per-Olof Norén Stockholm, Sweden
Re: [JDBC] Ant installation (and other) issues!
Seems like the debate has flared again. - Original Message - From: "Tom Lane" <[EMAIL PROTECTED]> To: "Gunnar Rønning" <[EMAIL PROTECTED]> Cc: "Peter Eisentraut" <[EMAIL PROTECTED]>; "Per-Olof Norén" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, October 23, 2001 1:22 AM Subject: Re: [JDBC] Ant installation (and other) issues! > Gunnar =?iso-8859-1?q?R=F8nning?= <[EMAIL PROTECTED]> writes: > > But anyway this off topic, what need to have is a build process that works > > nicely and I think including the ant binaries(around 500k) would be the > > best solution here. > > 500k of binaries? You just lost the argument. That's not an acceptable > amount of overhead to add to the Postgres distribution. I don´t see why the size of ant will be a problem. Could you please explain to me? ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Re: [JDBC] Ant installation (and other) issues!
* Tom Lane <[EMAIL PROTECTED]> wrote: | | Gunnar =?iso-8859-1?q?R=F8nning?= <[EMAIL PROTECTED]> writes: | > But anyway this off topic, what need to have is a build process that works | > nicely and I think including the ant binaries(around 500k) would be the | > best solution here. | | 500k of binaries? You just lost the argument. That's not an acceptable | amount of overhead to add to the Postgres distribution. Maybe another reason to look into less monolithic approaches. Both in terms of project distribution and release cycles, I still think a decoupling the JDBC interface from the main distribution is a good idea ;-) -- Gunnar Rønning - [EMAIL PROTECTED] Senior Consultant, Polygnosis AS, http://www.polygnosis.com/ ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
Re: [JDBC] FW: Re: [PATCHES] Ant configuration
Barry Lind <[EMAIL PROTECTED]> writes: > If we can include the ANT libraries in our CVS then my > objection to ANT (requiring users to trackdown and download ANT) goes > away, and I would then suggest we continue to use ANT for the other > reasons you mention. The sheer bulk of the ANT libraries rules that out, even if there weren't a management/synchronization issue: do you want a PG release to be using an older ANT than what you have already installed locally? On the other hand, I can see no reason why we shouldn't say that you *must* have ANT installed to build the JDBC driver. You've gotta have Java to build JDBC, no? Seems like ANT is just one more dependency, and hardly an unreasonable one if it's the standard for Java projects. What's wrong with saying "we don't build the JDBC driver if ANT isn't installed"? regards, tom lane ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
Re: [JDBC] Ant installation (and other) issues!
> Gunnar =?iso-8859-1?q?R=F8nning?= <[EMAIL PROTECTED]> writes: > > But anyway this off topic, what need to have is a build process that works > > nicely and I think including the ant binaries(around 500k) would be the > > best solution here. > > 500k of binaries? You just lost the argument. That's not an acceptable > amount of overhead to add to the Postgres distribution. It is actually the libraries: #$ l /u/ant/lib/ total 650 -rw-r--r-- 1 root wheel 151 Oct 9 23:16 README -rw-r--r-- 1 root wheel 416389 Oct 9 23:16 ant.jar -rw-r--r-- 1 root wheel 196399 Oct 9 23:16 crimson.jar -rw-r--r-- 1 root wheel 33323 Oct 9 23:16 jaxp.jar -- Bruce Momjian| http://candle.pha.pa.us [EMAIL PROTECTED] | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup.| Drexel Hill, Pennsylvania 19026 ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Re: [JDBC] Does PG's JDBC support prepared statements at all?
On Sun, Oct 21, 2001 at 02:06:21PM +0200, Rene Pijlman wrote: > On Sun, 21 Oct 2001 11:37:29 +0900, you wrote: > >So I guess what is happening is that the preparedstatement parser > >ignores quoted question marks > > I hope not. I hope it sets the field to a literal '?' :-) I meant ignores them in terms of not handling them as normal variable placement holders or whatever the correct terminology is :) But I guess that wasn't crystal clear in the way that I phrased it. Tom. -- Thomas O'Dowd. - Nooping - http://nooper.com [EMAIL PROTECTED] - Testing - http://nooper.co.jp/labs ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Re: [JDBC] Ant installation (and other) issues!
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 22-Oct-2001 Bruce Momjian wrote: > A more important point is that we are not a java-only codebase. If we > were, I could see a stronger argument for Ant. As it is now, we have to > weigh using a Java-standard Ant vs. a PostgreSQL/C-standard makefile > solution. Yes, which goes back to my original question. Would someone want to build the JDBC driver without building the rest of postgresql? If this is the case, then we need to make sure that we provide the tools needed build the JDBC driver in this type of environment. If this is not the case, then it doesn't/shouldn't matter, since the build is directly linked to postgresql. Let me ask people this question: Do we support building of the JDBC driver externally to building postgresql? Or, do we 'ship' or otherwise make available the various JDBC driver in pre-build jar/binaries? Up to this point, people have basically been expected to get the latest JDBC driver from CVS and re-build it. If this is expected to continue, I recomend making the JDBC driver easy to build outside of the postgresql project. However, if the releases will start to contain all the fixes from 7.2 and beyond, then it doesn't matter to non-postgresql developers as much. (It may still matter, but its less of a big deal.) (Personally, I love Ant as a development tool. But the quality of Ant isn't the issue here, its ease of development. Multiple build-tools can create confusion. If 'from now on', we don't expect individuals to build the JDBC driver on their own, but use binaries, than simplfying the build procedure by only using make should be fine.) Virtually, Ned Wolpert <[EMAIL PROTECTED]> D08C2F45: 28E7 56CB 58AC C622 5A51 3C42 8B2B 2739 D08C 2F45 -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE71KimiysnOdCML0URAmjZAJ9n4FjIXYrdN8rCvciEOSwag8QJZACfZhwO OYeJZf/BynzKO18trG5y9yM= =sDRr -END PGP SIGNATURE- ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
[JDBC] JDBC build - take 2
Here is updated patch: * fixed couple of typos. * installdirs and uninstall targets * converted contrib/retep to make too, now no parts of PostgreSQL source _require_ Ant. * made the JUnit tests work too -- marko Index: configure.in === RCS file: /opt/cvs/pgsql/pgsql/configure.in,v retrieving revision 1.149 diff -u -r1.149 configure.in --- configure.in20 Oct 2001 17:57:38 - 1.149 +++ configure.in22 Oct 2001 21:16:18 - @@ -32,6 +32,11 @@ AC_SUBST(VERSION) AC_DEFINE_UNQUOTED(PG_VERSION, "$VERSION") +VERSION_MAJOR=`echo $VERSION | sed 's/^\([[0-9]][[0-9]]*\)\..*\$/\1/'` +VERSION_MINOR=`echo $VERSION | sed 's/^[[0-9]][[0-9]]*\.\([[0-9]][[0-9]]*\).*\$/\1/'` +AC_SUBST(VERSION_MAJOR) +AC_SUBST(VERSION_MINOR) + unset CDPATH AC_CANONICAL_HOST @@ -404,10 +409,8 @@ AC_MSG_CHECKING([whether to build Java/JDBC tools]) PGAC_ARG_BOOL(with, java, no, [ --with-java build JDBC interface and Java tools], [AC_MSG_RESULT(yes) -PGAC_PATH_ANT -if test -z "$ANT"; then - AC_MSG_ERROR([Ant is required to build Java components]) -fi], +PGAC_JAVA +], [AC_MSG_RESULT(no)]) AC_SUBST(with_java) Index: src/Makefile.global.in === RCS file: /opt/cvs/pgsql/pgsql/src/Makefile.global.in,v retrieving revision 1.140 diff -u -r1.140 Makefile.global.in --- src/Makefile.global.in 13 Oct 2001 15:24:23 - 1.140 +++ src/Makefile.global.in 19 Oct 2001 17:12:34 - @@ -30,6 +30,8 @@ # PostgreSQL version number VERSION = @VERSION@ +VERSION_MAJOR = @VERSION_MAJOR@ +VERSION_MINOR = @VERSION_MINOR@ # Support for VPATH builds abs_top_srcdir = @abs_top_srcdir@ @@ -244,6 +246,11 @@ DEF_PGPORT = @default_port@ WANTED_LANGUAGES = @WANTED_LANGUAGES@ +# Java +JAVA = @JAVA@ +JAVAC = @JAVAC@ +JAR= @JAR@ +JDBC_TYPE = @JDBC_TYPE@ ## # Index: config/java.m4 === RCS file: /opt/cvs/pgsql/pgsql/config/java.m4,v retrieving revision 1.3 diff -u -r1.3 java.m4 --- config/java.m4 4 Jul 2001 21:22:55 - 1.3 +++ config/java.m4 19 Oct 2001 17:20:39 - @@ -59,3 +59,41 @@ AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat]) _PGAC_PROG_ANT_WORKS ]) + + +AC_DEFUN([PGAC_JAVA], +[ + testf=src/interfaces/jdbc/utils/CheckVersion.java + test -f "$testf" || { echo "JDBC driver source not found..." ; exit 1 ; } + AC_PATH_PROGS(JAVA, [java]) + AC_PATH_PROGS(JAVAC, [javac jikes]) + AC_PATH_PROGS(JAR, [jar fastjar]) + AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat]) + AC_CACHE_CHECK([for type of the JDBC driver], [pgac_cv_jdbc_type], + [ +pgac_cv_jdbc_type=bad + +pgac_cmd='$JAVAC -d . $testf 1>&2' +AC_TRY_EVAL(pgac_cmd) +pgac_save_status=$? +if test ! $pgac_save_status = 0 -o ! -f ./CheckVersion.class ; then + echo "configure: failed java program was: $testf" >&AC_FD_CC + AC_MSG_ERROR([Java compilation error. Check config.log for details.]) +fi + +pgac_cmd='$JAVA CheckVersion > conftest.jdbc' +AC_TRY_EVAL(pgac_cmd) +pgac_save_status=$? +test -f conftest.jdbc && pgac_cv_jdbc_type=`cat conftest.jdbc` +test "x$pgac_cv_jdbc_type" = "x" && pgac_cv_jdbc_type=bad +if test ! $pgac_save_status = 0 -o x"$pgac_cv_jdbc_type" = xbad ; then + echo "configure: failed java program was: $testf" >&AC_FD_CC + AC_MSG_ERROR([Java running error. Check config.log for details.]) +fi + +rm CheckVersion.class conftest.jdbc + ]) + JDBC_TYPE=$pgac_cv_jdbc_type + AC_SUBST(JDBC_TYPE) +]) + Index: contrib/retep/Makefile === RCS file: /opt/cvs/pgsql/pgsql/contrib/retep/Makefile,v retrieving revision 1.1 diff -u -r1.1 Makefile --- contrib/retep/Makefile 6 Jul 2001 23:07:20 - 1.1 +++ contrib/retep/Makefile 22 Oct 2001 21:16:05 - @@ -12,19 +12,36 @@ top_builddir = ../.. include $(top_builddir)/src/Makefile.global -all: - $(ANT) -buildfile $(srcdir)/build.xml all -install: installdirs - $(ANT) -buildfile $(srcdir)/build.xml install \ - -Dinstall.directory=$(javadir) +BUILDDIR := ./build +JARDIR := ./jars +PKGBASE := uk/org/retep +JARNAME := retepTools.jar + +SRCS := $(shell find $(srcdir)/$(PKGBASE) -name '*.java') +JARFILE := $(JARDIR)/$(JARNAME) + + +all: $(JARFILE) + +$(JARFILE): $(SRCS) + mkdir -p $(BUILDDIR) $(JARDIR) + @echo "" + @echo "Compiling uk.org.retep tools..." + @$(JAVAC) -d $(BUILDDIR) $(SRCS) + @echo "" + cp $(srcdir)/$(PKGBASE)
Re: [JDBC] Ant installation (and other) issues!
Gunnar =?iso-8859-1?q?R=F8nning?= <[EMAIL PROTECTED]> writes: > But anyway this off topic, what need to have is a build process that works > nicely and I think including the ant binaries(around 500k) would be the > best solution here. 500k of binaries? You just lost the argument. That's not an acceptable amount of overhead to add to the Postgres distribution. regards, tom lane ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
Re: [JDBC] FW: Re: [PATCHES] Ant configuration
> If we can include the ANT libraries in our CVS then my > objection to ANT (requiring users to trackdown and download ANT) goes > away, and I would then suggest we continue to use ANT for the other > reasons you mention. > > Does anyone know if we could include ANT into our CVS and redistribute > it in order to build the jdbc code? Are their license incompatibilities > between the Apache License and the PostgreSQL license that would prevent > this? I don't think we want to go there. Too much bloat to add it. Looks like 600k. -- Bruce Momjian| http://candle.pha.pa.us [EMAIL PROTECTED] | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup.| Drexel Hill, Pennsylvania 19026 ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
Re: [JDBC] FW: Re: [PATCHES] Ant configuration
If we can include the ANT libraries in our CVS then my objection to ANT (requiring users to trackdown and download ANT) goes away, and I would then suggest we continue to use ANT for the other reasons you mention. Does anyone know if we could include ANT into our CVS and redistribute it in order to build the jdbc code? Are their license incompatibilities between the Apache License and the PostgreSQL license that would prevent this? thanks, --Barry Ned Wolpert wrote: > I meant to send this to the group... > > -FW: <[EMAIL PROTECTED]>- > > Date: Fri, 19 Oct 2001 10:45:43 -0700 (MST) > Sender: [EMAIL PROTECTED] > From: Ned Wolpert <[EMAIL PROTECTED]> > To: Barry Lind <[EMAIL PROTECTED]> > Subject: Re: [JDBC] [PATCHES] Ant configuration > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Two cents with of thought... :-) > > On 18-Oct-2001 Barry Lind wrote: > >>>* People with Java background probably know Ant better that >>> 'make'. Ant seems to become 'build tool of choice' in >>> Java world. >>> >>Perhaps, but I'm not convinced that either of these arguments is true. >>I have seen make used by more projects than ant, and a developer >>building postgres from source, certainly needs to be familiar with make. >> > > Ant is great in a pure-java project. I have seen ant used as the primary > build engine in many Java projects, and it works great for me. But, here are > some (conflicting) thoughts. > > 1) To some degree, the make process of PostgreSQL should be consistant. Ant > and Make are two seperate building systems. Its easier to put the JDBC driver > into make than it is to put postgresql into ant. > > 2) Correct me if I'm wrong, but currently, Make is needed to run Ant in the > JDBC driver anyways, right? (To grab the version numbers and set the properties > when running ant) > > Yet... > > 3) Java is system independant, and the JDBC driver is a client piece. I should > be able to compile the JDBC driver outside of PostgreSQL server if I wanted to, > right? Example, I can't compile PostgreSQL on windozes 95. But I could > compile the JDBC driver via ant if Java and ant are installed. (Or, rather, I > should be able to) > > 4) Ant doesn't need to be 'installed' in other projects. Rather, they include > the needed ant libs in the CVS, which is allowed by the license, and create a > build script to call the ant process to build. (Usually a build.sh and a > build.bat) We could do that to also set the version numbers rather than have > make do it. > > I guess I can make an argument either way. The real way to answer this is to > ask if one cares if you can build the JDBC driver on window's only platform > without cygwin installed. > > -If the answer is no, that one wouldn't build the JDBC driver without building >the rest of postgresql, then the build process should be tied to make, like >the rest of postgresql, for simplisity in maintence. > > -However, if the JDBC driver should be able to be built without having to >build postgresql, (on platforms without UNIX-compatiablity layer like cygwin) >for client use only, then yes, use Ant to achive platform-independance. > > I'm lucky enough to only work with Linux, so I don't really care on the outcome > of this :-) I can work with either. > > > Virtually, > Ned Wolpert <[EMAIL PROTECTED]> > > D08C2F45: 28E7 56CB 58AC C622 5A51 3C42 8B2B 2739 D08C 2F45 > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.0.6 (GNU/Linux) > Comment: For info see http://www.gnupg.org > > iD8DBQE70GbGiysnOdCML0URAnl5AJ9VkJs0QXr1GEzzFVxW5CzNLDRl1wCfbOmM > O2tENKYPCsDAx6I42NoYh5U= > =CSwI > -END PGP SIGNATURE- > > --End of forwarded message- > > ---(end of broadcast)--- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED]) > > ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Re: [JDBC] Ant installation (and other) issues!
On Sat, Oct 20, 2001 at 03:54:12PM +0200, Per-Olof Norén wrote: > Hi all, > I have been listening to the discussions about Ant and the build system. > I think that the discussion is missing a point, which I will try to make here :-) [ points for using Ant ] I would describe current JDBC build topic in 4 points: * What the JDBC developers find themselves comfortable with when developing the driver. This seems to be Ant-based build process. * What the PostgreSQL core developers find themselves comfortable with. This means keeping the overall PostgreSQL build process complexity down and making the general './configure;make;make install' as smooth as possible. As the rest of the PostgreSQL uses make, it would be simpler for them to use make for Java too. * Special case: general UN*X system, Java but no Ant. How probable this is? User probably wants to compile all of PostgreSQL distribution. One solution is to include Ant .jars in PostgreSQL source. * Special case: non-Unix system, Unix tools are hard to use, Ant is easier. How probable this is? User is hacking only JDBC. I sent a patch earlier which solves the above problems by using both Ant and make to compile JDBC: when driver is compiled with rest of the PostgreSQL, the build is make-only, but it also makes Ant-only build possible by preparing ant.cfg file with configure variables. But this has new problem: now two build systems must be maintained. Whether this is acceptable depends on how complex they are and how often they must be modified. I tried to keep the make variant as simple as possible: no dependencies need to be tracked specially, only few special files are mentioned explicitly. On what direction to take the final word must be said by JDBC developers, as they are most affected by it. -- marko ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
Re: [JDBC] Ant installation (and other) issues!
* Peter Eisentraut <[EMAIL PROTECTED]> wrote: | | Per-Olof Norén writes: | | > The Ant build system is making its way to be a "de facto" standard for building |java applications as | > it is built for the purpose. | | Make as been the standard for building any application for about 30 years. | GNU-style configure has been the standard for configuration management for | about 10 years. Windows NT and Visual Basic have been the standard for | enterprise computing for 5 years. Thank you very much. ;-) I can't your point or the joke, please enlighten me ;-) make is AFAIK the most common build program, but that doesn't mean that the tool is ideal everywhere. Progress is possible you know, evolutionary or revolutionary. GNU Make has been evolutionary, Ant is revolutionary. configure management is certainly a lot more than configure. I would argue that CVS is the most important configuration management tool, but the issue is of course broader. But anyway this off topic, what need to have is a build process that works nicely and I think including the ant binaries(around 500k) would be the best solution here. -- Gunnar Rønning - [EMAIL PROTECTED] Senior Consultant, Polygnosis AS, http://www.polygnosis.com/ ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
Re: [JDBC] Ant installation (and other) issues!
> Per-Olof Nor?n writes: > > > The Ant build system is making its way to be a "de facto" standard for building >java applications as > > it is built for the purpose. > > Make as been the standard for building any application for about 30 years. > GNU-style configure has been the standard for configuration management for > about 10 years. Windows NT and Visual Basic have been the standard for > enterprise computing for 5 years. Thank you very much. ;-) A more important point is that we are not a java-only codebase. If we were, I could see a stronger argument for Ant. As it is now, we have to weigh using a Java-standard Ant vs. a PostgreSQL/C-standard makefile solution. -- Bruce Momjian| http://candle.pha.pa.us [EMAIL PROTECTED] | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup.| Drexel Hill, Pennsylvania 19026 ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Re: [JDBC] Ant installation (and other) issues!
Per-Olof Norén wrote: > Hi all, > > I have been listening to the discussions about Ant and the build system. > > I think that the discussion is missing a point, which I will try to make > here :-) > > > > 1. Standard > > The Ant build system is making its way to be a "de facto" standard for > building java applications as > > it is built for the purpose. > This may be the heart of the problem. Some people see Ant as problematic because it isn't the standard build tool used for Postgres. Others see make as problematic because it isn't a standard for building java applications (although I know of as many java apps built with make as with Ant personally). But the jdbc driver for postgres is both a postgres component and in java. thanks, --Barry ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
OT Re: [JDBC] Ant installation (and other) issues!
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 21-Oct-2001 Peter Eisentraut wrote: > Per-Olof Norén writes: >> The Ant build system is making its way to be a "de facto" standard for >> building java applications as it is built for the purpose. > > Make as been the standard for building any application for about 30 years. > GNU-style configure has been the standard for configuration management for > about 10 years. Windows NT and Visual Basic have been the standard for > enterprise computing for 5 years. Thank you very much. ;-) And I thought Java was the standard for enterprise computering long before Visual Basic. :-) [Corba? What's Corba? CICS anyone?] I guess standards are what I use, and everyone else is violating them. ;-) [Sorry, couldn't resist...] Virtually, Ned Wolpert <[EMAIL PROTECTED]> D08C2F45: 28E7 56CB 58AC C622 5A51 3C42 8B2B 2739 D08C 2F45 -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE71Hn1iysnOdCML0URAtdAAJ9Zikvs/jCqqG6IG1I9ltdBukiIlACeJRtz QHCZWyBV04b/F7KabTA0Htc= =S1Xx -END PGP SIGNATURE- ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
Re: [JDBC] Whatever ... JDBC build patch
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 20-Oct-2001 Peter Eisentraut wrote: >> How do distributors that need to build all driver types proceed ? > > I haven't seen one yet, but theoretically they should configure several > different build trees from one source tree. Of course, this doesn't work > with Ant, but it's trivial with GNU make. Actually, I think you can, if I understand the question. Simply have multiple targets in the build process, one per driver type. Each target builds the driver if and-only-if the needed classes are loaded. Virtually, Ned Wolpert <[EMAIL PROTECTED]> D08C2F45: 28E7 56CB 58AC C622 5A51 3C42 8B2B 2739 D08C 2F45 -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD4DBQE71Fx+iysnOdCML0URAvAJAJjcYuLk2CCeL1wooZ2dYTveYKxbAJ4xZ5z4 HzjKi22efx295LsmMfo5kw== =WdGU -END PGP SIGNATURE- ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
Re: [JDBC] Ant installation (and other) issues!
Per-Olof Norén writes: > The Ant build system is making its way to be a "de facto" standard for building java >applications as > it is built for the purpose. Make as been the standard for building any application for about 30 years. GNU-style configure has been the standard for configuration management for about 10 years. Windows NT and Visual Basic have been the standard for enterprise computing for 5 years. Thank you very much. ;-) -- Peter Eisentraut [EMAIL PROTECTED] http://funkturm.homeip.net/~peter ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
Re: [JDBC] [PATCHES] Ant configuration
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 20-Oct-2001 Gunnar Rønning wrote: >| * Ant doesn't provide an exit status; you have to watch the build to see >| if it works. This is unacceptable. > > Hmm. Anybody with a solution here ? Actuall, it does. Example: [wolpert@wolpert configTest]$ ant build Buildfile: build.xml prepare: build: BUILD SUCCESSFUL Total time: 2 seconds [wolpert@wolpert configTest]$ echo $? 0 [wolpert@wolpert configTest]$ ant build Buildfile: build.xml prepare: build: [javac] Compiling 1 source file to /home/wolpert/test/configTest/classes [javac] /home/wolpert/test/configTest/src/GetAll.java:25: ';' expected [javac] jdo.setDatabaseName("configTest"); [javac]^ [javac] /home/wolpert/test/configTest/src/GetAll.java:24: cannot resolve symbol [javac] symbol : class fds [javac] location: class GetAll [javac] jdo.setConfiguration("/database.xml");fds [javac] ^ [javac] /home/wolpert/test/configTest/src/GetAll.java:25: jdo is already defined in getDatabase() [javac] jdo.setDatabaseName("configTest"); [javac] ^ [javac] 3 errors BUILD FAILED /home/wolpert/test/configTest/build.xml:35: Compile failed, messages should have been provided. Total time: 4 seconds [wolpert@wolpert configTest]$ echo $? 1 [wolpert@wolpert configTest]$ Virtually, Ned Wolpert <[EMAIL PROTECTED]> D08C2F45: 28E7 56CB 58AC C622 5A51 3C42 8B2B 2739 D08C 2F45 -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE71FvwiysnOdCML0URAqiRAJ4g8TL2aY9fAj25JzOw+mabnBG8PACggEOK xQOWn7giK++ZRDAsfyDtzsE= =M4Ld -END PGP SIGNATURE- ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])