This topic has
23
replies
on
2
pages.
1
|
2
|
Next »
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 !!! :)
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.
where can i look for the ODBCManager name in Windows XP ?
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.
Go to to performance and maintaince and adminstratiove tools. You should fine data sources there
sorry dont know anyone with those names !
where r u from pallavi? From tenali yaa ? reddys yaa?
nope ! i am from hyd and not a reddy !
Avunaa sorry lendi . Naa vadina peru roopa reddy vajrala? Meruu emi chesutaruu. I work in here in Uk
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.
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
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
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
Bless you helpful people!
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
Email this Topic
Edit this Topic
Site Upgrade
Forums 7.1.8 was deployed Oct 26th. The release consists of minor fixes & a few enhancements.
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.