突然出现 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:然后是一个按钮。
我想说的是,连接数据库是正确的,登录,注册都可以。不知道怎么回事,当操作另一个数据表的时候就出现了这个问题。。我找不出来到底是怎么一回事望高手指导!!!
解决方案 »
- String literal is not properly closed by a double-quote
- struts问题
- 我启动了jboss 5之后,然后打开我的页面,出现输入用户名和密码的窗口,奇怪
- 散分,兄弟自己建立了一个增值业务的BBS,欢迎大家去捧捧场
- 按时间锁定数据库纪录
- 最简单的JSP居然有错,我快疯了·
- String Date之间的转换?谢谢各位高手!
- tomcat
- jdk1.3+tomcat3.2+IIS5.0运行一个access的jsp论坛出现的classpath的问题
- 能否用telnet登陆服务器上的oracle,并且在某一数据库上建表,做SQL操作,不知可否?!
- 求 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;
}
}