Re: java.lang.NoClassDefFoundError

From: "Nico" <nicohmail-postgresql(at)yahoo(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: java.lang.NoClassDefFoundError
Date: 2005-01-18 15:45:51
Message-ID: csjav7$u2q$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

It didn't work for me either. When I put the jar file in my classes directory, it did work.
""Becerra Lagos Ana Lilian"" <exabecerra(at)nt(dot)entel(dot)cl> schreef in bericht news:3A568BC085A5794983C7118F1A27CDEC2C7C40(at)epmarexc03(dot)Entelpcs(dot)Entelcorp(dot)com(dot)(dot)(dot)
Hi,

Could you help me in my program JAVA with jdbc Postgre

I have my simple code

import java.sql.DriverManager;

import java.sql.Connection;

import java.sql.SQLException;

public class Example2 {

public static void main(String[] argv) {

System.out.println("Checking if Driver is registered with DriverManager.");

try {

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

} catch (ClassNotFoundException cnfe) {

System.out.println("Couldn't find the driver!");

System.out.println("Let's print a stack trace, and exit.");

cnfe.printStackTrace();

System.exit(1);

}

}

}

Then I execute :

javac Example2.java

Then I execute

java Example2

but I get

Exception in thread "main" java.lang.NoClassDefFoundError: Example

Wich is my error ?

I copied pg73jdbc3.jar in my path

C:\j2sdk1.4.1_07\lib\

Its have org.postgresql.Driver

Thanks advanted

ana

Este correo es dirigido solo a las personas que aparecen como destinatarios
y puede contener información confidencial o privilegiada.
Si usted recibió este correo por error, por favor notificar inmediatamente
al emisor y elimine el correo original. Cualquier otro uso de este correo
esta prohibido.

******************************************************************************************************

This message is for the designated recipient only and may contain privileged or
confidential information. If you have received it in error, please notify the sender
immediately and delete the original. Any other use of the email is prohibited.

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message William Lai 2005-01-18 15:58:54 Re: java.lang.NoClassDefFoundError
Previous Message Becerra Lagos Ana Lilian 2005-01-18 15:36:08 Re: java.lang.NoClassDefFoundError