pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedJDBC driver not found error: Windows XP / JDK1.6.06 / PG8.2.9
6+ messages / 5 participants
[nested] [flat]
* JDBC driver not found error: Windows XP / JDK1.6.06 / PG8.2.9
@ 2008-07-01 13:28 Chandra ASGI Tech <chandraasgi@gmail.com>
0 siblings, 2 replies; 6+ messages in thread
From: Chandra ASGI Tech @ 2008-07-01 13:28 UTC (permalink / raw)
To: pgsql-jdbc
I have PostgreSQL 8.2.9 on Windows XP, with JDK 1.6.0_06. Have got the
postgresql-8.2-508.jdbc4.jar jdbc driver in /lib/ext of the Java folder.
HAve set both the PATH and CLASSPATH aporpriately
My Java code for testing is:
import java.sql.*;
class postgreSQLTest
{
public static void main (java.lang.String[] args) throws Exception {
try{
Class.forName("org.postgresql.Driver");
Connection con =
DriverManager.getConnection("jdbc:Postgresql://localhost:5432/postgres","postgres","1234");
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select * from country");
while(rs.next())
{
System.out.println(rs.getString(1)+"<br>");
}
}catch(Exception e){
System.out.println(e);
}
}
}
But I get the error
Exception in thread "main" java.lang.NoClassDefFoundError: postgreSQLTest
Any help? Thanks in advance.
- ChandraASGI
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: JDBC driver not found error: Windows XP / JDK1.6.06 / PG8.2.9
@ 2008-07-01 14:33 Dave Cramer <pg@fastcrypt.com>
parent: Chandra ASGI Tech <chandraasgi@gmail.com>
1 sibling, 0 replies; 6+ messages in thread
From: Dave Cramer @ 2008-07-01 14:33 UTC (permalink / raw)
To: Chandra ASGI Tech <chandraasgi@gmail.com>; +Cc: pgsql-jdbc
You have used a capital P in the url jdbc:Postgresql://localhost:5432/
postgres","postgres","1234");
Dave
On 1-Jul-08, at 9:28 AM, Chandra ASGI Tech wrote:
> I have PostgreSQL 8.2.9 on Windows XP, with JDK 1.6.0_06. Have got
> the postgresql-8.2-508.jdbc4.jar jdbc driver in /lib/ext of the
> Java folder.
>
> HAve set both the PATH and CLASSPATH aporpriately
>
> My Java code for testing is:
>
> import java.sql.*;
>
> class postgreSQLTest
> {
>
> public static void main (java.lang.String[] args) throws Exception {
>
> try{
>
> Class.forName("org.postgresql.Driver");
>
> Connection con =
> DriverManager.getConnection("jdbc:Postgresql://localhost:5432/
> postgres","postgres","1234");
>
> Statement stmt = con.createStatement();
> ResultSet rs = stmt.executeQuery("select * from country");
>
> while(rs.next())
>
> {
>
> System.out.println(rs.getString(1)+"<br>");
>
> }
>
> }catch(Exception e){
>
> System.out.println(e);
>
> }
>
> }
>
> }
>
>
> But I get the error
> Exception in thread "main" java.lang.NoClassDefFoundError:
> postgreSQLTest
>
>
> Any help? Thanks in advance.
>
>
> - ChandraASGI
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: JDBC driver not found error: Windows XP / JDK1.6.06 / PG8.2.9
@ 2008-07-01 15:21 Oliver Jowett <oliver@opencloud.com>
parent: Chandra ASGI Tech <chandraasgi@gmail.com>
1 sibling, 1 reply; 6+ messages in thread
From: Oliver Jowett @ 2008-07-01 15:21 UTC (permalink / raw)
To: Chandra ASGI Tech <chandraasgi@gmail.com>; +Cc: pgsql-jdbc
Chandra ASGI Tech wrote:
> But I get the error
> Exception in thread "main" java.lang.NoClassDefFoundError: postgreSQLTest
Your code isn't even running because the JVM can't find your main class.
This isn't anything to do with JDBC, it's basic Java.
-O
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: JDBC driver not found error: Windows XP / JDK1.6.06 / PG8.2.9
@ 2008-07-01 16:28 Chandra ASGI Tech <chandraasgi@gmail.com>
parent: Oliver Jowett <oliver@opencloud.com>
0 siblings, 1 reply; 6+ messages in thread
From: Chandra ASGI Tech @ 2008-07-01 16:28 UTC (permalink / raw)
To: Oliver Jowett <oliver@opencloud.com>; +Cc: pgsql-jdbc
On Tue, Jul 1, 2008 at 11:21 AM, Oliver Jowett <oliver@opencloud.com> wrote:
> Chandra ASGI Tech wrote:
>
> But I get the error
>> Exception in thread "main" java.lang.NoClassDefFoundError: postgreSQLTest
>>
>
> Your code isn't even running because the JVM can't find your main class.
> This isn't anything to do with JDBC, it's basic Java.
>
> -O
>
HI, the error message seems so, but Java does work - i tested with a simple
hello world program and it worked. So i do not think it is a problem with
the JVM - but am not able to understand what the error is.
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: JDBC driver not found error: Windows XP / JDK1.6.06 / PG8.2.9
@ 2008-07-02 08:36 tivvpgsqljdbc@gtech-ua.com
parent: Chandra ASGI Tech <chandraasgi@gmail.com>
0 siblings, 0 replies; 6+ messages in thread
From: tivvpgsqljdbc@gtech-ua.com @ 2008-07-02 08:36 UTC (permalink / raw)
To: ; +Cc: pgsql-jdbc
Chandra ASGI Tech написав(ла):
> On Tue, Jul 1, 2008 at 11:21 AM, Oliver Jowett <oliver@opencloud.com
> <mailto:oliver@opencloud.com>> wrote:
>
> Chandra ASGI Tech wrote:
>
> But I get the error
> Exception in thread "main" java.lang.NoClassDefFoundError:
> postgreSQLTest
>
>
> Your code isn't even running because the JVM can't find your main
> class. This isn't anything to do with JDBC, it's basic Java.
>
> -O
>
>
> HI, the error message seems so, but Java does work - i tested with a
> simple hello world program and it worked. So i do not think it is a
> problem with the JVM - but am not able to understand what the error is.
>
I suppose you did not add "." to your classpath when specifying it. Try
without classpath to see if error change. Then ensure you've got correct
classpath.
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: JDBC driver not found error: Windows XP / JDK1.6.06 / PG8.2.9
@ 2008-07-02 16:19 dmp <danap@ttc-cmc.net>
0 siblings, 0 replies; 6+ messages in thread
From: dmp @ 2008-07-02 16:19 UTC (permalink / raw)
To: pgsql-jdbc
Are you sure the PostgreSQL JDBC driver is in the jsdk directory
jdk/jre/lib/ext/?
danap
> Chandra ASGI Tech написав(ла):
> On Tue, Jul 1, 2008 at 11:21 AM, Oliver Jowett <oliver@opencloud.com
> <mailto:oliver@opencloud.com>> wrote:
>
> Chandra ASGI Tech wrote:
>
> But I get the error
> Exception in thread "main" java.lang.NoClassDefFoundError:
> postgreSQLTest
>
>
> Your code isn't even running because the JVM can't find your main
> class. This isn't anything to do with JDBC, it's basic Java.
>
> -O
>
>
> HI, the error message seems so, but Java does work - i tested with a
> simple hello world program and it worked. So i do not think it is a
> problem with the JVM - but am not able to understand what the error is.
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2008-07-02 16:19 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2008-07-01 13:28 JDBC driver not found error: Windows XP / JDK1.6.06 / PG8.2.9 Chandra ASGI Tech <chandraasgi@gmail.com>
2008-07-01 14:33 ` Dave Cramer <pg@fastcrypt.com>
2008-07-01 15:21 ` Oliver Jowett <oliver@opencloud.com>
2008-07-01 16:28 ` Chandra ASGI Tech <chandraasgi@gmail.com>
2008-07-02 08:36 ` tivvpgsqljdbc@gtech-ua.com
2008-07-02 16:19 Re: JDBC driver not found error: Windows XP / JDK1.6.06 / PG8.2.9 dmp <danap@ttc-cmc.net>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox