新手用jbuilder,很简单的问题。

wobensuren 2002-10-16 10:40:59
我写了projector———》application——Designer页设计窗体,在窗体中放入一个JscrollPane 和JtextArea 及一个按钮。在一个按钮里写了:


void jToggleButton1_actionPerformed(ActionEvent e)
{
try
{
Class.forName("com.sybase.jdbc2.jdbc.SybDriver").newInstance();
String url=" jdbc:sybase:Tds:10.68.4.233:5000/test";
String user="sa";
String passwords="";
Connection conn= DriverManager.getConnection(url,user,password);
Statement stmt=conn.CreatStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
Resulset rs=stmt.excuteQuery("select * from test");
String sql;
}
catch (Exception e1)
{}
}
}


却提示:
class Connection not found in class sy_demo.Frame
Variable DriverManager not found in class sy_demo.Frame
class Statement not found in class sy_demo.Frame
Variable Statement not found in class sy_demo.Frame
Variable RusutlSet not found in class sy_demo.Frame
......
...全文
56 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
Anubis 2002-10-16
  • 打赏
  • 举报
回复
还的加上这些........
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.sql.*;
Anubis 2002-10-16
  • 打赏
  • 举报
回复
没有import包的缘故................
hexiaofeng 2002-10-16
  • 打赏
  • 举报
回复
添入import java.sql.*;
wobensuren 2002-10-16
  • 打赏
  • 举报
回复
在 up
wobensuren 2002-10-16
  • 打赏
  • 举报
回复
up

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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