Skip site navigation (1) Skip section navigation (2)

help in postgres & jdbc

From: Seema Noor <seema_56(at)yahoo(dot)com>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: help in postgres & jdbc
Date: 2001-03-21 22:47:49
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces
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
(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)

      String     url = "jdbc:postgresql:javatest"; 
      Connection con =
DriverManager.getConnection(url, "postgres", ""); 
      Statement  stm = con.createStatement(); 
      ResultSet  rs  = stm.executeQuery("select col1
from test");; 
    } catch (SQLException e) { 

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

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,

Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.

pgsql-interfaces by date

Next:From: Peter T MountDate: 2001-03-22 14:18:58
Subject: Re: problem compiling the jdbc driver
Previous:From: Peter EisentrautDate: 2001-03-21 22:06:10
Subject: Re: problem compiling the jdbc driver

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group