我认为加载SQL数据库像这样用能够连接起,你那个好像比较复杂样
String sql="select * from 表名";
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:自己建立ODBC数据源的名字","sa"," ");
PreparedStatement pstmt=con.prepareStatement(sql);
ResultSet rs=pstmt.executeQuery();
while(rs.next())
{
out.println(rs.getString(1));
out.println(rs.getString(2));
out.println(rs.getInt(3));
}
}catch(Exception e)
{out.println("df");}%>
String sql="select * from 表名";
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:自己建立ODBC数据源的名字","sa"," ");
PreparedStatement pstmt=con.prepareStatement(sql);
ResultSet rs=pstmt.executeQuery();
while(rs.next())
{
out.println(rs.getString(1));
out.println(rs.getString(2));
out.println(rs.getInt(3));
}
}catch(Exception e)
{out.println("df");}%>