facebook

connecting to MSAccess DB

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #253421 Reply

    ahmadiq
    Member

    Hi. I’m new to MyEclipse.

    I’m trying to connect to an MS Access DB (resident on the local machine) through a servlet.

    
    url = "jdbc:odbc:db";
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con = DriverManager.getConnection(url);
    

    however i get :

    java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

    when i deploy it and access it.

    the same url however seems to work fine with DBexplorer.

    do i need to change my code? or do i need to access the table through DBexplorer? if so, how.


    Ahmad

    #253427 Reply

    Haris Peco
    Member

    Ahmad,

    Your code is correct, but driver can’t find alias ‘db’ – What you think that it work in Db Explorer ?

    If it work in Db Explorer then it have to work in yoour example.You have to add user and password, probably and define odbc alias

    However, you can’t work with hibernate and MS Access, because it doesn’t exists dialect

    Best regards

    #253430 Reply

    ahmadiq
    Member

    the issue has been resolved. there was some problem with apache tomcat.

    tomcat is installed as a service and I don’t have administrative rights on the machine. One or both of these reasons need me to manually shutdown and startup the server once. My application runs fine afterwards.

    thankyou for your help.


    Ahmad

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: connecting to MSAccess DB

You must be logged in to post in the forum log in