[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [linux] jdbc



Bonjour tout le monde,
Et si tu fais echo $CLASSPATH. Qu'est-ce que ça donne comme résultat?

Xavier

> oui
> j'ai fais javac monfichier.java
> creation d'un A.class
> et java A
>
> daniel
>
> Dany De Bontridder wrote:
>
> > tu as bien tapé la commande java  A ??
> >
> > A+,
> >
> > D.
> >
> > Oui j'imagine que tu as crées  le fichier A.java que tu as compilé en
A.class :-)
> >
> > On Mon, 01 Apr 2002 13:29:46 +0200
> > daniel <daniel@12move.be> wrote:
> >
> > > salut
> > > j'ai toujour les memes erreur
> > > java.lang.ClassNotFoundException: monfichier
> > > at java.lang.Class.forName(Class.java:native)
> > > at java.lang.Class.forName(Class.java:52)
> > >
> > > daniel
> > >
> > > Dany De Bontridder wrote:
> > >
> > > > Il ya qq erreurs dans la doc...
> > > > D'abord le fichier .jar, il ne s'appele pas postgresql.jar, tu le
trouveras normalement sous /usr/share/pgsql
> > > > export CLASSPATH=/usr/share/pgsql/jdbc7.1.1.2.jar:.
> > > > (suivant la version)
> > > > 2. code exemple (qui marche !!!)
> > > >
> > > > import java.util.*;
> > > > import java.sql.*;
> > > >
> > > > public class A {
> > > >  Connection Con;
> > > >         A() {
> > > >         try {
> > > >                 Class.forName("org.postgresql.Driver");
> > > >
Con=DriverManager.getConnection("jdbc:postgresql:database","user"
> > > >                 ,"");
> > > >         } catch(Exception E) {
> > > >                 System.out.println(E.toString());
> > > >         }
> > > >         }
> > > >         void Get() {
> > > >         try {
> > > >         Statement Sql=Con.createStatement();
> > > >         ResultSet rs=Sql.executeQuery("select column from table");
> > > >         while (rs.next()) {
> > > >                 System.out.println("Column = "+rs.getString(1));
> > > >         }
> > > >         }
> > > >         catch(Exception E) {
> > > >         System.out.println(E.toString());
> > > >         }
> > > >         }
> > > >         public static void main (String[] args)
> > > >         {
> > > >         A z=new A();
> > > >         z.Get();
> > > >         }
> > > > }
> > > >
> > > > On Sun, 31 Mar 2002 21:28:33 +0200
> > > > daniel <daniel@12move.be> wrote:
> > > >
> > > > > Salut tout le monde
> > > > >
> > > > > qlq'un a-t-il deja utilise le jdbc de postgresql ?
> > > > > j'ai instal. postgresql 7.1.... via des rpm avec tous les modules
lib
> > > > > ... etc
> > > > > quand je veux test. les programmes de demo, il y a toujour
l'erreur
> > > > > (cannot find type "org/postgresql/statement")
> > > > > je ne sais pas ce qui manque encore pour que cela fonctionne !
> > > > > de plus dans la doc ils disent qu'il faut un CLASSPATH=un
> > > > > chemin/postgresql.jar, et je trouve pas ce fichier
(postgresql.jar) ?
> > > > > je fais quoi pour que sa marche
> > > > >
> > > > > d'avance un grand merci
> > > > >
> > > > > daniel
> > > > >
> > > > > _______________________________________________
> > > > > Linux Mailing List
> > > > > Archives: http://www.unixtech.be/mailman/listinfo/linux
> > > >
> > > > _______________________________________________
> > > > Linux Mailing List
> > > > Archives: http://www.unixtech.be/mailman/listinfo/linux
> > >
> > > _______________________________________________
> > > Linux Mailing List
> > > Archives: http://www.unixtech.be/mailman/listinfo/linux
> >
> > _______________________________________________
> > Linux Mailing List
> > Archives: http://www.unixtech.be/mailman/listinfo/linux
>
> _______________________________________________
> Linux Mailing List
> Archives: http://www.unixtech.be/mailman/listinfo/linux

_______________________________________________
Linux Mailing List
Archives: http://www.unixtech.be/mailman/listinfo/linux