private PreparedStatement populateCreateRecordStatement(Record record, Connection con) throws SQLException { String query = "INSERT into BookRecord values(?,?,?,?)"; PreparedStatement statement = con.prepareStatement(query); statement.setString(1, record.getBookRecord()); statement.setString(2, record.getBookId()); statement.setString(3, record.getStatus()); statement.setString(4, record.getStudentId()); return statement; }