Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC Driver Type

 
PNS Subramanian
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In typical J2EE application, one similar to petstore, we use a DataSource object to lookup a database and goahead with the transactions. Isn't this a case of Type 3 driver being used ? Since the end-client always accesses the database through the app-server - let me know if otherwise.
 
satish sathineni
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Type 3 drivers are provided with the Application Server only i heard Weblogic gives the type 3 driver along with its application drivers are bundled with the server only....

I dont think ur case comes under Type 3 driver...

Even Type 4 drivers can also used to lookup the database using datasource....

u did not mention the application server name....

I think this should clarify ur doubts....

Satish Kumar
Software Engineer
Hyderabad
 
PNS Subramanian
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The deails of usage are as below
Driver - Sybase Driver - jConnect (comes with Sybase client installation)
AppServer - BEA Weblogic 8.1
Backend - Sybase

Another case
Driver - DB2 UDB - com.ibm.db2.jdbc.app.DB2Driver
AppServer - WebSphere
Backend - DB2 UDB 7.1

Please note, in both the above cases, the end-client calls the AppServer which inturn uses a datasource to lookup and get connection to the backend.
 
Julian Kennedy
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

Please forgive me if this is hopelessly naive but, why would DB access via a DataSource object preclude (or imply) use of any particular type of JDBC driver? All 4 types can be called from Java code at the server side...

Jules
 
Ankur Srivastava
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Julian


Ofcourse all 4 types of drivers can be called from Java code at the server side but DataSource implementation also provides you features like Connection Pooling, Distributed Transaction implementation, So you don't have to worry about that when writing your data access code.

I hope I have answered your question to some extent.

Cheers
Ankur
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic