participate


Swing - Connecting to MS access using JDBC
<<   Back to Forum  |   Give us Feedback
This topic has 23 replies on 2 pages.    1 | 2 | Next »
pallavivajrala
Posts:7
Registered: 9/23/04
Connecting to MS access using JDBC   
Sep 29, 2004 8:21 AM

 
I am working on connecting to MS access using JDBC.
Can somebody tell me how to do it?
How to go about starting from loading driver and registering it !

If somebody has a sample code for the same, It would be great !!! :)
 
Catscratch1
Posts:180
Registered: 7/7/04
Re: Connecting to MS access using JDBC   
Sep 29, 2004 9:22 AM (reply 1 of 23)  (In reply to original post )

 
Well it is quite easy

You must make a connection within the ODBC Driver Manager within Windows.
Then you can access to your database via the jdbc-odbc-bridge:

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver")
 
String url = String url = "jdbc:odbc:" + NameYouDefinedInODBCManager;
Connection db_connection = 
	DriverManager.getConnection (url, user, passw");
 


Now you can handle the whole thing with Statements. For further details read a tutorial.
 
pallavivajrala
Posts:7
Registered: 9/23/04
Re: Connecting to MS access using JDBC   
Sep 29, 2004 9:54 AM (reply 2 of 23)  (In reply to #1 )

 
where can i look for the ODBCManager name in Windows XP ?
 
ravikiran_c
Posts:253
Registered: 11/5/03
Re: Connecting to MS access using JDBC   
Sep 29, 2004 10:39 AM (reply 3 of 23)  (In reply to original post )

 
Hey sorry mis vajrala do you anyone named roopa vajrala or madhavi vajrala? If u do then u should know me. Surprised? Can answer ur question as well.
 
ravikiran_c
Posts:253
Registered: 11/5/03
Re: Connecting to MS access using JDBC   
Sep 29, 2004 10:42 AM (reply 4 of 23)  (In reply to #3 )

 
Go to to performance and maintaince and adminstratiove tools. You should fine data sources there
 
pallavivajrala
Posts:7
Registered: 9/23/04
Re: Connecting to MS access using JDBC   
Sep 29, 2004 10:42 AM (reply 5 of 23)  (In reply to #3 )

 
sorry dont know anyone with those names !
 
ravikiran_c
Posts:253
Registered: 11/5/03
Re: Connecting to MS access using JDBC   
Sep 29, 2004 10:43 AM (reply 6 of 23)  (In reply to #5 )

 
where r u from pallavi? From tenali yaa ? reddys yaa?
 
pallavivajrala
Posts:7
Registered: 9/23/04
Re: Connecting to MS access using JDBC   
Sep 29, 2004 10:45 AM (reply 7 of 23)  (In reply to #6 )

 
nope ! i am from hyd and not a reddy !
 
ravikiran_c
Posts:253
Registered: 11/5/03
Re: Connecting to MS access using JDBC   
Sep 29, 2004 10:46 AM (reply 8 of 23)  (In reply to #7 )

 
Avunaa sorry lendi . Naa vadina peru roopa reddy vajrala? Meruu emi chesutaruu. I work in here in Uk
 
ravikiran_c
Posts:253
Registered: 11/5/03
Re: Connecting to MS access using JDBC   
Sep 29, 2004 10:49 AM (reply 9 of 23)  (In reply to #8 )

 
If u want to know more add mvajrala to your yahoo ID if you ahve any talk to her. I am online on ravikiran2279 on yahoo as well. Keep it touch. Strange though too have vajrala in your name.
 
Anshul_Rampal
Posts:3
Registered: 11/21/04
Re: Connecting to MS access using JDBC   
Nov 21, 2004 10:38 PM (reply 10 of 23)  (In reply to original post )

 
Even I am Trying to figure out because its very tedious to connect to oracle via tomcat using jdbc.
error unable to register the driver
 
satish_01
Posts:39
Registered: 2/10/06
Connecting to MS access using JDBC   
Feb 9, 2006 7:45 PM (reply 11 of 23)  (In reply to #10 )

 
i'm also occuring the same problem for connecting jdbc to the msacess
coz i dont have ODBC driver, whether I need to install a driver separately ,.if it is possible where i can download the ODBC driver plz clarify it

Thank u in advance
 
RahulABhujbal
Posts:1
Registered: 11/30/06
Re: Connecting to MS access using JDBC   
Nov 30, 2006 7:15 AM (reply 12 of 23)  (In reply to original post )

 
hi pallvi, here is ur solution.you just copy down the code below and get connect ur MS Access db to ur java application.


import java.sql.;
import java.util.
;

public class ListOfRegisteredDrivers
{

/ Creates a new instance of ListOfRegisteredDrivers */

public static void main(String s[])
{
//ResultSet rs;
Statement stmt;
Connection con=null;
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}
catch(ClassNotFoundException e)
{
System.out.println(e);
}
try
{
con = DriverManager.getConnection("jdbc:odbc:rahul");
stmt = con.createStatement();
String s1 = "insert into student values(111,'rahul')";
stmt.executeUpdate(s1);

}
catch(SQLException e)
{
System.out.println(e);
}
finally
{
try
{
con.close();
}
catch(SQLException e)
{
System.out.println(e);
}

}

}

}

here "rahul" is DataSourceName i.e. DSN
for any queries u can contact me to rahul_bhujbal2713@yahoo.com
or call me at 9960643447
 
DrewDiggler
Posts:28
Registered: 11/15/06
Re: Connecting to MS Access using JDBC   
Dec 4, 2006 9:44 PM (reply 13 of 23)  (In reply to #12 )

 
Bless you helpful people!
 
Damz@del
Posts:43
Registered: 9/4/06
Re: Connecting to MS Access using JDBC   
Dec 5, 2006 8:59 PM (reply 14 of 23)  (In reply to #13 )

 
Hi Pallavi !!


If you are looking for ODBC manager in Windows Xp..

Go to Control Panel....there you will found ODBC settings...

From there you can select MS-Access as your database...

Thanks,
 
This topic has 23 replies on 2 pages.    1 | 2 | Next »
Back to Forum
 
Read the Developer Forums Code of Conduct

Click to email this message Email this Topic

Edit this Topic
  
 
 
Forums Statistics
    Users Online : 27
  • Guests : 128

About Sun forums
  • Oracle Forums is a large collection of user generated discussions. It is here to help you ask questions, find answers, and participate in discussions.

    Check out our guide on Getting started with Oracle Forums for a full walkthrough of how to best leverage the benefits of this community.

Powered by Jive Forums