• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Identifying JDBC driver

 
Ranch Hand
Posts: 87
IntelliJ IDE Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anyone help on how do I make out which type JDBC driver I am using?

I mean to say how can I identify the driver type?

Thanks in advance.
 
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd start with the driver's documentation.
 
Ranch Hand
Posts: 198
Oracle Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
using above method you can identify.
 
Sumukh Deshpande
Ranch Hand
Posts: 87
IntelliJ IDE Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Prabhakar Reddy Bokka wrote: using above method you can identify.



I wrote something like this


and it gave output as:



So I am not getting the exact type here.
Can you help me out?
 
Ranch Hand
Posts: 40
Eclipse IDE Chrome Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why don't you look into driver documentation. I am sure you will get the answer.
Otherwise, this is what I found when i googled, may be you would be interested in:

http://hsqldb.org/doc/src/org/hsqldb/jdbcDriver.html

which says,

int getMajorVersion() Gets the driver's major version number.
int getMinorVersion() Gets the driver's minor version number.

it has two methods to get the versin of your driver.
Is that what you are looking for??
 
Sumukh Deshpande
Ranch Hand
Posts: 87
IntelliJ IDE Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Abhishek Ralhan wrote:Why don't you look into driver documentation. I am sure you will get the answer.
Otherwise, this is what I found when i googled, may be you would be interested in:

http://hsqldb.org/doc/src/org/hsqldb/jdbcDriver.html

which says,

int getMajorVersion() Gets the driver's major version number.
int getMinorVersion() Gets the driver's minor version number.

it has two methods to get the versin of your driver.
Is that what you are looking for??



Abhishek,

I am not looking for versions.
I am looking for TYPE such TYPE I or TYPE II etc.
 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As Lester said, you better start looking at the driver documentation.

I don't think you can identify driver type with java methods.
 
Ranch Hand
Posts: 470
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sumukh Deshpande wrote:
I am not looking for versions.
I am looking for TYPE such TYPE I or TYPE II etc.



Try getDriverName - http://www.hsqldb.org/doc/src/org/hsqldb/jdbc/jdbcDatabaseMetaData.html
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Misha Ver wrote:Try getDriverName - http://www.hsqldb.org/doc/src/org/hsqldb/jdbc/jdbcDatabaseMetaData.html


What makes you think that the Driver type will be included in the Driver name ?
 
Misha Ver
Ranch Hand
Posts: 470
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Christophe Verré wrote:

Misha Ver wrote:Try getDriverName - http://www.hsqldb.org/doc/src/org/hsqldb/jdbc/jdbcDatabaseMetaData.html


What makes you think that the Driver type will be included in the Driver name ?



Where did I say that it will be included? It works for JSQLConnect driver and could work for others too.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Where did I say that it will be included?


Sandeep asks for the Driver Type, and you tell him to use getDriverName.

It works for JSQLConnect driver and could work for others too.


Never assume anything. If the API doesn't tell you what the returned value is, it may be vendor specific.
For your interest, this is what I got with Oracle's driver: "Oracle JDBC driver".
 
Sumukh Deshpande
Ranch Hand
Posts: 87
IntelliJ IDE Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Christophe Verré wrote:

Where did I say that it will be included?


Sandeep asks for the Driver Type, and you tell him to use getDriverName.

It works for JSQLConnect driver and could work for others too.


Never assume anything. If the API doesn't tell you what the returned value is, it may be vendor specific.
For your interest, this is what I got with Oracle's driver: "Oracle JDBC driver".



So does it mean there is no way we cam find out the TYPE programatically?
I have tried my best but didn't get an answer.

 
Abhishek Ralhan
Ranch Hand
Posts: 40
Eclipse IDE Chrome Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, i do not think so.

Why don't you search in the documentation provided with the driver..?
 
Lester Burnham
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Or, to put it another way, what would a piece of code do differently once it knows which type of driver it's using?
 
Misha Ver
Ranch Hand
Posts: 470
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Christophe Verré wrote:

Where did I say that it will be included?


Sandeep asks for the Driver Type, and you tell him to use getDriverName.



I said "try". For me it means it may work and may not.

Christophe Verré wrote:

It works for JSQLConnect driver and could work for others too.


Never assume anything. If the API doesn't tell you what the returned value is, it may be vendor specific.
For your interest, this is what I got with Oracle's driver: "Oracle JDBC driver".



Please don't try to put words in my mouth. Once again, I just said "could work", but I didn't say that it would work in all cases.

 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sumukh Deshpande wrote:So does it mean there is no way we cam find out the TYPE programatically?



Why would you want to do that anyway?
 
reply
    Bookmark Topic Watch Topic
  • New Topic