SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmm");
java.util.Date parsedDate = sdf.parse("201212130900");
java.sql.Timestamp timestamp = new java.sql.Timestamp(parsedDate.getTime());
try
{
PreparedStatement pstmt = connection.prepareStatement(
"select count(*) as counter from table1 where table_key > ?");
pstmt.setTimestamp(1,new java.sql.Timestamp(timestamp.getTime()));
ResultSet rs = pstmt.executeQuery();
while(rs.next()){
System.out.println(rs.getInt( 1 ));
}
connection.close();
}
catch(Exception g){
System.err.println(g.getMessage());
}
在输出中我收到一个错误
ORA-01843: 无效的月份。
任何人都可以协助解决上述错误吗?