RETTIFICO QUANTO DETTO!!!
Ho aggiunto del codice al metodo in modo che mi restituisca L'ERRORE se viene lanciata l'exception stessa(la stampo a video sul navigatore), non vedevo alcuna EXC perche' ero sul web, facendo il return dell'exception mi compare:
************************************************** *****
java.sql.SQLException: executeQuery method can not be used for update.
************************************************** *****
SCUSATE IL DISGUIDO!!!MA SONO ALLE PRIME ARMI........
il codice modificato e' questo:
codice:
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.*;
public class LeggiDB {
Connection conn=null;
Statement stmt=null;
ResultSet rs=null;
public String connetti(String nome, String cognome, String email) {
try{
Class.forName("org.apache.derby.jdbc.ClientDriver");
conn= DriverManager.getConnection("jdbc:derby://localhost:1527/Lezione22");
String sqlScrivi="insert into Employee values ('"+nome+"','"+cognome+"','"+email+"')";
stmt=conn.createStatement();
rs=stmt.executeQuery(sqlScrivi);
return null;
}
catch (Exception exc){
exc.printStackTrace();
String errore=exc.toString();
return errore;
}
finally{
try{rs.close();stmt.close();conn.close();}
catch(Exception e){e.printStackTrace();}
}
}
}