|
How to establish a Database
connection between java application and Database?
If we want to establish a connection between java application and the database we will the following piece of code. Connection con= DriverManager.getConnection(“jdbc:odbc:nag”,”nag”,”system”,”manager”);
Basically Connection is an interface, how getConnection() will create an object for Connection interface? Ans:
Note:-
Eg: interface I
getConnection(_) is a static method from DriverManager class, which will call internally connect() method, this connect() will establish a virtual socket connection in between the java application and the database. |
|
See also
Do you have a Java Problem?
Java Books
Return to : Java Programming Hints and Tips All the site contents are Copyright © www.erpgreat.com
and the content authors. All rights reserved.
|