JB9 连 Oracle 时出错

r10k 2004-01-09 06:10:16
程序运行到
rs = stmt.executeQuery("select * from emp");
时 抛出错误
ORA-00600: 内部错误代码,参数: [ttcgcshnd-1], [0], [], [], [], [], [], []
这是什么错误 找了好久 没找出原因。
...全文
23 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
r10k 2004-01-10
  • 打赏
  • 举报
回复
用的是struts
r10k 2004-01-10
  • 打赏
  • 举报
回复
/**
*
* 连接数据库
*
* 方法 getConnection() 和 closeConnection()
*
*/

import oracle.jdbc.driver.*;
import java.io.*;
import java.lang.reflect.Method;
import java.lang.*;
import java.sql.*;
import java.util.*;
import java.net.*;

public class ConnectionDataBaseBean
{
static Connection conn = null;

public ConnectionDataBaseBean()
{
}
/**get oracle connection*/
public static Connection getConnection()
{
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
conn = DriverManager.getConnection(
"jdbc:oracle:thin:@localhost:1521:pdb", "scott", "tiger");
}
catch (ClassNotFoundException errs)
{
System.err.println("ConnectionDataBaseBean.getConnection() ClassNotFoundException:"
+ errs.getMessage());
}
catch (SQLException errs)
{
System.err.println("ConnectionDataBaseBean.getConnection()SQLException:"
+ errs.getMessage());
}
return conn;
}
/**close oracle connection*/
public static void closeConnection()
{
try
{
if (conn != null)
{
conn.close();
}
}
catch (SQLException errs)
{
System.err.println("ConnectionDataBaseBean.closeConnection()SQLException:"
+ errs.getMessage());
}
finally
{
conn = null;
}
}
}


/**
* 用户合法性检测
*
*/


import java.io.*;
import java.lang.*;
import java.sql.*;
import java.util.*;
import org.apache.struts.action.*;
……



public class CheckUserBean {
static Connection conn;
Statement stmt;
ResultSet rs;
private String str_Sql;
private String str_id;
private String str_password;
private String str_identity;
boolean boo_isvalidate=false;
ActionErrors errors = new ActionErrors();

public boolean CheckUserBean(User user)throws Exception {

/** 为了 测试 下面代码 暂时屏蔽掉了
str_id = user.getStr_id();
str_password = user.getStr_password();
str_identity = user.getStr_identity();

if (str_identity.equals("manager"))
{
str_Sql ="select * from emp where empno= '7934'";
System.err.println("db.executeQuery:select * from emp where empno= '7934'");
}
else if(str_identity.equals("student"))
{
str_Sql =
"Select User_Stu_ID,User_PassWord from UserInfo where User_Stu_ID ='"
+str_id + "'and User_PassWord ='" +str_password + "' ";
System.err.println("db.executeQuery:student do ");
}
*/



try {
System.out.println(" succeed into try");
if (conn == null){
//测试用输出
System.out.println(" conn is null init conn …… ……");
conn = ConnectionDataBaseBean.getConnection();}
if (conn != null) {
//测试用输出
System.out.println(" conn inited ");
stmt = conn.createStatement();
//测试用输出
System.out.println("createStatement succeed");
rs = stmt.executeQuery("select * from emp where empno= '7934'");
//测试用输出
System.out.println("EXE: select * from emp where empno= '7934'");
// if (rs.next()) {
boo_isvalidate = true;
//测试用输出
System.out.println(“return in try:" +boo_isvalidate);
// }


}
}
catch (Exception ex) {
System.err.println("db.executeQuery:much time again " + ex.getMessage());
}
//测试用输出
System.out.println(“return:" +boo_isvalidate);
return boo_isvalidate;

}
}


///////////////////////////////////////////////////////
//----------------以下是运行 出错过程————————//
///////////////////////////////////////////////////////

//执行 select * from emp where empno= '7934'

StandardWrapper[:invoker]: Loading container servlet invoker
HttpConnector[8083] Starting background thread
succeed into try
conn is null init conn …… ……
conn inited
createStatement succeed
db.executeQuery:much time again ORA-00600: 内部错误代码,参数: [ttcgcshnd-1], [0], [], [], [], [], [], []
return:false
//PL/SQL运行结果
//==========================================================================
SQL*Plus: Release 9.0.1.0.1 - Production on D??úáù 1?? 10 13:12:09 2004

(c) Copyright 2001 Oracle Corporation. All rights reserved.


á??óμ?:
Oracle9i Enterprise Edition Release 9.0.1.1.1 - Production
With the Partitioning option
JServer Release 9.0.1.1.1 - Production

SQL> select * from emp where empno= '7934';

EMPNO ENAME JOB MGR HIREDATE SAL COMM
---------- ---------- --------- ---------- ---------- ---------- ----------
DEPTNO
----------
7934 MILLER CLERK 7782 23-1?? -82 1300
10

SQL>
//=================================================================================

r10k 2004-01-10
  • 打赏
  • 举报
回复
如果表emp为空 则正常运行
如果emp有记录 有一条 或几条 都出错
rs = stmt.executeQuery("insert ……");
不出错。
大虾们 帮忙解释一下~
谢先

windyxa 2004-01-09
  • 打赏
  • 举报
回复
这个是oracle数据库内部的出错,你找关于这方面的资料看看

50,549

社区成员

发帖
与我相关
我的任务
社区描述
Java相关技术讨论
javaspring bootspring cloud 技术论坛(原bbs)
社区管理员
  • Java相关社区
  • 小虚竹
  • 谙忆
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧