显示数据库中的students表   就是不行啊,不晓得什么问题~~~~~~
package com.stu;
import java.awt.*;
import java.sql.*;
import javax.swing.*;
import java.util.*;
import java.awt.Event;public class Test1 extends JFrame{
     
    //创建组件
Vector rowData,columName;
JTable jt=null;
JScrollPane jsp=null;

//定义数据库需要的组件
Connection ct=null;
    PreparedStatement ps=null;
    ResultSet rs=null;

public static void main(String[] args) {
Test1 test=new Test1(); }

//构造函数
public Test1(){
columName=new Vector();


//设置列名

columName.add("学号");
columName.add("姓名");
columName.add("性别");
columName.add("年龄");
columName.add("院系");
columName.add("籍贯");

rowData=new Vector();

//连接数据库
try {
//加载驱动


Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");

//得到连接
ct=DriverManager.getConnection("jdbc:microsoft:sqlserver://127.0.0.1:1433;databaseName=students");
ps=ct.prepareStatement("select * from stu");

//执行
rs=ps.executeQuery();

//显示
while(rs.next()){
//定义行向量
Vector hang=new Vector();
//取得数据
hang.add(rs.getString(1));
hang.add(rs.getString(2));
hang.add(rs.getString(3));
hang.add(rs.getInt(4));
hang.add(rs.getString(5));
hang.add(rs.getString(6));

//将hang添加到rowdata
rowData.add(hang);


}

} catch (Exception e) {
       e.printStackTrace();
}
finally{
//关闭资源
try {
if(rs!=null){
rs.close();
}
if(ps!=null){
ps.close();
}
if(ct!=null){
ct.close();
}
} catch (Exception e2) {
e2.printStackTrace();
}
}

//添加组件
jt=new JTable(rowData,columName);
jsp=new JScrollPane(jt);

this.add(jsp);
//显示
this.setSize(400,300);
this.setLocation(400, 300);
this.setVisible(true);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

}}
然后运行就这样。。
JavaSQL异常