...
Code Block | ||
---|---|---|
| ||
private Boolean validateValue(long time) { // Perform validation return true; // If the time is valid } private void storeDateinDB(java.util.Date date) throws SQLException { final java.util.Date copy = (java.util.Date)date.clone(); validateValue(copy.getTime()); Connection con = DriverManager.getConnection(""jdbc:microsoft:sqlserver://<HOST><HOST>:1433","<UID>","<PWD>"","<UID>","<PWD>"); PreparedStatement pstmt = con.prepareStatement(""UPDATE ACCESSDB SET TIME = ?""); pstmt.setLong(1, copy.getTime()); // ... } |
...
Code Block | ||
---|---|---|
| ||
private void storeDateinDB(java.util.Date date) throws SQLException { final java.util.Date copy = new java.util.Date(); validateValue(copy.getTime()); Connection con = DriverManager.getConnection(""jdbc:microsoft:sqlserver://<HOST><HOST>:1433","<UID>","<PWD>"","<UID>","<PWD>"); PreparedStatement pstmt = con.prepareStatement(""UPDATE ACCESSDB SET TIME = ?""); pstmt.setLong(1, copy.getTime()); // ... } |
...
Wiki Markup |
---|
\[[Sterbenz 06|AA. Java References#Sterbenz 06]\] |
...
MET37MET38-J. Do not call overridable methods from a privileged block invoke overridable methods on the clone under construction 12. Methods (MET) MET35-J. Ensure that the clone method calls super.clone 13. Exceptional Behavior (EXC)