日期:2014-05-20  浏览次数:20682 次

请教JDBC连Oracle的一个问题?
我连ORACLE的时候,提示这个错误信息:java.sql.SQLException:   ORA-00604:   error   occurred   at   recursive   SQL   level   1   ORA-02248:   invalid   option   for   ALTER   SESSION  
请问是什么问题,应该如何解决?谢谢

源码如下:  

<%@   page   contentType= "text/html;charset=gb2312 "   %>  
<%@   page   import= "java.sql.* "%>  
<%!  
String   DBDRIVER= "oracle.jdbc.driver.OracleDriver ";  
String   DBURL= "jdbc:oracle:thin:@10.101.0.100:1521:ORCL ";  
String   DBUSER= "xym ";  
String   DBPASSWORD= "xie93ym ";  
Connection   conn   =   null;  
Statement   stmt   =   null;  
ResultSet   rs   =   null;  
%>  
<%  
try  
{  
Class.forName(DBDRIVER);  
conn   =   DriverManager.getConnection(DBURL,DBUSER,DBPASSWORD);  
String   sql   =   "Select   a,b   from   test ";  
stmt   =   conn.createStatement();  
rs   =   stmt.executeQuery(sql);  
out.println( " <table   border=1   width=400 ");  
while(rs.next()){  
String   col1   =   rs.getString(1);  
String   col2   =   rs.getString(2);  
out.println( " <tr> <td> "+col1+ " </td> <td> "+col2+ " </td> </tr> ");  
}  
out.println( " </table> ");  
stmt.close();  
conn.close();  
}  
catch(Exception   e)  
{  
out.println(e);  
}  
%>  

 


------解决方案--------------------
个人觉得是数据库的问题,和程序应该没有关系,代码都是对的啦