[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] 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://server:port/database 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?
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] 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] 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) { ! 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(); !
[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
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; ! 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] 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
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] 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