943,947 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 55721
  • Java RSS
Nov 22nd, 2007
1

how to connect java database MS access

Expand Post »
plz give me one example and how to generate Driver of data base
Similar Threads
Reputation Points: 2
Solved Threads: 0
Light Poster
boyz is offline Offline
39 posts
since Nov 2007
Nov 22nd, 2007
-1

Re: how to connect java database MS access

Featured Poster
Reputation Points: 129
Solved Threads: 26
Nearly a Posting Maven
zandiago is offline Offline
2,463 posts
since Jun 2007
Nov 22nd, 2007
0

Re: how to connect java database MS access

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
Reputation Points: 16
Solved Threads: 11
Junior Poster in Training
lookof2day is offline Offline
83 posts
since Aug 2007
Nov 23rd, 2007
0

Re: how to connect java database MS access

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
}
Reputation Points: 10
Solved Threads: 1
Newbie Poster
muthulakshmil is offline Offline
3 posts
since Feb 2007
Nov 27th, 2007
0

Re: how to connect java database MS access

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
Reputation Points: 10
Solved Threads: 0
Light Poster
7arouf is offline Offline
45 posts
since Apr 2007
Jul 26th, 2009
0

Re: how to connect java database MS access

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...!!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
varunnanda is offline Offline
4 posts
since Jul 2009
Jul 28th, 2009
0

Re: how to connect java database MS access

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...!!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
varunnanda is offline Offline
4 posts
since Jul 2009
Mar 29th, 2010
0

Connecting to database, embedding SQL

Check this link ( <URL SNIPPED> ) for a reply to your question. Here you will find detailed description of how to connect to a SQL server database from a Java database application and pass embedded SQL queries. It describes how to create the connection string, pass parameters to the embedded SQL queries and stored procedures.

<FAKE SIGNATURE>
Last edited by peter_budo; Mar 29th, 2010 at 7:00 am. Reason: Keep It On The Site - No fake signatures, no links to external website without posting content
Reputation Points: 12
Solved Threads: 2
Newbie Poster
SNK111 is offline Offline
7 posts
since Mar 2010
Mar 29th, 2010
0
Re: how to connect java database MS access
Thanks you very much, I am oblized.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
varunnanda is offline Offline
4 posts
since Jul 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
This thread is currently closed and is not accepting any new replies.
Previous Thread in Java Forum Timeline: Please help with this recursions
Next Thread in Java Forum Timeline: can u help me





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC