problem while running simple java program - Mailing list pgsql-jdbc

From java unix
Subject problem while running simple java program
Date
Msg-id 534957390503140027124dc439@mail.gmail.com
Whole thread Raw
Responses Re: problem while running simple java program
Re: problem while running simple java program
List pgsql-jdbc
hi,

 when i run a simple program as given below

import java.sql.*;

class PostgreSQLTest {

public static void main (String[] args) {

try{

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

Connection con =
DriverManager.getConnection("jdbc:postgresql://localhost:5432/test","postgres","roopesh");

Statement stmt = con.createStatement();

ResultSet rs = stmt.executeQuery("select col1 from test");

while(rs.next())

{

System.out.println(rs.getString(1)+"<br>");

}

}catch(Exception e){

System.out.println(e);

}

}

}

when i run it i am getting the following errors

[root@roopesh root]# java PostgreSQLTest
Exception in thread "main" java.lang.InternalError:
unexpected exception during
linking: java.lang.ClassNotFoundException:
javax.net.ssl.SSLSocket
   at 0x40268e17:
java.lang.Throwable.Throwable(java.lang.String)
(/usr/lib/./li
bgcj.so.3)
   at 0x4025bc8e:
java.lang.Error.Error(java.lang.String)
(/usr/lib/./libgcj.so.
3)
   at 0x402691fa:
java.lang.VirtualMachineError.VirtualMachineError(java.lang.St
ring) (/usr/lib/./libgcj.so.3)
   at 0x4025d62e:
java.lang.InternalError.InternalError(java.lang.String)
(/usr/
lib/./libgcj.so.3)
   at 0x4025ad82:
java.lang.ClassLoader.resolveClass0(java.lang.Class)
(/usr/lib
/./libgcj.so.3)
   at 0x4024646c: java.lang.Class.initializeClass()
(/usr/lib/./libgcj.so.3)
   at 0x40244d04:
java.lang.Class.forName(java.lang.String, boolean,
java.lang.C
lassLoader) (/usr/lib/./libgcj.so.3)
   at 0x40244d9f:
java.lang.Class.forName(java.lang.String)
(/usr/lib/./libgcj.s
o.3)
   at 0x403831e7: ffi_call_SYSV
(/usr/lib/./libgcj.so.3)
   at 0x403831a7: ffi_raw_call
(/usr/lib/./libgcj.so.3)
   at 0x402306e8:
_Jv_InterpMethod.continue1(_Jv_InterpMethodInvocation)
(/usr/l
ib/./libgcj.so.3)
   at 0x40230ff4: _Jv_InterpMethod.run(ffi_cif, void,
ffi_raw, _Jv_InterpMethodI
nvocation) (/usr/lib/./libgcj.so.3)
   at 0x4022e504: _Jv_InterpMethod.run_normal(ffi_cif,
void, ffi_raw, void) (/us
r/lib/./libgcj.so.3)
   at 0x4038305c: ?? (??:0)
   at 0x40242dd8:
gnu.gcj.runtime.FirstThread.call_main()
(/usr/lib/./libgcj.so.
3)
   at 0x402ad02d: gnu.gcj.runtime.FirstThread.run()
(/usr/lib/./libgcj.so.3)
   at 0x4024fc4c: _Jv_ThreadRun(java.lang.Thread)
(/usr/lib/./libgcj.so.3)
   at 0x4021c8ac: _Jv_RunMain(java.lang.Class, byte
const, int, byte const, bool
ean) (/usr/lib/./libgcj.so.3)
   at 0x08048910: ?? (??:0)
   at 0x42015574: __libc_start_main
(/lib/tls/libc.so.6)
   at 0x080486c1: ?? (??:0)

the classpath set is as follows

[root@roopesh root]# echo $CLASSPATH
/usr/java/j2sdk1.4.2_07/lib/tools.jar:/usr/java/j2sdk1.4.2_07/jre/lib/rt.jar:/us
r/local/pgsql/pg74.215.jdbc3.jar:/usr/local/pgsql/pg74:/usr/local/pgsql/pg74/org
/postgresql:/usr/local/pgsql


i donot know what is the problem

thank you

pgsql-jdbc by date:

Previous
From: patrick
Date:
Subject: Re: Cannot Retrieve Binary Data
Next
From: Antony Paul
Date:
Subject: Re: problem while running simple java program