jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=mysql";Р String user = "sa";Р String psword = "tian";Р Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");//加载驱动Р conn =DriverManager.getConnection(url,user,psword); //连接数据库Р ps = conn.prepareStatement(sql);//用于处理预编译的SQL语句。Р rs=ps.executeQuery(); //把SQL语句发送到数据库中执行,并返回。Р while(rs.next())Р {Р Vector row1 = new Vector();Р row1.add(rs.getString(1));Р row1.add(rs.getString(2));Р row1.add(rs.getString(3));Р row1.add(rs.getInt(4));Р row1.add(rs.getString(5));Р row1.add(rs.getInt(6));Р rowData.add(row1);Р }Р }catch(Exception e)Р {Р e.printStackTrace();Р }Р}Р////////////////////Р@OverrideРpublic int getColumnCount() {Р// TODO Auto-generated method stubРreturn this.columnNames.size(); //查看列有多少元素。Р}Р@OverrideРpublic int getRowCount() {