View previous topic :: View next topic |
Author |
Message |
g3nt00_m4n Tux's lil' helper

Joined: 09 Jan 2005 Posts: 132
|
Posted: Fri Feb 10, 2006 7:40 pm Post subject: [Risolto]jdbc-mysql |
|
|
dovrei fare un programmino in java che si connette ad un database mysql, ma non riesco a far funzionare i driver mysql
per java, ho emerso il pacchetto jdbc-mysql ma continua a non funzionare, bisogna dare qualche comando in particolare???
Spero di non essere OT
Last edited by g3nt00_m4n on Fri Feb 10, 2006 9:08 pm; edited 1 time in total |
|
Back to top |
|
 |
grentis Guru


Joined: 20 Jul 2004 Posts: 321
|
Posted: Fri Feb 10, 2006 7:58 pm Post subject: |
|
|
Bhe, devi importare le classi che ti servono nel programma e aggiungere il jar nel classpath
Non so se è questo che intendi |
|
Back to top |
|
 |
g3nt00_m4n Tux's lil' helper

Joined: 09 Jan 2005 Posts: 132
|
Posted: Fri Feb 10, 2006 8:08 pm Post subject: |
|
|
grentis wrote: | Bhe, devi importare le classi che ti servono nel programma e aggiungere il jar nel classpath
Non so se è questo che intendi |
come si imposta il jar nel classpath??? |
|
Back to top |
|
 |
grentis Guru


Joined: 20 Jul 2004 Posts: 321
|
Posted: Fri Feb 10, 2006 8:15 pm Post subject: |
|
|
Quando lanci il programma
java -classpath /quellocheee'/libreria.jar;/fdgsfs/secondalib.jar nomeclasse
Edit: stessa cosa in fase di compilazione |
|
Back to top |
|
 |
g3nt00_m4n Tux's lil' helper

Joined: 09 Jan 2005 Posts: 132
|
Posted: Fri Feb 10, 2006 8:22 pm Post subject: |
|
|
grentis wrote: | Quando lanci il programma
java -classpath /quellocheee'/libreria.jar;/fdgsfs/secondalib.jar nomeclasse
Edit: stessa cosa in fase di compilazione |
ecco cosa ho fatto:
Code: |
$ javac -classpath /usr/share/jdbc-mysql/lib/jdbc-mysql.jar *.java
$ java -classpath /usr/share/jdbc-mysql/lib/jdbc-mysql.jar Main -V
Exception in thread "main" java.lang.NoClassDefFoundError: Main
$ java Main -V
I driver per mysql non esistono
|
|
|
Back to top |
|
 |
grentis Guru


Joined: 20 Jul 2004 Posts: 321
|
Posted: Fri Feb 10, 2006 8:29 pm Post subject: |
|
|
Hai un contatto icq/jabber ?
Cmq...prova
Code: | java -classpath /usr/share/jdbc-mysql/lib/jdbc-mysql.jar[b];[/b] Main -V |
Edit: ehm...non si vede il bold...mettere il ; dopo il jdb-mysql.jar |
|
Back to top |
|
 |
g3nt00_m4n Tux's lil' helper

Joined: 09 Jan 2005 Posts: 132
|
Posted: Fri Feb 10, 2006 8:49 pm Post subject: |
|
|
grentis wrote: | Hai un contatto icq/jabber ? |
No
grentis wrote: | Cmq...prova
Code: | java -classpath /usr/share/jdbc-mysql/lib/jdbc-mysql.jar; Main -V |
|
spunta l'help del java e poi :
Code: |
bash: Main: command not found
|
edit:
ho provato anche:
Code: |
$ java -classpath "/usr/share/jdbc-mysql/lib/jdbc-mysql.jar;." Main -V
Exception in thread "main" java.lang.NoClassDefFoundError: Main
$ java -classpath "/usr/share/jdbc-mysql/lib/jdbc-mysql.jar;" Main -V
Exception in thread "main" java.lang.NoClassDefFoundError: Main
|
|
|
Back to top |
|
 |
grentis Guru


Joined: 20 Jul 2004 Posts: 321
|
Posted: Fri Feb 10, 2006 9:07 pm Post subject: |
|
|
Ok, sono un somaro
prova così
Code: | java -classpath "/usr/share/jdbc-mysql/lib/jdbc-mysql.jar:./" Main |
|
|
Back to top |
|
 |
g3nt00_m4n Tux's lil' helper

Joined: 09 Jan 2005 Posts: 132
|
Posted: Fri Feb 10, 2006 9:09 pm Post subject: |
|
|
grentis wrote: | Ok, sono un somaro
prova così
Code: | java -classpath "/usr/share/jdbc-mysql/lib/jdbc-mysql.jar:./" Main |
|
Grazie , avevo appena letto nel main che il divisore era il : e lo stavo per scrivere ma già mi avevi risposto:)
edit: man non main |
|
Back to top |
|
 |
gutter Bodhisattva


Joined: 13 Mar 2004 Posts: 7162 Location: Aarau, Aargau, Switzerland
|
Posted: Sat Feb 11, 2006 11:34 am Post subject: |
|
|
Moved from Forum italiano (Italian) to Forum di discussione italiano. _________________ Registered as User #281564 and Machines #163761 |
|
Back to top |
|
 |
|