Java applications cannot directly communicate with a database to submit and retrieve the results of queries.this is because dbms/rdbms can understand only SQL statements and not java language statements .hence you need a mechanism to transalate java statements to SQL statements. JDBC API uses a driver to address these issues .JDBC API takes care of converting java commands to generic SQL statements . There are several categories of jdbc drivers provided by different database vendors .They are 1.JDBC-ODBC bridge driver:there are several DBMS/RDBMS, such as MS acess and SQL server that contain the ODBC driver embedded into them.since the ODBC API is written in the Clanguage and makes use of ponters and other constructs that java does not support ,a java program cannot directly communicate with an ODBC driver.The JDBC-ODBC bridge driver transalates the JDBC API to the ODBC API 2.Native API partly java driver: some DBMS/RDBMS,such as DB2and Informix,contail a JDBC driver supplied by the database vendor.JDBC drivers consist of classes that the JDBC API can invoke directly. 3.NATIVE protocal pure java driver/JDBC-net pure java driver: these drivers are used to connect a client application or applet to a database over a TCP/IP connection 4.JDBC DRIVer MANAGER 5.JDBC-ODBC Bridge &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& What are the main differences of available four drivers? The differences among 4 types of drivers are as given below:- Type 1: JDBC-ODBC Bridge Type 2: Native-API/partly Java driver Type 3: Net-protocol/all-Java driver Type 4 Pure Java Driver |
Asynchronous Communication Advantages: Requests need not be targeted to specific server. Service need not be available when request is made. No blocking, so resources could be freed. Could use connectionless protocol Disadvantages: Response times are unpredictable. Error handling usually more complex. Usually requires connection-oriented protocol. Harder to design apps Synchronous Communication Advantages: Easy to program Outcome is known immediately Error recovery easier (usually) Better real-time response (usually) Disadvantages: Service must be up and ready. Requestor blocks, held resources are “tied up”. Usually requires connection-oriented protocol
Comments
Post a Comment