捡
捡垃圾去上网的人
Unregistered / Unconfirmed
GUEST, unregistred user!
package puyue;
import java.sql.*;
import java.io.*;
import java.util.*;
public class accesslink{
private String url="jdbcdbc:driver={microsoft access driver(*.mdb)};dbq=db//puyue.mdb;"+"admin"+"";
private String url1="jdbcdbc:MS Access Database;DBQ=db//puyue.mdb";
ResultSet rec;
public void accesslink()
{
try
{
Class.forName("sun.jdbc.odbc.jdbcOdbcDriver");
}catch(java.lang.ClassNotFoundException e){
System.err.print("类加载错误"+e.getMessage());
}
}
public ResultSet executequery(String strsql)
{
rec=null;
try
{
Connection c=DriverManager.getConnection(url1);
Statement s=c.createStatement();
rec=s.executeQuery(strsql);
}catch(SQLException e)
{
System.err.print("数据库连接错误"+e.getMessage());
}
return rec;
}
}
---------------------------------
提示的错误信息是:suitable driver数据库连接错误N
我想是不是我的db/puyue.mdb 放错地方了
import java.sql.*;
import java.io.*;
import java.util.*;
public class accesslink{
private String url="jdbcdbc:driver={microsoft access driver(*.mdb)};dbq=db//puyue.mdb;"+"admin"+"";
private String url1="jdbcdbc:MS Access Database;DBQ=db//puyue.mdb";
ResultSet rec;
public void accesslink()
{
try
{
Class.forName("sun.jdbc.odbc.jdbcOdbcDriver");
}catch(java.lang.ClassNotFoundException e){
System.err.print("类加载错误"+e.getMessage());
}
}
public ResultSet executequery(String strsql)
{
rec=null;
try
{
Connection c=DriverManager.getConnection(url1);
Statement s=c.createStatement();
rec=s.executeQuery(strsql);
}catch(SQLException e)
{
System.err.print("数据库连接错误"+e.getMessage());
}
return rec;
}
}
---------------------------------
提示的错误信息是:suitable driver数据库连接错误N
我想是不是我的db/puyue.mdb 放错地方了