突然出现 Class File Editor
Source not found
The source attachment does not contain the source for the file JdbcOdbcDriver.class
You can change the source attachment by clicking Change Attached Source below:然后是一个按钮。
我想说的是,连接数据库是正确的,登录,注册都可以。不知道怎么回事,当操作另一个数据表的时候就出现了这个问题。。我找不出来到底是怎么一回事望高手指导!!!
Source not found
The source attachment does not contain the source for the file JdbcOdbcDriver.class
You can change the source attachment by clicking Change Attached Source below:然后是一个按钮。
我想说的是,连接数据库是正确的,登录,注册都可以。不知道怎么回事,当操作另一个数据表的时候就出现了这个问题。。我找不出来到底是怎么一回事望高手指导!!!
解决方案 »
- 问个简单的问题?
- 关于java读取word完整内容
- 求JSP网络编程技术与实例 电子书(人民邮电出版社 2005-10 )
- form 提交到 哪了,我找不到! 救命呐,在线等
- 帮忙看一下这一页代码那个地方错误了?急求。。。
- Java WEB的测试工具
- 请教怎样让session永不超时?
- 求救:如何从数据库里面读取数据出来直接显示在网页上,而不用在本地生成一个excel文件
- 关于INCLUDE得问题!!!
- 通过网页访问.jsp出现HTTP Status 500 - Unable to compile class for JSP 新手比较急
- 求 page request session application 作用域问题
- 数据库信息加解密
两种情况,一种是你按ctrl跟踪方法的声明,而跟踪的类是第三方的,只有class没有源代码所以会提示这个
第二种是调试时你按stacktrace里面的链接跳转过去的
//定义类成员变量
private long DocumentID;
private String DocumentName;
private long TypeID;
private String Author;
private String Introduction;
private long ViewCount;
private String strSql;
//构造函数,对成员变量进行初始化赋值
public document()
{
this.DocumentID = 0;
this.DocumentName = "";
this.TypeID = 0;
this.Author = "";
this.Introduction = "";
this.ViewCount = 0;
this.strSql = "";
}
//获取DocumentID对应的文档信息,将这些信息赋值给相应的类变量
public boolean init()
{
this.strSql="select * from 'document_info' where DocumentID=";
this.strSql=this.strSql+"'"+this.DocumentID+"'";
try
{
ResultSet rs = super.exeSqlQuery(this.strSql);
if(rs.next())
{
DocumentID=rs.getLong("DocumentID");
DocumentName=rs.getString("DocumentName");
TypeID=rs.getLong("TypeID");
Author=rs.getString("Author");
Introduction=rs.getString("introduction");
return true;
}
else
{
return false;
}
}
catch(Exception ex)
{
return false;
}
}
//获得所有文档信息,返回一个ResultSet对象
public ResultSet show_all_document()
{
this.strSql="select * from 'document_info' order by DocumentName asc";
ResultSet rs=null;
try
{
rs = super.exeSqlQuery(this.strSql);
}
catch(Exception ex)
{
System.out.println(ex.toString());
}
return rs;
}
}这就是那个JavaBean,然后我用页面显示user表的信息时,就能正确显示,但是一这个就不行了。
this.strSql=this.strSql+"'"+this.DocumentID+"'";
这个语句为什么后面要加' '呢
关键是,其实我觉得吧,JavaBean可能也没什么问题,以前是可以用的。不知道怎么搞的后来就不能用了。
所以,我不知道到底是怎么一回事
request.setCharacterEncoding("GBK");
//获取所有用户信息
ResultSet rs=document.show_all_document();
int i=0;
while(rs.next())
{
int DocumentID=rs.getInt("DocumentID");
%>
<tr>
<td width="10" align="center"><%=DocumentID%></td>
<td width="40" align="left"><a href=user_detail.jsp?DocumentID=<%=DocumentID%>
target="_self"><%=rs.getString("DocumentName")%></a></td>
</tr>
<%
}
%>
现在 就是说 while(rs.next())有什么异常???
request.setCharacterEncoding("GBK");
//获取所有用户信息
ResultSet rs=document.show_all_document();
int i=0;
while(rs.next())
{
int DocumentID=rs.getInt("DocumentID");
%>
<tr>
<td width="10" align="center"><%=DocumentID%></td>
<td width="40" align="left"><a href=user_detail.jsp?DocumentID=<%=DocumentID%>
target="_self"><%=rs.getString("DocumentName")%></a></td>
</tr>
<%
}
%>谁能告诉我,,这段代码有什么问题,提示这行while(rs.next())有什么exception抛出~~等~~~急~~~
rs = super.exeSqlQuery(this.strSql);
能不能把Excute_DB的代码也贴出来
public class Execute_DB extends Open_DB {
//数据库连接对象
private Connection dbConn;
private Statement stmt;
private ResultSet rs;
//描述 错误号 0=无错误,-1 有错误
private int errNum;
//error 描述 错误信息
private String errDesc;
//初始化操作
public Execute_DB()
{
dbConn = super.getConn();
stmt = null;
rs = null;
errNum = 0;
errDesc = "";
}
//执行sql 执行语句,主要是执行插入和删除的SQL语句
public boolean exeSql(String strSql)
{
try
{
stmt = dbConn.createStatement();
stmt.executeUpdate(strSql);
stmt.close();
return true;
}
catch(Exception ex)
{
this.errNum = -1;
this.errDesc = ex.toString();
return false;
}
}
//执行 sql 查询语句
public ResultSet exeSqlQuery(String strSql)
{
try
{
stmt =dbConn.createStatement();
rs =stmt.executeQuery(strSql);
}
catch(Exception ex)
{
this.errNum = -1;
this.errDesc = ex.toString();
rs = null;
}
return rs;
}
//获取错误号码
public int getErrNum()
{
return errNum;
}
//获取错误信息
public String gerErrDesc()
{
return errDesc;
}
}