Thread: JDBC on Postgres 8.3
Hello All We have a programmer who is wanting to access our PostgreSQL 8.3 database using JDBC connectivity thorough some OracleQuery tool. I have read from the JDBC site in regards to installing this and have some questions. I will be installingthe JDBC driver on RHEL4 what version of the driver should I use? The programmer said JDBC3 or 4 would work fine.Also what java do I install? One more questions and I will be quiet. What environment variables need to be set for Java?Thanks for any advice that you could share with me. Thanks John Allgood Senior Systems Administrator Turbo, division of Ozburn-Hessey Logistics 2251 Jesse Jewell Pky. NE Gainesville, GA 30507 tel: (678) 989-3051 fax: (770) 531-7878 jallgood@ohlogistics.com www.ohlogistics.com This email transmission may contain information that is proprietary, privileged and/or confidential and is intended exclusivelyfor the person(s) to whom it is addressed. Any use, copying, retention or disclosure by any person other than the intended recipient or the intended recipient's designeesis strictly prohibited. If you are not the intended recipient or their designee, please notify the sender immediately by return email and deleteall copies.
Allgood, John wrote: > We have a programmer who is wanting to access our PostgreSQL 8.3 > database using JDBC connectivity thorough some Oracle Query tool. I > have read from the JDBC site in regards to installing this and have > some questions. I will be installing the JDBC driver on RHEL4 what > version of the driver should I use? The programmer said JDBC3 or 4 > would work fine. You need a JDBC driver for 8.3 specifically. They're not forward compatible, so a JDBC driver for 8.2 may not work correctly with 8.3. As you're happy with JDBC3 or JDBC4 you might as well grab the 8.3 JDBC4 driver: http://jdbc.postgresql.org/download.html http://jdbc.postgresql.org/download/postgresql-8.3-603.jdbc4.jar > Also what java do I install? Unless you have a reason to choose some other JVM or version then installing the Sun J2SE JDK 6 Update 6 for Linux would probably be a good idea. http://java.sun.com/javase/downloads/index.jsp Get the RPM packaged version if you're working on Red Hat, as it's a bit nicer to install. It's also possible that Red Hat provide a packaged JVM for RHEL, so you might want to check for that first. I have no experience with RHEL to use as a base for specific advice, as I pretty much stick to Fedora and Ubuntu. > One more questions and > I will be quiet. What environment variables need to be set for Java? Generally none at all unless your applications require specific environment settings. You might need to specify the path to the PostgreSQL JDBC JAR in the CLASSPATH environment variable if your application is incapable of locating and loading the jar its self when given a path. It may also be necessary to add the bin/ and jre/bin directories of the installed Java environment to your PATH if the software you're using cannot automatically locate the installed JRE. Specific applications may have other environment requirements, but as far as I know (and I use it quite a bit now) the PostgreSQL JDBC driver does not. I get the impression that you're used to working with software and tools that aren't anywhere near so generally sensible as the PostgreSQL database and JDBC driver. Specific JRE versions? Magic environment variables? Ugh, it sounds like a Progress 4GL installation.... -- Craig Ringer
Thanks for responding. I think I have figured out what I need to do. I think I just need to install the JDBC driver on his client machine and then setup the connection strings within the query tool he is using. I assume since he already has java installed on his workstation. Then he can communicate with the PostgreSQL database. The only thing he is wanting to do is pull data out of our database and put into there Oracle Transportation System. -----Original Message----- From: pgsql-jdbc-owner@postgresql.org [mailto:pgsql-jdbc-owner@postgresql.org] On Behalf Of Craig Ringer Sent: Thursday, June 05, 2008 1:16 PM To: Allgood, John Cc: pgsql-jdbc@postgresql.org Subject: Re: [JDBC] JDBC on Postgres 8.3 Allgood, John wrote: > We have a programmer who is wanting to access our PostgreSQL 8.3 > database using JDBC connectivity thorough some Oracle Query tool. I > have read from the JDBC site in regards to installing this and have > some questions. I will be installing the JDBC driver on RHEL4 what > version of the driver should I use? The programmer said JDBC3 or 4 > would work fine. You need a JDBC driver for 8.3 specifically. They're not forward compatible, so a JDBC driver for 8.2 may not work correctly with 8.3. As you're happy with JDBC3 or JDBC4 you might as well grab the 8.3 JDBC4 driver: http://jdbc.postgresql.org/download.html http://jdbc.postgresql.org/download/postgresql-8.3-603.jdbc4.jar > Also what java do I install? Unless you have a reason to choose some other JVM or version then installing the Sun J2SE JDK 6 Update 6 for Linux would probably be a good idea. http://java.sun.com/javase/downloads/index.jsp Get the RPM packaged version if you're working on Red Hat, as it's a bit nicer to install. It's also possible that Red Hat provide a packaged JVM for RHEL, so you might want to check for that first. I have no experience with RHEL to use as a base for specific advice, as I pretty much stick to Fedora and Ubuntu. > One more questions and > I will be quiet. What environment variables need to be set for Java? Generally none at all unless your applications require specific environment settings. You might need to specify the path to the PostgreSQL JDBC JAR in the CLASSPATH environment variable if your application is incapable of locating and loading the jar its self when given a path. It may also be necessary to add the bin/ and jre/bin directories of the installed Java environment to your PATH if the software you're using cannot automatically locate the installed JRE. Specific applications may have other environment requirements, but as far as I know (and I use it quite a bit now) the PostgreSQL JDBC driver does not. I get the impression that you're used to working with software and tools that aren't anywhere near so generally sensible as the PostgreSQL database and JDBC driver. Specific JRE versions? Magic environment variables? Ugh, it sounds like a Progress 4GL installation.... -- Craig Ringer -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc This email transmission may contain information that is proprietary, privileged and/or confidential and is intended exclusivelyfor the person(s) to whom it is addressed. Any use, copying, retention or disclosure by any person other than the intended recipient or the intended recipient's designeesis strictly prohibited. If you are not the intended recipient or their designee, please notify the sender immediately by return email and deleteall copies.
Allgood, John wrote: > Thanks for responding. I think I have figured out what I need to do. I > think I just need to install the JDBC driver on his client machine and > then setup the connection strings within the query tool he is using. I > assume since he already has java installed on his workstation. Then he > can communicate with the PostgreSQL database. The only thing he is > wanting to do is pull data out of our database and put into there Oracle > Transportation System. You're probably in good shape, but you might check the version of Java that is installed. I *think* RHEL4 comes with GNU java, which may or may not work with JDBC (anybody know?). If the user has installed Sun's JDK, then things are almost certainly fine. To find out, run: java -version If you get back something like: ->java -version java version "1.4.2" gcj (GCC) 3.4.6 20060404 (Red Hat 3.4.6-9) Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. you're running GNU java. If you get back something like: ->java -version java version "1.6.0_06" Java(TM) SE Runtime Environment (build 1.6.0_06-b02) Java HotSpot(TM) Server VM (build 10.0-b22, mixed mode) you're running Sun's Java. -- Steve Wampler -- swampler@noao.edu The gods that smiled on your birth are now laughing out loud.
Allgood, John wrote: > Thanks for responding. I think I have figured out what I need to do. > I think I just need to install the JDBC driver on his client machine > and then setup the connection strings within the query tool he is > using. Correct. No additional configuration or installation on the DB server is required. PostgreSQL comes configured to accept JDBC connections. Java in the database is something completely different; I won't go into detail because it will probably confuse more than clarify. -- Guy Rouillier
craig@postnewspapers.com.au (Craig Ringer) writes: > You need a JDBC driver for 8.3 specifically. They're not forward > compatible, so a JDBC driver for 8.2 may not work correctly with > 8.3. As you're happy with JDBC3 or JDBC4 you might as well grab the > 8.3 JDBC4 driver: Are you sure about that??? In looking at the high level notes about differences, there haven't been substantive protocol changes since the move from PostgreSQL 7.4 to 8.0, so I'd be surprised to find this breaking. It's a matter of considerable interest, since we're starting to plan an upgrade to 8.3, and if we *MUST* roll out the 8.3 JDBC driver, we need to start planning for that right away, well in advance of the databases being upgraded. -- (reverse (concatenate 'string "ofni.sesabatadxunil" "@" "enworbbc")) http://www3.sympatico.ca/cbbrowne/lisp.html Why are they called buildings, when they're already finished? Shouldn't they be called builts?
Chris Browne wrote: > craig@postnewspapers.com.au (Craig Ringer) writes: >> You need a JDBC driver for 8.3 specifically. They're not forward >> compatible, so a JDBC driver for 8.2 may not work correctly with >> 8.3. As you're happy with JDBC3 or JDBC4 you might as well grab the >> 8.3 JDBC4 driver: > > Are you sure about that??? My understanding, and I'm very far from an authoritative source, is that it should connect but may not work quite how you expect. I think it relies on various specifics in system catalogs, among other things. However, I can't find any information to substantiate that right now, so it may well be a misunderstanding of previous mail on this list. I know the drivers are backward compatible, with new drivers working on older databases. They also appear to have have the "compatible" parameter to address issues with application compatibility with newer driver versions, though I've never had cause to use it myself. In short: you need to confirm this, but I'm not the right person to give you a definitive (or even good) answer about it. -- Craig Ringer