Salve, spero di ricevere informazioni utili. ho questo codice:
import java.sql.*;
public class nuovariga{
public static void main(String [] args) {
Connection con = null;
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbcdbc:Salerno");
Statement st = con.createStatement
(ResultSet.TYPE_SCROLL_INSENSITIVE ,
ResultSet.CONCUR_UPDATABLE);
// insert 3 rows
ResultSet rs =
st.executeQuery(" SELECT * FROM INPUTINCIDENTI");
int nr = rs.getRow();
rs.absolute(nr);
//rs.moveToInsertRow();
rs.last();
rs.next();
rs.moveToInsertRow();
rs.updateInt("ID",(int) 271);
rs.updateString("18","1");
rs.insertRow();
rs.moveToCurrentRow();
st.close();
con.close();
} catch (Exception e) {
System.err.println("Exception: "+e.getMessage());
}
}
}
funziona perfettamente, soltanto che il nome vero della tabella sarebbe INPUT INCIDENTI.
Come posso fare, mi hanno richiesto di non toccare il database. Vi ringrazio infinitamente e in anticipo.![]()