5 Advanced java tutorial | JDBC | Software Specification | Type 1 Driver | adv java
Автор: tech fort
Загружено: 2017-08-03
Просмотров: 1608
Описание:
#Advanced java tutorial : #adv java, Understanding the process of developing the s/ws based on s/w specification(Our own)
1) JDBC Specification (Assumption)
a) MyConnection.java (Interface)
public interface MyCOnnection
{
public void makeConection(); //Rule 1
}
Send.java (Interface)
public interface Send{
public void sendQuery(String query);
}
Vendor 1(IBM COmpany):
------ developing JDBC Driver for oracle
b)OracleConnection.java (class)
public class OracleConnection implemests MyConnection
{
public void makeConnection()
{...........
...........
........... logic to establis connection with
Oracale Databse software.
...........
}
}
OracleSend.java
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
C) MySqlConnection.java (class)
public class MySqlCOnnectoin implements MyCOnnection
{
public void makeConnecction(){
---
logic to establish conneciton with mysql db s/w
---
}
}
--MySqlSend.java (class)
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)
Appl1.java
-- 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)
Appl2.java
-- 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
Java Home-\Program Files\Java\jre1.8.0_121\lib\rt.jar
-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.
the java class that implements java.sql.Driver interface is called as JDBC driver calss.
-By using this driver class name we can activate & use JDBC Driver in our application.
-the jdbc driver class name of JDK supplied built in jdbc driver is sun.jdbc.odbc.JdbcOdbcDriver
----------- --------------
package name driver class name implemetnig java.sql.Driver (interface)
implements
-sun.jdbc.odbc.JdbcOdbcDriver ----------java.sql.Driver
java.sql.Driver (interface)
^
!
! extends
!
sun.jdbc.odbc.JdbcOdbcDriverInterface (interface)
^
!
!implements
!
sun.jdbc.odbc.JdbcOdbcDriver (Class)
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).
Повторяем попытку...

Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: