try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn= DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=D:\\DataBase1.mdb","","");
int id=Integer.parseInt(JOptionPane.showInputDialog("Enter ID"));
String name=JOptionPane.showInputDialog("Enter Name");
String Phone=JOptionPane.showInputDialog("Enter PHone");
String mobile=JOptionPane.showInputDialog("Enter Moblie");
//String sql="insert into friends values "id,'"+home
Statement ss=conn.createStatement();
ss.executeUpdate("insert into friends values("+id+",'"+name+"','"+Phone+"','"+mobile+"')");
Statement s=conn.createStatement();
ResultSet res=s.executeQuery("select*from friends order by id");
while(res.next()){
System.out.println(res.getString(1)+"\t"+res.getString(2)+"\t"+res.getString(3)+"\t"+res.getString(4));
}
}catch(Exception e){
JOptionPane.showMessageDialog(null, e.getMessage());
}
}
が、これは私のコードですが( "java.sql.SQLExceptionを:?? [Microsoft]の[ODBCドライバマネージャ]を???? ??? ???") idontどのような問題が喜んでヘルプ知っている???私はJavaアプリケーションをWindows 7 x64のデータベースに接続する必要がありますか?私はそれ この例外ショー実行時に
ラインで例外が発生ん周りのスペースが必要ですか?接続マネージャー= DriverManager.getConnection( "jdbc:odbc:ドライバー= {Microsoft Accessドライバー(* .mdb、* .accdb)}; DBQ = D:\\ DataBase1.mdb"、 ""、 ""この行の – Ben
: ); –