DB Tips

1. ResultSet.getObject() : function for unknown type of fields in DB table

2. ResultSet.wasNull(): return true or false depending on whether the last column read was true database null.

3. Prepared Statements: the SQL in a PreparedStatement is precompiled by the database for faster execution.

PreparedStatement.setInt(column_name, col_value);    //and setDouble() and so on.

PreparedStatement.executeUpdate()  //execute the stored SQL.

你可能感兴趣的:(sql)