SimpleDateFormat问题:java.lang.NumberFormatException: For input string: ""
private static SSCLotteryInfo GetInfo(ResultSet rs) {
if (rs == null) {
return null;
}
try {
String SSC_QH = rs.getString("SSC_QH");
String SSC_KJSJ = rs.getString("SSC_KJSJ");
String SSC_KJHM = rs.getString("SSC_KJHM");
byte IS_TKS = rs.getByte("IS_TKS");
byte IS_YKJ = rs.getByte("IS_YKJ");
Date startTime = format.parse(SSC_KJSJ.trim());
SSCLotteryInfo sscinfo = new SSCLotteryInfo(SSC_QH, startTime,
SSC_KJHM, IS_TKS, IS_YKJ);
return sscinfo;
} catch (Exception ex) {
ex.printStackTrace();
Log.getLogger().info(ex);
return null;
}
}
public static SSCLotteryInfo GetLotteryInfo() {
SSCLotteryInfo sscinfo = null;
Connection con = DBCPManager.getInstance().getConnection();
if (con == null) {
return null;
}
synchronized (con) {
String sql = "select * from SSC_Lottery where SSC_KJSJ >'" +
format.format(new Date(new Date().getTime() + 1000)) + "'";
PreparedStatement pstmt = null;
ResultSet rs = null;
try {
pstmt = con.prepareStatement(sql);
rs = pstmt.executeQuery();
if (rs.next()) {
sscinfo = GetInfo(rs);
}
} catch (Exception ex) {
ex.printStackTrace();
Log.getLogger().info(ex);
} finally {
ExecuteSQL.closeAll(rs, pstmt, con);
}
}
return sscinfo;
}
为什么有时会报这样的错误:java.lang.NumberFormatException: For input string: ""