Received: from mail.postgresql.org (webmail.postgresql.org [216.126.85.28]) by mail.postgresql.org (8.11.3/8.11.1) with SMTP id f2MCwHt53268 for ; Thu, 22 Mar 2001 07:58:17 -0500 (EST) (envelope-from pgsql-interfaces-owner@postgresql.org) Received: from web3301.mail.yahoo.com (web3301.mail.yahoo.com [204.71.201.24]) by mail.postgresql.org (8.11.3/8.11.1) with SMTP id f2LMlpt31380 for ; Wed, 21 Mar 2001 17:47:51 -0500 (EST) (envelope-from seema_56@yahoo.com) Message-ID: <20010321224749.16024.qmail@web3301.mail.yahoo.com> Received: from [195.219.73.12] by web3301.mail.yahoo.com; Wed, 21 Mar 2001 14:47:49 PST Date: Wed, 21 Mar 2001 14:47:49 -0800 (PST) From: =?iso-8859-1?q?Seema=20Noor?= Subject: help in postgres & jdbc To: pgsql-interfaces@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Archive-Number: 200103/160 X-Sequence-Number: 1321 i want to know how to start jdbc for postgreql in red hat linux 7.0. i'm using jdk1.2.2 i have installed red hat linux 7.0 full and there are four jdbc.......jar files of different version. i found two methods to do so: 1) i have set the path CLASSPATH=$CLASSPAH /usr/lib/pgsql/jdbc6.5.1.2.jar (don't the exact version but it started with 6) but when ran the file there was exception of CLASSNOTFOUND. when this exception was caugth it gave the error message "postgresql/driver" how do i set the driver? my simplest program is import java.sql.*; class PostgreSQLTest { public static void main (String[] args) { try { Driver driver = (Driver) Class.forName("postgresql.Driver").newInstance(); DriverManager.registerDriver(driver); String url = "jdbc:postgresql:javatest"; Connection con = DriverManager.getConnection(url, "postgres", ""); Statement stm = con.createStatement(); stm.setQueryTimeout(10); ResultSet rs = stm.executeQuery("select col1 from test"); rs.next(); System.out.println(rs.getString(1)); } catch (SQLException e) { System.out.println("Exception!"); System.out.println(e.toString()); } } where the database name is "javatest" and the table name is "test". in the statement : Connection con = DriverManager.getConnection(url, "postgres", ""); i even have put "root" instead of "postgres" and put the root password (just to try) but it didn't work this way either. 2) i found somewhere to compile the driver from src/interface/jdbc dir (in the postgresql folder) to get postgresql.jar and then set the class path for this postgresql.jar this src/interface/jdbc is not in my system under postgresql directory when i installed the linux completely. but i found these directories in postgresql-7.0.2.tar. i think that the first method is correct. could u please help me to get started? is there something i am missing in the first method? please reply me soon, regards, Seema __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/