Code:
PreparedStatement i_PreparedStatement = null;
ResultSet i_ResultSet = null;
Connection conn = null;
try {
Class.forName("org.postgresql.Driver");
conn = DriverManager.getConnection("jdbc:postgresql://127.0.0.1:5432/pozajmice" , "sloba", "");
if( conn != null ) {
if (redniBroj.getSelectionEnd() !=0) {
i_PreparedStatement = conn.prepareStatement("UPDATE pozajmice SET datumvrac = LOCALTIMESTAMP(0) WHERE rednibroj ='" +redniBroj.getText() + "' ");
i_PreparedStatement.executeUpdate();
}
else
JOptionPane.showMessageDialog(null, "Morate uneti redni broj!" );
}
conn.close();
}catch (Exception sqlEx) {
sqlEx.printStackTrace();
System.exit(1);
}
prikazMouseClicked(evt);
}
PreparedStatement i_PreparedStatement = null;
ResultSet i_ResultSet = null;
Connection conn = null;
try {
Class.forName("org.postgresql.Driver");
conn = DriverManager.getConnection("jdbc:postgresql://127.0.0.1:5432/pozajmice" , "sloba", "");
if( conn != null ) {
if (redniBroj.getSelectionEnd() !=0) {
i_PreparedStatement = conn.prepareStatement("UPDATE pozajmice SET datumvrac = LOCALTIMESTAMP(0) WHERE rednibroj ='" +redniBroj.getText() + "' ");
i_PreparedStatement.executeUpdate();
}
else
JOptionPane.showMessageDialog(null, "Morate uneti redni broj!" );
}
conn.close();
}catch (Exception sqlEx) {
sqlEx.printStackTrace();
System.exit(1);
}
prikazMouseClicked(evt);
}
Tacnije, ono sto mene interesuje je kako da red u koji je nesto upisano postane setEnable(false);