5 Advanced java tutorial | JDBC | Software Specification | Type 1 Driver | adv java

preview_player
Показать описание
#Advanced java tutorial : #adv java, Understanding the process of developing the s/ws based on s/w specification(Our own)
1) JDBC Specification (Assumption)

public interface MyCOnnection
{
public void makeConection(); //Rule 1
}

public interface Send{
public void sendQuery(String query);
}

Vendor 1(IBM COmpany):

------ developing JDBC Driver for oracle

public class OracleConnection implemests MyConnection
{
public void makeConnection()
{...........
...........
........... logic to establis connection with
Oracale Databse software.
...........

}
}

public class OracleSend implments Send
{
public vouid sendQuery(String query){
----------
logic to send & execute sql query in oracled
database s/w
----------
}
}

Vendor 2 (BossSoft Tech):
------------ gives JDBC driver logic for mysql

public class MySqlCOnnectoin implements MyCOnnection
{
public void makeConnecction(){
---
logic to establish conneciton with mysql db s/w
---
}
}

public class MySqlSend implements Send
{
public void sendQuery(String Qiery){
------
logic to send & execute sql query in mysql db s/w
}
}

Infosys Company(Programmer 1)
-- wants to devlop java application to interact with oracled
--Uses JDBC driver for oracle given by IBM (Vendor 1)

-- Activate jdbc driver for oracle
- call makeConnection() method.
- call sendQuery("select * from student");

TCS Company( Programmer 2)
-Wants to develop java applicatin to interact with mysql db.
-uses JDBC Driver for mysql givern by Boss Soft Tech (Vendor 2)

-- Activate jdbc driver for mysql.
- call makeConnection() method.
- call sendQuery("selecct * from Empployee");

Vendor companies develop jdbc drivers based on JDBC Specifiacaton rules & guidelines given by Sun MicorSystem where as programmer use these JDBC drivers in JAva application to interact with DB s/w.

-Every JDBC Driver is a set of classes implementing various interfaces given by JDBC API package.
In these-- DB S/w

ex- JDBC driver for oracle related classes logic to interact with Oracle DB S/w
- JDBC Driver for mysql related calssed to interact with Mysql DB s/w.

- JDBC Specificaiton is lik e coourse broucher.
- JDBC driver is like Faculty .

-Since all vendor comapanies are giving JDBC Driver based on common jdbc specification, so we can use all the vendor supplied JDBC Driver in our application in a similar manner to talk/interact with database s/ws.

-- Along jdk s/w installation one built in JDBC driver is abailable given by SUn Ms its

-JDBC API of Jdbc specification will be used by vendor comanies as rules & guidelines to develop JDBC drivers.

The same api will be used by prgramer to write jdbc peristence logic in our java application to activate & use JDBC Drivers to interact with db s/w

-Eventhough every jdbc driver contains so many classes but the jdbc driver will be identified with its driver class name.

-By using this driver class name we can activate & use JDBC Driver in our application.

----------- --------------

implements

^
!
! extends
!
^
!
!implements
!

- ODBC driver is identified thorugh its DSN (Data Source Name)

There are 3 types of DSN-

1) User DSN (Specific to currently logged in windows user)
2) System DSN (visible to all the windows users of current/same machine/shytem)
3) Along with windows installation we get ODBC drivers for differnt database s/w.

#PROCEDURE TO CREATE dsn FOR MICROSOFT ODBC DRIVER FOR ORACLE
1) KEEP ORACLE S/W TO BE READY. (INSTALLED IN YOUR MACHINE).
Рекомендации по теме
visit shbcf.ru