LocalJavaField connection = jm.newJavaField(Connection.class);
connection.addLine("null");
jm.addTry();
jm.addLine(connection, " = getConnection();");
LocalJavaField stmt = jm.newJavaField(PreparedStatement.class);
stmt.addLine(connection, ".prepareStatement(", query, ")");
jm.addTry();
getPreparedStatementParameters(jm, stmt, elem, table.getColumns(), 0);
jm.addLine(stmt, ".executeUpdate();");
getFinally(jm, stmt, null, null);