没有为 setDate(int,java.util.Date) 方法找到合适的方法 PreparedStatement.setDate(int,java.sql.Date,Calendar) 不适用
public void update (Pasien dp) {
DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
PreparedStatement statement = null;
try {
statement = connection.prepareStatement(update);
statement.setString(1, dp.getId_pemeriksaan());
statement.setString(2,dp.getNama());
statement.setString(3,dp.getAlamat());
statement.setString(4,dp.getUmur());
statement.setString(5,dp.getJenis_kelamin());
statement.setString(6,dp.getGolongan_darah());
statement.setString(7,dp.getSpesimen());
statement.setString(8,dp.getPengirim());
statement.setString(9,dp.getPemeriksaan());
statement.setDate(10, dp.getTanggal()df.format(getTanggal));
statement.setString(11, dp.getNo_rekam_medik());
statement.executeUpdate();
} catch (SQLException ex) {
System.out.println("error karena" +ex.getMessage());
}finally{
try {
statement.close();
} catch (SQLException ex) {
System.out.println("error karena" +ex.getMessage());
}
}
}