Alex0000
15-05-2009, 19:14
ciao a tutti ho un enorme problema, è da 4 giorni che sto su questo problema...
e sto perdendo la fiducia.....
cmq
sto cercando di creare una conessione al database derby quello integrato in netbeans, ho già creato il database ma ho un enorme problema, nn si conette in alcun modo.....
e nn so che fare
sono riuscito a individuare forse il problema, mi sa che utilizzo il driver sbagliato per derby e nn so dove trovarlo ne come inserirlo...
se questo è il problema...
il database e creato sotto services c'è e funziona anche
queste sono le stringhe:
public void init(ServletConfig config)
throws ServletException
{
String url = "jdbc:derby:db";
Connection con;
Statement stmt;
try {
Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
} catch(java.lang.ClassNotFoundException e) {
System.err.print("ClassNotFoundException: ");
}
try {
con = DriverManager.getConnection(url,"", "");
}
catch(SQLException ex) {
System.err.println(
}
db è il nome del mio database
come driver per derby ho messo: EmbeddedDriver
ho fatto questo screen magari potrebbe essere utile a risolvere questo incresco problema:
I immagine
http://img29.imageshack.us/img29/4736/netbeans.jpg
II immagine
http://img268.imageshack.us/img268/7914/netbeans2.jpg
e sto perdendo la fiducia.....
cmq
sto cercando di creare una conessione al database derby quello integrato in netbeans, ho già creato il database ma ho un enorme problema, nn si conette in alcun modo.....
e nn so che fare
sono riuscito a individuare forse il problema, mi sa che utilizzo il driver sbagliato per derby e nn so dove trovarlo ne come inserirlo...
se questo è il problema...
il database e creato sotto services c'è e funziona anche
queste sono le stringhe:
public void init(ServletConfig config)
throws ServletException
{
String url = "jdbc:derby:db";
Connection con;
Statement stmt;
try {
Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
} catch(java.lang.ClassNotFoundException e) {
System.err.print("ClassNotFoundException: ");
}
try {
con = DriverManager.getConnection(url,"", "");
}
catch(SQLException ex) {
System.err.println(
}
db è il nome del mio database
come driver per derby ho messo: EmbeddedDriver
ho fatto questo screen magari potrebbe essere utile a risolvere questo incresco problema:
I immagine
http://img29.imageshack.us/img29/4736/netbeans.jpg
II immagine
http://img268.imageshack.us/img268/7914/netbeans2.jpg