connectivity problem

From: adp adp <adp_group2004(at)yahoo(dot)co(dot)in>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: connectivity problem
Date: 2004-01-30 08:26:27
Message-ID: 20040130082627.55414.qmail@web8106.mail.in.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

I am using postgreSQL 7.3,j2sdk1.4.2 and have
installed jdbc driver as pg73jdbc3.jar

Here is the classpath :
exportCLASSPATH=/root/j2sdk1.4.2/bin/test1.java:/root/j2sdk_nb/j2sdk1.4.2/jre/lib/ext/pg73jdbc3.jar:.

and here is the code:

import java.sql.*;
class test2{
public static void main (String args[]) {


try{


Class.forName("org.postgresql.Driver");



String
url="jdbc:postgresql//10.1.30.10:85/test";
Connection con =
DriverManager.getConnection(url, "postgres", "");
Statement stm= con.createStatement();


stm.setQueryTimeout(10);
ResultSet rs = stm.executeQuery("select col1 from
test1");


rs.next();


System.out.println(rs.getString(1));
}catch(ClassNotFoundException e) {




System.out.println("Exception");
System.out.println(e.toString());
}
catch(SQLException e) {




System.out.println("Exception");
System.out.println(e.toString());
}
}
}

and here is the error I receive :

Exception
java.sql.SQLException: No suitable driver

________________________________________________________________________
Yahoo! India Mobile: Download the latest polyphonic ringtones.
Go to http://in.mobile.yahoo.com

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2004-01-30 08:33:22 Re: connectivity problem
Previous Message Kris Jurka 2004-01-30 07:02:16 Re: org.postgresql.core.QueryExecutor.execute not responding