Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Risolto]jdbc-mysql
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) Forum di discussione italiano
View previous topic :: View next topic  
Author Message
g3nt00_m4n
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jan 2005
Posts: 132

PostPosted: Fri Feb 10, 2006 7:40 pm    Post subject: [Risolto]jdbc-mysql Reply with quote

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
View user's profile Send private message
grentis
Guru
Guru


Joined: 20 Jul 2004
Posts: 321

PostPosted: Fri Feb 10, 2006 7:58 pm    Post subject: Reply with quote

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
View user's profile Send private message
g3nt00_m4n
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jan 2005
Posts: 132

PostPosted: Fri Feb 10, 2006 8:08 pm    Post subject: Reply with quote

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
View user's profile Send private message
grentis
Guru
Guru


Joined: 20 Jul 2004
Posts: 321

PostPosted: Fri Feb 10, 2006 8:15 pm    Post subject: Reply with quote

Quando lanci il programma

java -classpath /quellocheee'/libreria.jar;/fdgsfs/secondalib.jar nomeclasse

Edit: stessa cosa in fase di compilazione
Back to top
View user's profile Send private message
g3nt00_m4n
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jan 2005
Posts: 132

PostPosted: Fri Feb 10, 2006 8:22 pm    Post subject: Reply with quote

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
View user's profile Send private message
grentis
Guru
Guru


Joined: 20 Jul 2004
Posts: 321

PostPosted: Fri Feb 10, 2006 8:29 pm    Post subject: Reply with quote

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
View user's profile Send private message
g3nt00_m4n
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jan 2005
Posts: 132

PostPosted: Fri Feb 10, 2006 8:49 pm    Post subject: Reply with quote

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
View user's profile Send private message
grentis
Guru
Guru


Joined: 20 Jul 2004
Posts: 321

PostPosted: Fri Feb 10, 2006 9:07 pm    Post subject: Reply with quote

Ok, sono un somaro :)

prova così

Code:
java -classpath "/usr/share/jdbc-mysql/lib/jdbc-mysql.jar:./" Main
Back to top
View user's profile Send private message
g3nt00_m4n
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jan 2005
Posts: 132

PostPosted: Fri Feb 10, 2006 9:09 pm    Post subject: Reply with quote

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
View user's profile Send private message
gutter
Bodhisattva
Bodhisattva


Joined: 13 Mar 2004
Posts: 7162
Location: Aarau, Aargau, Switzerland

PostPosted: Sat Feb 11, 2006 11:34 am    Post subject: Reply with quote

Moved from Forum italiano (Italian) to Forum di discussione italiano.
_________________
Registered as User #281564 and Machines #163761
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) Forum di discussione italiano All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum