Results 1 to 11 of 11

Thread: interaction

  1. #1

    Thread Starter
    Addicted Member annie613's Avatar
    Join Date
    May 2003
    Location
    NY, NY
    Posts
    161

    interaction

    Is there away to have JAVA interact with an MS Access DB?
    I want a user to interact with a JAVA applet, while updating data in a DB?
    Is this possible and how do I make the connection?

    Thanks in advance

  2. #2
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    Feel the power of the sun.

    JDBC technology is an API that lets you access virtually any tabular data source from the Java programming language. It provides cross-DBMS connectivity to a wide range of SQL databases, and now, with the new JDBC API, it also provides access to other tabular data sources, such as spreadsheets or flat files.

    Now don't you feel better?

  3. #3

    Thread Starter
    Addicted Member annie613's Avatar
    Join Date
    May 2003
    Location
    NY, NY
    Posts
    161
    ok i think im confused still
    its not the code that is getting me
    its how to connect
    im really a novice with all this networking
    i have always been able to code, but now more is expected from me
    and i want to do this..

    just to get an idea
    i created a small MS access DB with one table(test) that has two feilds (phone and name) this is hosted on a
    local server here in my office (f:\sys.mdb)

    then i created a project in jbuilder a simple applet
    that has two buttons a send and a clear
    and to textAreas(phone and name)

    all i want to do is run the applet
    type in the fields a phone and a name
    and hit send
    i want to send the data to my MS access DB

    but that is my problem
    i dont know how to set the connection still...

    can anyone help, or are there any articles you may know of that will help me setup this process?

    what import files do i need???
    do i need to add a class or something (i have heard of server or sockets, but im not familiar with them)
    or connect to a port on the local server?

    here is what i have so far , do i need to set a path in this code block somewhere...

    public void actionPerfomred(ActionEvent e)
    {
    if e.getSource()==send)
    {
    //connect to db and pass text for textAreas to database table and feilds
    }//end if - send button

    }end actionPerfomed
    }end applet test


    THANKS AGAIN ANNIE

    ps im running win 95 with access 97 and jbuilder 9
    will this be a problem (and someone else told me to download jdk which i did)

  4. #4
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    To be honest i have yet to do any type of database programming in Java. You can use sockets for data transmission or you could also go with RMI(Remote Method Invocation) which would hide the socket connections and data transfer for you.

    I suggest you go to http://forum.java.sun.com/ Im pretty sure that there is a JDBC forum on that page.

  5. #5

    Thread Starter
    Addicted Member annie613's Avatar
    Join Date
    May 2003
    Location
    NY, NY
    Posts
    161
    thanks i will take a look there

    annie

    ps your new site is cool
    i checked it out
    nice

  6. #6
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    I suggest the ODBC to JDBC connector (available somewhere at Sun's page). It lets your Java program connect with any database you have an ODBC (Open DataBase Connector) driver for. Which is probably the case for Access.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  7. #7

    Thread Starter
    Addicted Member annie613's Avatar
    Join Date
    May 2003
    Location
    NY, NY
    Posts
    161
    does it make a difference that im running WIN 95 and using MS Access 97?

    when i go to start | settings | control panel | ODBC Data Sources |Drivers | , i see a MS Access Driver called odbcj32.dll is this what i need or another file?

  8. #8
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    That is it. You only need the JDBC driver then.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  9. #9

    Thread Starter
    Addicted Member annie613's Avatar
    Join Date
    May 2003
    Location
    NY, NY
    Posts
    161
    thanks again

  10. #10
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  11. #11
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    And I found this:
    . Can the JDBC-ODBC Bridge be used with applets?

    Use of the JDBC-ODBC bridge from an untrusted applet running in a browser, such as Netscape Navigator, isn't allowed. The JDBC-ODBC bridge doesn't allow untrusted code to call it for security reasons. This is good because it means that an untrusted applet that is downloaded by the browser can't circumvent Java security by calling ODBC. Remember that ODBC is native code, so once ODBC is called the Java programming language can't guarantee that a security violation won't occur. On the other hand, Pure Java JDBC drivers work well with applets. They are fully downloadable and do not require any client-side configuration.

    Finally, we would like to note that it is possible to use the JDBC-ODBC bridge with applets that will be run in appletviewer since appletviewer assumes that applets are trusted. In general, it is dangerous to turn applet security off, but it may be appropriate in certain controlled situations, such as for applets that will only be used in a secure intranet environment. Remember to exercise caution if you choose this option, and use an all-Java JDBC driver whenever possible to avoid security problems.

    And this is nice too:
    http://servlet.java.sun.com/products/jdbc/drivers
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

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