how to connect java database MS access

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Nov 2007
Posts: 39
Reputation: boyz has a little shameless behaviour in the past 
Solved Threads: 0
boyz boyz is offline Offline
Light Poster

how to connect java database MS access

 
0
  #1
Nov 22nd, 2007
plz give me one example and how to generate Driver of data base
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 2,462
Reputation: zandiago is on a distinguished road 
Solved Threads: 25
Featured Poster
zandiago's Avatar
zandiago zandiago is offline Offline
Nearly a Posting Maven

Re: how to connect java database MS access

 
0
  #2
Nov 22nd, 2007
I shot the sheriff....but I didn't shoot the deputy
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 81
Reputation: lookof2day is an unknown quantity at this point 
Solved Threads: 10
lookof2day lookof2day is offline Offline
Junior Poster in Training

Re: how to connect java database MS access

 
0
  #3
Nov 22nd, 2007
Database drivers (jdbc,odbc,.net...) are provided by database vendors or third party vendors and not generated. JDBC drivers are loaded into the JVM at runtime.

Please refer some books on JDBC Connectivity
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 3
Reputation: muthulakshmil is an unknown quantity at this point 
Solved Threads: 1
muthulakshmil muthulakshmil is offline Offline
Newbie Poster

Re: how to connect java database MS access

 
0
  #4
Nov 23rd, 2007
to connect ms access with java
you have to datasource name

and write this code in ur program

Connection con=null;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbcSN name");
Statement stmt=con.createStatment();
ResultSet rs=stmt.executeQuery("select * from tablename");
while(rs.next())
{
System.out.println(rs.getSting("username"); //here username is the field name
}
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 45
Reputation: 7arouf is an unknown quantity at this point 
Solved Threads: 0
7arouf 7arouf is offline Offline
Light Poster

Re: how to connect java database MS access

 
0
  #5
Nov 27th, 2007
the very first thing you need to do is to go to Control Panel --> adminstrative tools
then select the driver, and then your database

then you can write the code above mentioned in the reply above..
i guess that's pretty much it
oOLebanonOo
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 3
Reputation: varunnanda is an unknown quantity at this point 
Solved Threads: 0
varunnanda varunnanda is offline Offline
Newbie Poster

Re: how to connect java database MS access

 
0
  #6
Jul 26th, 2009
Thanks for the help Guys, but I need to insert values in the database and I am using PreparedStatement to do this, the problem is I have created an applet but I am failed to know where do I need to put the connection or put the PreparedStatement.

For Example :
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Class A extends Applet {
{
public void init()
{
TextField t = new TextField();
Button b = new Button("SubmitRecords");
add(t);
add(b);
}
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Now this code create a simple applet with one textbox and button, I need to use insert statement to send the value of "t" in a field called "Names" in database on clicking the SubmitRecords Button. I am confused with the placement of the PreparedStatement and Connection Objects. Kindly help...!!
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 3
Reputation: varunnanda is an unknown quantity at this point 
Solved Threads: 0
varunnanda varunnanda is offline Offline
Newbie Poster

Re: how to connect java database MS access

 
0
  #7
Jul 28th, 2009
Thanks for the help Guys, but I need to insert values in the database and I am using PreparedStatement to do this, the problem is I have created an applet but I am failed to know where do I need to put the connection or put the PreparedStatement.

For Example :
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Class A extends Applet {
{
public void init()
{
TextField t = new TextField();
Button b = new Button("SubmitRecords");
add(t);
add(b);
}
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Now this code create a simple applet with one textbox and button, I need to use insert statement to send the value of "t" in a field called "Names" in database on clicking the SubmitRecords Button. I am confused with the placement of the PreparedStatement and Connection Objects. Kindly help...!!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC