X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id EC27A54305 for ; Tue, 10 May 2005 14:32:55 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 23510-08 for ; Tue, 10 May 2005 17:32:48 +0000 (GMT) Received: from cuaima.ica.luz.ve (www.ica.luz.edu.ve [150.185.222.161]) by svr1.postgresql.org (Postfix) with ESMTP id 2960C542FB for ; Tue, 10 May 2005 14:32:43 -0300 (ADT) Received: from tragavenado.ica.luz.ve (tragavenado.ica.luz.ve [10.2.208.202]) by cuaima.ica.luz.ve (Postfix) with ESMTP id AF24771F19 for ; Tue, 10 May 2005 13:32:39 -0400 (VET) From: Nelson =?iso-8859-1?q?Arap=E9?= Organization: ICA-LUZ To: pgsql-jdbc@postgresql.org Subject: Re: java.sql.SQLException: No suitable driver Date: Tue, 10 May 2005 13:32:38 -0400 User-Agent: KMail/1.6.2 References: <4246295D0005CB56@nfs01.in.adinet.com.uy> In-Reply-To: <4246295D0005CB56@nfs01.in.adinet.com.uy> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-Id: <200505101332.38489.narape@ica.luz.ve> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.038 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200505/40 X-Sequence-Number: 12871 Probably it is a classpath isue, Are you sure that the driver's jar is in t= he=20 classpath of the project? Bya Nelson Arap=E9 El Mar 10 May 2005 13:24, boleguy@adinet.com.uy escribi=F3: > HI: > I'M TRYING TO CONNECT AN ECLIPSE 3.01 IDE RUNNING ON WINDOWS XP WITH A DB > POSTGRESQL VERSION 7.4.7. I USED THE FOLLOWINGS DRIVERS: > PG.74.213/4/5/6.JDBC3.JAR AND NO ONE WORKS. > > THE MESSAGE WAS THE FOLLOWING: > Cargando clase > IWAV0055I Java Bean frenchconn.connpost started with the main method > java.sql.SQLException: No suitable driver > at java.sql.DriverManager.getConnection(Unknown Source) > at java.sql.DriverManager.getConnection(Unknown Source) > at frenchconn.connpost.agregarCliente(connpost.java:33) > at frenchconn.connpost.main(connpost.java:69) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) > at java.lang.reflect.Method.invoke(Unknown Source) > at > org.eclipse.ve.internal.java.vce.launcher.remotevm.JavaBeansLauncher.main= (J >avaBeansLauncher.java:86) > > AND THE CODE (MY CODE): > > import java.sql.*; > import java.sql.DriverManager; > import java.sql.PreparedStatement; > > //import samples.jdbc.JDBCTest; > > > /** > * @author Benjamin > * > * TODO To change the template for this generated type comment go to > * Window - Preferences - Java - Code Style - Code Templates > */ > public class connpost { > > static { > System.out.println("Cargando clase"); > } > > public void agregarCliente(long idCliente, > String nombre) { > try { > String url =3D "jdbc:postgres://172.16.100.110:5432/benjamin"; > Connection conn =3D null; > conn =3D DriverManager.getConnection(url,"benjamin", "benja1"); > DriverManager.getDriver("org.postgresql.Driver"); > > String sql =3D > "INSERT INTO Cliente " + > "(IdCliente, Nombre) " + > "VALUES (?,?)"; > > PreparedStatement ps =3D > conn.prepareStatement(sql); > > ps.setLong(1, idCliente); > ps.setString(2, nombre); > > ps.executeUpdate(); > > ps.close(); > > conn.close(); > > System.out.println("Cliente insertado OK"); > } > catch (Exception ex) { > ex.printStackTrace(); > } > } > > public static void main(String[] args) { > > try { > // Cargo el driver JDBC de postgres > Class.forName("org.postgresql.Driver"); > > connpost conn =3D new connpost(); > //jdbcTest.agregarCliente(1, "Pepe"); > //jdbcTest.agregarCliente(2, "Juan"); > conn.agregarCliente(123,"pepe"); > > // jdbcTest.transaccion(); > } > catch (Exception ex) { > ex.printStackTrace(); > } > } > } > > > THANKS FOR EVERYTHING TO ANYONE > > BENJAMIN > > > > ---------------------------(end of broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)