我刚入门。帮我看看,怎么解决这些错误

ljian_mail 2003-12-12 08:37:51
org.apache.jasper.JasperException: Unable to compile class for JSPF:\tomcat\tomcat\work\localhost_8080\_0002fpage_0002ejsppage_jsp_0.java:81: No variable TYPE_SCROLL_INSENSITIVE defined in interface java.sql.ResultSet.
conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
^
F:\tomcat\tomcat\work\localhost_8080\_0002fpage_0002ejsppage_jsp_0.java:81: No variable CONCUR_UPDATABLE defined in interface java.sql.ResultSet.
conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
^
F:\tomcat\tomcat\work\localhost_8080\_0002fpage_0002ejsppage_jsp_0.java:113: Method last() not found in interface java.sql.ResultSet.
rs.last();
...全文
15 9 打赏 收藏 举报
写回复
9 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
ljian_mail 2003-12-13
问题还没解决,郁闷ing!!!!!!!!!!谁能帮我
  • 打赏
  • 举报
回复
ljian_mail 2003-12-13
哪里可以下新的JDBC,安装后怎样设置
  • 打赏
  • 举报
回复
lixiang823517 2003-12-13
下新的JDBC吧
  • 打赏
  • 举报
回复
ljian_mail 2003-12-13
我的是j2sdk1.4.2_02
  • 打赏
  • 举报
回复
yugona 2003-12-13
是你的jdk版本太旧了吧。去sun下载最新的jdk下来。
  • 打赏
  • 举报
回复
ljian_mail 2003-12-13

代码如下。请帮我看看,为何出现以上错误
~~~~~~~~~~~~~~~~~~~~~~
import java.awt.*;
import java.awt.event.*;
import java.lang.*;
import java.sql.*;
import javax.swing.*;
import javax.swing.tree.*;
import java.util.*;

class Chart extends JFrame {
String strSQL = " select chart_bh,chart_mc from chart " ;
String strOrder = " order by chart_bh ";

/*创建数据库连接*/
static Connection getConn()
{
String strJdbcDriver = "sun.jdbc.odbc.JdbcOdbcDriver";
String strUrl = "";
String strUserName="sa";
String strPassWord="";
String strDataBase="hrdb";
Connection objConn ;
strUrl = "jdbc:odbc:chart";
try{
Class.forName(strJdbcDriver);
//DriverManager.setLoginTimeout(10);
objConn = DriverManager.getConnection(strUrl,strUserName,strPassWord);
return objConn;
}
catch( ClassNotFoundException e ) {return null;}
catch( ClassCastException e ){return null;}
catch( Exception e ) {return null;}
}
/*根据所传入的参数值获得结果集*/
public ResultSet getRs(String strWhere) {
Connection objConn = null ;
Statement objStmt = null ;
ResultSet objRs = null ;
String strTempSql = strSQL + strWhere + strOrder ;

try {
objConn = getConn();
objStmt = objConn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
objRs = objStmt.executeQuery(strTempSql);
}
catch( SQLException e ) {System.err.print(e);return null;}
catch( Exception e ) {System.err.print(e);return null;}
return objRs ;
}
/*实现数据递归处理*/
public void setTreeNode(String strWhere, DefaultMutableTreeNode objPtree) {
ResultSet objNextRs = null ;
DefaultMutableTreeNode objntree ;
String strBh="wa" ;

try {
objNextRs = getRs(strWhere);
strBh="cc";
while(objNextRs.next()) {
strBh="bb";
strBh = objNextRs.getString(1).trim() ;
objPtree.add( objntree = new DefaultMutableTreeNode(objNextRs.getString(2)) );
strWhere = " where chart_bh like '" + strBh + "%' and len(chart_bh) = len('" + strBh + "') + 2 " ;
setTreeNode(strWhere, objntree ) ;

}
objNextRs.close() ;
objNextRs = null ;
}
catch( SQLException e ) {System.err.print(e);System.err.print("11");}
catch( Exception e ) {System.err.print(e);System.err.print("22");}
}
/*应用创建*/
public Chart() {
ResultSet objRs = null;
DefaultMutableTreeNode objtree = null;
DefaultMutableTreeNode objntree = null;
String strWhere = " where chart_js='1' " ;
String strBh ;

try {
//String strBh="aa" ;

objRs = getRs(strWhere);

objtree = new DefaultMutableTreeNode("城市");
// strBh="bb" ;
while(objRs.next())
{
// strBh="cc" ;
strBh = objRs.getString(1).trim();
objtree.add( objntree = new DefaultMutableTreeNode(objRs.getString(2)));
strWhere = " where chart_bh like '" + strBh + "%' and len(chart_bh) = len('" + strBh + "') + 2 " ;
setTreeNode(strWhere,objntree) ;
}
objRs.close();
objRs=null;
}
catch( SQLException e ) {System.err.print(e);System.err.print("111");}
catch( Exception e ) {System.err.print(e);System.err.print("222");}

JTree tree = new JTree(objtree);
JFrame.setDefaultLookAndFeelDecorated(true);
JScrollPane treeScroller = new JScrollPane(tree);

treeScroller.setBackground(tree.getBackground());
setContentPane(treeScroller);
setSize( 400, 400);
}

public static void main(String args[]) {
System.out.println("Starting Chart...");
Chart mainFrame = new Chart();

mainFrame.setSize(400, 400);
mainFrame.setTitle("Chart");
mainFrame.setVisible(true);
}
}
  • 打赏
  • 举报
回复
yangFrame 2003-12-12
是不是把原码贴上来瞧瞧?
  • 打赏
  • 举报
回复
ljian_mail 2003-12-12
请告知下载网址,下载后改装到哪个目录。谢谢
  • 打赏
  • 举报
回复
mor 2003-12-12
faint,好像是JDBC的版本问题,去下个新一点的版本试试
  • 打赏
  • 举报
回复
相关推荐
发帖
Web 开发
加入

8.0w+

社区成员

Java Web 开发
申请成为版主
帖子事件
创建了帖子
2003-12-12 08:37
社区公告
暂无公告