Click to See Complete Forum and Search --> : interaction
annie613
Jun 12th, 2003, 12:15 PM
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
Dillinger4
Jun 13th, 2003, 12:04 AM
Feel the power of the sun. :D
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? :p
annie613
Jun 13th, 2003, 12:04 PM
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)
Dillinger4
Jun 13th, 2003, 12:59 PM
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.
annie613
Jun 13th, 2003, 01:34 PM
thanks i will take a look there
:) annie
ps your new site is cool
i checked it out
nice
CornedBee
Jun 15th, 2003, 04:08 PM
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.
annie613
Jun 16th, 2003, 07:26 AM
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?
CornedBee
Jun 16th, 2003, 07:28 AM
That is it. You only need the JDBC driver then.
annie613
Jun 16th, 2003, 07:32 AM
thanks again :)
CornedBee
Jun 20th, 2003, 06:35 AM
Some things I found:
Notice about JDBC-ODBC bridge 1.2 (http://java.sun.com/products/jdk/1.2/docs/guide/jdbc/bridge.html)
Notice about JDBC-ODBC bridge 1.4.1 (http://java.sun.com/j2se/1.4.1/docs/guide/jdbc/bridge.html)
CornedBee
Jun 20th, 2003, 06:42 AM
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
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.