日期:2014-05-17  浏览次数:21067 次

PreparedStatement pstmt=conn.prepareStatement(sql,Statement.RETURN_GENERATED_KEYS);oracle出现java.sql.SQLException: 不支持的特性的错误,什么原因
 
  
HTTP Status 500 - 

--------------------------------------------

type Exception report

message 

description The server encountered an internal error () that prevented it from fulfilling this request.

exception 

org.apache.jasper.JasperException: An exception occurred processing JSP page /Post.jsp at line 24

21: conn=DriverManager.getConnection(DBURL,DBUSER,DBPASSWORD);
22: conn.setAutoCommit(false);
23: String sql="insert into article values (auto.nextVal,0,-1,?,?,sysdate,0)";
24: PreparedStatement pstmt=conn.prepareStatement(sql,Statement.RETURN_GENERATED_KEYS);
25: pstmt.setString(1,title);
26: pstmt.setString(2,cont);
27: pstmt.executeUpdate();


Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:524)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:417)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


root cause 

javax.servlet.ServletException: java.sql.SQLException: 不支持的特性
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:850)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)
org.apache.jsp.Post_jsp._jspService(Post_jsp.java:144)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


root cause 

java.sql.SQLException: 不支持的特性
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:124)
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:161)
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:226)
oracle.jdbc.driver.DatabaseError.throwUnsupportedFeatureSqlException(DatabaseError.java:536)
oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:2866)
org.apache.jsp.Post_jsp._jspService(Post_jsp.java:81)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


note The full stack trace of the root cause is available in the Apache Tomcat/6.0.13 logs.


--------------------------------------------

Apache Tomcat/6.0.13
 <