1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| PreparedStatement ps =null;
ResultSet rs = null;
try {
JOptionPane.showMessageDialog(this, con.isReadOnly());
ps = con.prepareStatement("SELECT * FROM tp.secure",ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
// ps = con.prepareStatement("INSERT INTO tp.secure (groupe,type_secure,item1,item2,item3) VALUES(?,?,?,?,?)",ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
con.setReadOnly(false);
rs = ps.executeQuery();
rs.moveToInsertRow();
rs.updateString("groupe",admGroup);
rs.updateString("type_secure","F");
rs.updateString("item1",Item1);
rs.updateString("item2", Item2 == null ? null : Item2);
rs.updateString("item3", Item3 == null ? null : Item3);
rs.insertRow();
} catch( Exception e ){
System.out.println(e.toString() + " Perenity Software " + e.getMessage());
e.printStackTrace();
} |
Partager