当前位置: 技术问答>java相关
oracle错误迷惑
来源: 互联网 发布时间:2015-06-10
本文导语: 远程连oracle,同样的代码,在java里面可以,在jsp里面错误(java server 为resin) 错误信息:java.sql.SQLException: ORA-00600: 内部错误代码,参数: [ttcgcshnd-1], [0], [], [], [], [], [], [] test.java代码:(通过并执行成功) import...
远程连oracle,同样的代码,在java里面可以,在jsp里面错误(java server 为resin)
错误信息:java.sql.SQLException: ORA-00600: 内部错误代码,参数: [ttcgcshnd-1], [0], [], [], [], [], [], []
test.java代码:(通过并执行成功)
import java.sql.*;
public class test
{
public static void main (String args []) throws SQLException
{
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:@192.168.0.18:1521:dia2", "netbar", "netbar");
Statement stmt = conn.createStatement ();
ResultSet rset = stmt.executeQuery ("SELECT * from tdesc");
while (rset.next ())
System.out.println (rset.getString (1));
rset.close();
stmt.close();
conn.close();
}
}
test.jsp代码,出现上面的内部代码错误
错误信息:java.sql.SQLException: ORA-00600: 内部错误代码,参数: [ttcgcshnd-1], [0], [], [], [], [], [], []
test.java代码:(通过并执行成功)
import java.sql.*;
public class test
{
public static void main (String args []) throws SQLException
{
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:@192.168.0.18:1521:dia2", "netbar", "netbar");
Statement stmt = conn.createStatement ();
ResultSet rset = stmt.executeQuery ("SELECT * from tdesc");
while (rset.next ())
System.out.println (rset.getString (1));
rset.close();
stmt.close();
conn.close();
}
}
test.jsp代码,出现上面的内部代码错误
|
如果是连9i,估计就是驱动的问题。你的9i驱动得放到jsp引擎的路径中(不是CLASSPATH!),如果用Tomcat4是commonlib。
|
rset.close();
不要关闭!!
不要关闭!!
|
首先,对象的关闭顺序不一样。