CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2000
    Posts
    6

    Need a source to learn Java/Access Database Application basics

    I want to start learning how to hook Java up to a database, such as MS-Access, but I'm having trouble finding a good source to simply explain this. Can anyone recommend a good book or on-line turorial. The sun site just leaves me more confused.


  2. #2
    Join Date
    Dec 1999
    Location
    Belgium
    Posts
    8

    Re: Need a source to learn Java/Access Database Application basics

    You can start with the JDBC Database Access trail from Sun, which is located at http://java.sun.com/docs/books/tutor...ics/index.html

    For making a connection to MS Access under NT:

    You have to add the MS Access database in control panel -> odbc
    user DSN -> add
    select Microsoft Access Driver -> finish
    fill in the fields...

    Example Java Source (jdk1.2.2):

    public void makeConnection() throws SQLException, ClassNotFoundException {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    String url = ("jdbcdbcbname");
    //dbname is the name you gave to your database in your control panel
    String username = ("");
    String password = ("");
    Connection con = DriverManager.getConnection(url,username,password);
    }





    "The views expressed herein are the personal views and opinions of the current user and are not made on behalf of his or her current employer."

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured