• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Identifying JDBC driver

 
Sumukh Deshpande
Ranch Hand
Posts: 87
Firefox Browser IntelliJ IDE
  • Mark post as helpful
  • send pies
  • 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.
 
Lester Burnham
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd start with the driver's documentation.
 
Prabhakar Reddy Bokka
Ranch Hand
Posts: 197
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
using above method you can identify.
 
Sumukh Deshpande
Ranch Hand
Posts: 87
Firefox Browser IntelliJ IDE
  • Mark post as helpful
  • send pies
  • 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?
 
Abhishek Ralhan
Ranch Hand
Posts: 40
Chrome Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • 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
Firefox Browser IntelliJ IDE
  • Mark post as helpful
  • send pies
  • 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.
 
Sandeep Sanaboyina
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • 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.
 
Misha Ver
Ranch Hand
Posts: 470
  • Mark post as helpful
  • send pies
  • 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
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
  • Quote
  • Report post to moderator
Christophe Verré wrote:

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 Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • 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
Firefox Browser IntelliJ IDE
  • Mark post as helpful
  • send pies
  • 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
Chrome Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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.

 
Paul Clapham
Sheriff
Pie
Posts: 20725
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic