public static void insertRezept(Rezept r, Connection con) throws SQLException { String sql = "insert into rezept(id, name, anleitung, bzr_login) " + "values(?,?,?,?)"; PreparedStatement stmt = null; try { Long id = DbUtil.createId(); stmt = con.prepareStatement(sql); stmt.setObject(1, id); setStmtParams(r, stmt, 2); stmt.setObject(4, r.getBenutzer()); stmt.execute(); r.setId(id); } finally { DbUtil.close(stmt); } }