#Advanced java tutorial : #adv java Procedure to create a DSN for Microsoft ODBC Driver for Oracle:
1)Keep the Oracle s/w ready (Installed on your computer/system)
2) Make sure that values in the path environment variable are placed as shown below:
my computer-----right clique----- properties----- select advanced tab-------environment Variable-----user/system variables
Dont create same path in user & system variable otherwise it will create problem.
Optimal while working with local/standalone oracle & mandatory ----dsn string should be passed while working with centralized oracle(Sever)
Sun MS has given 5 approached/methodologies/architectures to make vendor companies to develop JDBC drivers based on jdbc specification & guideline, rules.
-The sun Supplied built in JDBC Driver of JDK is Type 1 mechanism based JDBC Driver.
- Type 1 JDBC Driver internally uses native code(the code is used in java but written in C/C++) to interact with ODBC Driver.
- Type 1 Driver can interact with multiple ODBC drivers of different database s.w.
-To use JDBC Driver in our appln it must be registers with DriverManager service.
-Driver manager is basic service available in every java application having the capability to manage JDBC Driver.
-We can access DriverManager service in our appln by using java.sql.DriverManager class.
- To register the jdbc driver the object of jdbc driver class must be placed/aviailable in DriverManager service as shown below:
//create the object of jdbc driver class(Type 1)
sun.jdbc.odbc.JdbcOdbcDriver obj = new sun.jdbc.odbc.JdbcOdbcDriver();
//register jdbc driver with DriverManager service
#Standard stpes to develop JDBC code in Java appln:
1)Register JDBC Driver with DriverManger service.
2)Establish the connection between java application & database sotware.
3)Create JDBC Statement object.
4)Send & execute SQL queries in DB s/w.
5) Gather the result from database s/w & process them in java appln.
6)Close the resourecse(like connecion, stmt)
1 Registering JDBC Driver is nothing but keeping JDCB driver class object in driver manager service.
2) Establishing tje connection i nothing but creating comuunnicatoin channel/bridge/stream between java appln & database s/w.
3) JDBC Statement object is nothing but java appln & database s/w. It carries input(Sql queries) from java appln to databse s/w & it also carries/bring output(given by database s/w) back to java appln.
@. How to develop java application/program without using main(-) method?
# Minimum s/w setup required for Type 1 JDBC Application development:-
1)JDK any(UPTo JDK 1.6)
2)Oracle any version (Oracle 10g)
3)DSN Create for Microsoft ODBC Driver (for like oradsn).
PROTOTYPE OF registerDriver(-), getConnection(-,-,-) method:-
public static void registerDriver(Driver driver) throws SQL Exception *1
public static Connection getConnection(String url,String dbuser,String dbpwd) throws SQLException
*1 -- indicate regsterDriver(-) mthod must be called having implemantation class object of java.sql.Driver(Interface).
*2 --indicates values(generally Connection) of getConneciton(-,-,-) method retuns the implementation class object of java.sql.Connection (Interface).
WHat is protocole:-
Protocol is the set of rules followed by two parties to commnitcate with each other.
Two Types of protocol
1)Application level protocol: Contains rules to get interaction between two s/ws or two s/w specification.
2)Network Level Protocol:
Contains rules to perform interaction b/w two physical computers
DriverManager service uses jdbc:odbc as application level protocol to interact with dataabase s/w using Type 1JDBC driver & ODBC Driver.
I Q. When DriverManager.getConnection("jdbc:odbc:oradsn","scott","boss"); is called?
- Based on given jdbc url the type 1 driver will be activated.
- Based on dsn name (like "oradsn") word of jdbc url the type 1 driver will becomes ready to Microsoft ODBC Driver for Oracle.
-DriverManager service takes the support of Type 1 jdbc driver & odbc driver to establish the connection with Oracle database s.w. In this process the jdbc:odbc protocol will be utilized.
-It returns JDBC connection object representing the connectivity with Oracle DB S.w from java applln
Looking for someone like-minded? Chances are you’ve already got one thing in common.
15,000 New members.
Soulmates sees over 15,000 new faces every month.
#1 Customer service.
Feel safe and secure, with help from our award-winning customer service team.
Recently joined Soulmates.
Meet some of our latest members.
Online Dating Success Stories.
Intrepid explorers who’ve found the person of their dreams.
Kristian & Zoe.
"We met through Soulmates four years ago. Although were both based in London, the chances of us meeting by other means were slim. We just got married! Zoe is the most wonderful woman Ive ever met, and I know we are going to have an extremely happy life together."
Laura & Phil.
"Phil and I got married just over a year after we met on my first ever internet date through Guardian Soulmates. Weve been recommending the site to friends ever since. Thank you!" (Photography credit to Michael OSullivan)
Robin & Alec.
"I just wanted to let you know that you have another success story! My boyfriend, who I met via your site about two years ago, just proposed and we are getting married next year. THANK YOU!"
Alex & Rosie.
"Rosie and I met through Soulmates and were married in October, just 17 months later. Were wonderfully happy together!"
How does it work?
Find your Soulmate in three easy steps.
Register your free account today.