代码如下:
String sql = "insert into article (pid, rootid, title, cont, pdate, isleaf)"
+ "values (0, ?, ?, ?, 2009-2-4, 0)";
PreparedStatement pstmt = conn.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
Statement stmt = conn.createStatement(); pstmt.setInt(1, -1);
pstmt.setString(2, title);
pstmt.setString(3, cont);
pstmt.executeUpdate();
ResultSet rsKey = pstmt.getGeneratedKeys();
rsKey.next();
int key = rsKey.getInt(1);
rsKey.close();错误信息如下:org.apache.jasper.JasperException: An exception occurred processing JSP page /Post.jsp at line 2724: String sql = "insert into article (pid, rootid, title, cont, pdate, isleaf)"
25: + "values (0, ?, ?, ?, 2009-2-4, 0)";
26:
27: PreparedStatement pstmt = conn.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
28: Statement stmt = conn.createStatement();
29:
30: pstmt.setInt(1, -1);
java.lang.AbstractMethodError: com.microsoft.jdbc.sqlserver.SQLServerConnection.prepareStatement(Ljava/lang/String;I)Ljava/sql/PreparedStatement;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货