Java DB Connection

Closed
lakshmianand Posts 1 Registration date Tuesday November 6, 2012 Status Member Last seen November 6, 2012 - Nov 6, 2012 at 10:39 PM
Hello,

I connect MSAccess DB for JAVA. While I doing that i get 1error message. That is

"java.sql.SQLException: [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application"

Here is Coding for that


import java.sql.*;


public class dbaccess1
{
public static void main(String args[])
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("Jdbc:Odbc:data1","","");
String sql="insert into inserttable values('123','sdsf')";

Statement s=con.createStatement();
s.executeUpdate(sql);
System.out.println("Inserted");
s.close();
con.close();


}

catch(Exception e)
{
System.err.println(e);


}

}


}



And I have windows 7 64bit OS. The Default ODBC driver have not "Microsoft Access Driver(*.mdb)". so i go to contol panel-->Administrative tools-->DataSource(ODBC)--> Right click-->Properties-->shortcut tab-->path="-----windows-->SysWOW64-->odbcad32"
and select (*.mdb").


so please give anything about that..........

thanks