灰
灰色轨迹
Unregistered / Unconfirmed
GUEST, unregistred user!
错误提示如下:
java.sql.SQLException: [Microsoft][ODBC Microsoft Access 驱动程序] 参数不足,期待是 1
访问代码如下:
String url=new String();
url="jdbcdbc:derek";
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection(url,"","");
Statement stmt=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
String sql=new String();
sql="SELECT * FROM user WHERE user='"+name+"'";
ResultSet rs=stmt.executeQuery(sql);
if(rs!=null){
while(rs.next()){
System.out.println("/t"+rs.getString("name"));
}
rs.close();
con.close();
}
}catch(Exception e){
out.print(e);
}
//derek是我用odbc定义的一个数据源,错在哪里?
java.sql.SQLException: [Microsoft][ODBC Microsoft Access 驱动程序] 参数不足,期待是 1
访问代码如下:
String url=new String();
url="jdbcdbc:derek";
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection(url,"","");
Statement stmt=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
String sql=new String();
sql="SELECT * FROM user WHERE user='"+name+"'";
ResultSet rs=stmt.executeQuery(sql);
if(rs!=null){
while(rs.next()){
System.out.println("/t"+rs.getString("name"));
}
rs.close();
con.close();
}
}catch(Exception e){
out.print(e);
}
//derek是我用odbc定义的一个数据源,错在哪里?