6:22 PM JDBC connection to MS Access database or Oracle database using Java Program. | ||||||||||||
Hello Engineers, I have seen candidates struggling a lot while making a first time connection to a database(Oracle, MS access etc) using Java or any other front end technology. That is why I have added this article to make it simple and fast. In this article we will learm how to connect to MS access database(*.accdb, *.mdb) using java program. Before conneting to MS access database, you need to create data source in Control panel. Follow this llink to create data source in Control Panel >>Administrative Tools for MS access database. Once the data source is created, we will move to the coding part. Here I am presenting the least and simplest code to connect to MS Access database. We will try to understand the code step by step.
The output is: 1 shankar kumar 2 sagar raut 3 priyanka das Now, we shall see the JDBC connectivity between front end Java and back end as Oracle database. Here shankar is the data source name. Similarly, you will have to create a data source for Oracle database. It is similar to Follow this llink to create data source in Control Panel >>Administrative Tools for MS access database Only differece is you have to select driver as "Microsoft ODBC for Oracle" and click on Finish. Then enter data source name, give username, password additionally. Click here to learn how to create data source for driver MS ODBC Oracle Here we are using Oracle 9i as back end. Here if you notice, the only differece is in connection string. The format of connection string is: Connection con = DriverManager.getConnection(Url as string,username as string,password as string); Here the url used is : jdbc:odbc:shankar
| ||||||||||||
|
Related blogs
You may also like to see:
[2014-02-05] | [Technical Solution] |
How do we use FTP from command line to send and receive files |
[2024-03-27] | [Technical Solution] |
How to discuss on Performance Appraisal with your manager? 10 Points to help you get a better hike |
[2014-01-17] | [Technical Solution] |
How to root a samsung phone? Model Samsung Galaxy y s-5360 |
[2015-02-09] | [Technical Solution] |
Soving Rubik's Cube Second layer: Layered approach by Shanky |
[2014-11-28] | [Technical Solution] |
Problem Step Recorder(PSR). How to use it? |
Total comments: 0 | |