Beispiel #1
0
 // select
 public ResultSet query(String sql) throws Exception {
   Statement stmt = conn.createStatement();
   return stmt.executeQuery(sql);
 }
Beispiel #2
0
 // insert, create, update, delete...
 public int update(String sql) throws Exception {
   Statement stmt = conn.createStatement();
   int ret = stmt.executeUpdate(sql);
   stmt.close();
   return ret;
 }