Results 1 to 3 of 3
  1. #1
    sayan751 is offline Member
    Join Date
    Feb 2009
    Rep Power

    Exclamation DSN less connectivity to Ms ACCESS

    i am doing a small project in Netbeans that add 2 numbers and display the result in a third textbox. all the three values(num1,num2,result) are also get stored in a database. i used dsn less connectivity to connect the database(in Ms Access),but every time i am getting a runtime error.

    the image of my UI is attached.
    DSN less connectivity to Ms ACCESS-ui.jpg
    i am using the following code.

    Java Code:
    float num1,num2,result;
            try {
                String myDB ="jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=numdb.mdb";
                Connection con = DriverManager.getConnection(myDB,"","");
                Statement stmnt=con.createStatement();
                stmnt.executeUpdate("insert into \"add\" values("+num1+","+num2+","+result+")");
            } catch (SQLException ex) {
            } catch (ClassNotFoundException ex) {
    here numdb.mdb resides in the same folder as the source code.
    DSN less connectivity to Ms ACCESS-project.jpg

    every time i am executing my program it is giving following errors:-
    Java Code:
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Could not find file '(unknown)'.
            at sun.jdbc.odbc.JdbcOdbc.createSQLException(
            at sun.jdbc.odbc.JdbcOdbc.standardError(
            at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(
            at sun.jdbc.odbc.JdbcOdbcConnection.initialize(
            at sun.jdbc.odbc.JdbcOdbcDriver.connect(
            at java.sql.DriverManager.getConnection(
            at java.sql.DriverManager.getConnection(
            at my.numberaddition.NumberAdditionUI.jButton2ActionPerformed(
            at my.numberaddition.NumberAdditionUI.access$100(
            at my.numberaddition.NumberAdditionUI$2.actionPerformed(
            at javax.swing.AbstractButton.fireActionPerformed(
            at javax.swing.AbstractButton$Handler.actionPerformed(
            at javax.swing.DefaultButtonModel.fireActionPerformed(
            at javax.swing.DefaultButtonModel.setPressed(
            at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(
            at java.awt.Component.processMouseEvent(
            at javax.swing.JComponent.processMouseEvent(
            at java.awt.Component.processEvent(
            at java.awt.Container.processEvent(
            at java.awt.Component.dispatchEventImpl(
            at java.awt.Container.dispatchEventImpl(
            at java.awt.Component.dispatchEvent(
            at java.awt.LightweightDispatcher.retargetMouseEvent(
            at java.awt.LightweightDispatcher.processMouseEvent(
            at java.awt.LightweightDispatcher.dispatchEvent(
            at java.awt.Container.dispatchEventImpl(
            at java.awt.Window.dispatchEventImpl(
            at java.awt.Component.dispatchEvent(
            at java.awt.EventQueue.dispatchEvent(
            at java.awt.EventDispatchThread.pumpOneEventForFilters(
            at java.awt.EventDispatchThread.pumpEventsForFilter(
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(
            at java.awt.EventDispatchThread.pumpEvents(
            at java.awt.EventDispatchThread.pumpEvents(
    Please help me.
    Last edited by sayan751; 03-27-2009 at 09:08 PM.

  2. #2
    sayan751 is offline Member
    Join Date
    Feb 2009
    Rep Power


    i have also tried to put the database inside the classes folder where my .class files are residing. but it also giving the same error.

    plz help.

  3. #3
    sayan751 is offline Member
    Join Date
    Feb 2009
    Rep Power


    someone plz give me any solution.

    is it always necessary to give the full path where the database resides(for dsn less connectivity)?

    is there no way to make it platform independent?

Similar Threads

  1. Frame connectivity
    By Shivraj in forum NetBeans
    Replies: 1
    Last Post: 03-17-2009, 02:30 PM
  2. database connectivity
    By rilwanfit in forum Networking
    Replies: 1
    Last Post: 03-13-2009, 08:54 PM
  3. sql connectivity
    By prashant in forum JDBC
    Replies: 2
    Last Post: 12-27-2008, 05:05 AM
  4. database connectivity
    By vani in forum Eclipse
    Replies: 0
    Last Post: 11-21-2008, 11:03 AM
  5. Connectivity Test
    By jimhaddon in forum Java Applets
    Replies: 9
    Last Post: 08-16-2008, 05:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts