certo
ecco:
codice:
public class Connection_db {
public static Connection dbConnRet = null;
public static void inserisciValori(Connection dbConnection,String nome,String cognome)
throws SQLException, ClassNotFoundException
{
String PreparedStatement=null;
Connection conn = null;
String statement = "INSERT INTO "+nome+" (nome, cognome)"+
"VALUES (?, ?)";
String connessione = doit();
conn = (Connection) DriverManager.getConnection(connessione);
Class.forName("com.mysql.jdbc.Driver");
PreparedStatement stmt = conn.prepareStatement(statement);
stmt.setString(1, nome);
stmt.setString(2, cognome);
stmt.executeUpdate();
stmt.close();
}