javams-accessjdbcjdbc-odbc

I am Connecting to data Base After Making Jar File in java But "ClassNotFoundException" after making jar file Below is code


Here IS Code Any Suggestions When i am trying to access the data base it shows error after making jar file

   File f = new File("E:\\DB\\**\\***.mdb");
                    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
                    JOptionPane.showMessageDialog(null, "Driver loded succesfully");
                    String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ="+f.getAbsolutePath();
                    connection = DriverManager.getConnection( database ,"",""); 

                    JOptionPane.showMessageDialog(null, "connection is"+connection);

                }catch(Exception e){
                    e.printStackTrace();
                    JOptionPane.showMessageDialog(null,"erroris"+ e);;
                }

Solution

  • Its Only java Compatibility Issue . ODBC connection is not available in new versions of Java . So it work on old version on which i made. Thanks to
    @Gord Thompson