PreparedStatement s = conn.prepareStatement("select sysdate from al"); ResultSet rs = s.executeQuery(); Date d = null; while (rs.next()) { d = rs.getDate(1); }追问嗯,谢谢,但是查出来的只有日期部分,怎么才能带时分秒呢?
追答DateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); // try and try log.info(df.format(d));