Some common places to go wrong:

Prepared Statements

SQL :)

PreparedStatement exampleStmt = conn.prepareStatement("SELECT * FROM relation;");

We distinguish two types of SQL command:

  • Query (returns stuff to view)
  • Update (returns number of rows changed)

Query Prepared Statements

Update Prepared Statements

Using setInt(), setString() etc.

These provide additional security against attacks like SQL injection.

Representing NULL

Different types have different ways of inserting “NULL”.
You use setNull(parameterId, aNull) where aNull varies from type to type.