Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2004
    Posts
    6

    Unanswered: How to connect to MS Access?

    Hi~

    I am rather new at Java so please forgive my ignorance.
    I am trying to make a program that will connect to an MS Access Database. However, I am clueless as to where to begin even.

    I tried searching in various forums, at the Sun site and Google. However, I only ended up getting more and more confused.

    I'd greatly appreciate it if someone could get me started in the right direction. A good tutorial or a code sample would be nice.

    Thank you~

  2. #2
    Join Date
    Jan 2004
    Location
    BC - It's the place to be.
    Posts
    13

    Re: How to connect to MS Access?

    I am rather new at Java so please forgive my ignorance.
    I am trying to make a program that will connect to an MS Access Database. However, I am clueless as to where to begin even.

    >>>

    This would involve some JDBC know how and some familiarity with ODBC (the JDBC-ODBC bridge). You will need to go thru the DriverManager class using something like:

    jdbc:odbc://host:port/databasename

    Check first if your MS Access db has been registered using ODBC in the Start/Settings/Control Panel menu. I'm assuming you're using Win9x.

    A good reference would be Flannagan, D. Java Enterprise in a Nutshell. O'Reilly. There is a whole chap devoted to JDBC, and it's simple too.

    Good luck.

  3. #3
    Join Date
    Apr 2003
    Posts
    5
    killerkooki, here u go......

    //Connect to ODBC database
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    String url = "jdbc:odbc:Employees";
    //Connect
    Connection con = DriverManager.getConnection(url,"dba", "sql");
    //Create Statement object
    Statement stmt = con.createStatement();

    For more information, follow this link
    -->http://java.sun.com/docs/books/tutorial/jdbc/TOC.html

    HTH

  4. #4
    Join Date
    Jan 2004
    Posts
    6
    Thank you for your replies. I managed to get a couple of books as well. Hopefully with all of these, I can get going.

Posting Permissions

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