JDBC Driver Types 3 and 1 - jdbc

I am new to Java and i´m writing an assesy for school about database connections via JDBC.
Am i getting this right about the driver type 3:
The JDBC Type 3 driver is an all java driver witch calls JDBC Functions and sends them to a middle tier server, where they are transformed in vendor specific native database calls or to ODBC calls, which are then handled by an ODBC driver and sent to the database.
I also read that its possible to transform them to ODBC calls. I assume that this means a JDBC-ODBC-Bridge is used. If that is so, how is it possible to do that, because i read that ODBC drivers need to be installed on the Client and cant be loaded over the network(according to descriptions of driver type 1).
And furthermore, why on earth would anybody use a type 1 driver on Clientside, where you need to install native code and the ODBC driver on the Client machine?
Am I getting something wrong here or is the type 1 driver just an ancient technology which can be found in descriptions of JDBC but noone uses anymore.
Please help me getting the right idea.

http://www.jdbc-tutorial.com/jdbc-driver-types.htm has a good overview of the various JDBC driver types. As you suspected, the type 1 drivers are generally considered a legacy option nowadays.
You can find a good stack overflow reference on the same topic at What is type 1,2,3 or 4 of a JDBC Driver?

Related

What is meant by vendor database library in jdbc concept?

I am learning about JDBC. When I am learning about it, I have come to known we can use 4 drivers. In each of these architecture I find the vendor database libraries in jdbc-odbc bridge driver and also native API calls in other type 3, 4.
I am unable to know about those concepts in the architecture.
So I request anyone to say about those two concepts which deals with the JDBC drivers.
I have referred the below link :
http://www.javatpoint.com/jdbc-driver
Vendor based database libraries means you need to use libraries provided by vendors to connect to database.
For example
You need to use ojdbc6.jar for Oracle , postgresql-9.4.1207.jar for postgresql etc.
Short answer: database is called a vendor database if you interact with it through JDBC using special drivers.
JDBC is an API, which allows you to work with different databases (such as MySQL, PostgreSQL etc.) using the same methods to query and update data in a database. This happens by using special drivers, which are unique for every database. In this case the database you are working with is called a vendor database.

Is there a google supported JDBC driver for BigQuery?

We are looking to access BigQuery through third party sql clients, ex. RazorSql. I came across StarSchema JDBC driver and I could not make it work with Razorsql and on the webpage it says that the project was archived. So, not sure if its supposed to work. Any suggestions?
The error I get when trying to use it with RazoeSql is:
java.io.IOException: toDerInputStream rejects tag type 123
I am using a service account key file for authentication.
This is JDBC url value I use (where "my-poc" is the project id and "MY_POC" is the dataset name):
jdbc:BQDriver:my-poc%3AMY_POC?withServiceAccount=true
Alas, no there isn't a JDBC driver that is officially supported. There is an ODBC driver developed by Simba in conjunction with google (you can download it here for free), and you can use a JDBC to ODBC bridge (although the official one is deprecated in java 8, I believe you can download one from a couple of different folks (here, for example).
Admittedly, this is not a great solution. IMO Google really should provide a JDBC driver, but they do not.
java.io.IOException: toDerInputStream rejects tag type 123
The JDBC driver requires a p12 formatted file instead of the json formatted file.

What is the actual differance between type2 and type 4 driver in Jdbc

I have listened that type 2 driver needs some database library's apis. I cant understand above statement can you explain?
Just a paragraph snippet from this link. Also, visit the helpful link : JDBC Driver and Its Types
Type 2: Requires the DB2 Client is
also installed on the same server as
the JDBC driver because the driver is
simply a front-end to the DB2 Client.
It points to the alias you configured
on the Client for your database,
similar to an ODBC driver.
Type 4:
Connects to the database on server
directly via the hostname/port.
This link describe the difference between the 4 types of driver clearly. You may want to take a look at it.
Type 2 driver is database specific, as said in the article in the above link:
The distinctive characteristic of type 2 jdbc drivers are that Type 2 drivers convert JDBC calls into database-specific calls i.e. this driver is specific to a particular database. Some distinctive characteristic of type 2 jdbc drivers are shown below. Example: Oracle will have oracle native api.
I have listened that type 2 driver
needs some database library's apis.
Yes. Type 2 drivers convert JDBC calls into database-specific calls means this is specific to a particular database. For example- Oracle will have its own oracle native driver API. While the Type 4 uses java networking libraries to communicate directly with the database server.

Where can I find the specifications of the Wire Protocol used by Oracle database server?

I want to write my own Oracle ODBC driver, and wanted to know if the specifications of the Client Driver are published somewhere.
To write an oracle odbc driver all you'd need is to follow the instructions here -
http://msdn.microsoft.com/en-us/library/ms714629(v=VS.85).aspx
I may be misunderstanding the question though - I'm not sure why you'd need the wire protocol - for oracle this would be sqlnet.
hth

Is there any JDBC Type 4 driver for DB2 v6?

Does DB2 UDB v6 supports JDBC Type 4 drivers?
Where can I get that JDBC Type 4 driver?
I think yes but not very sure. As V6 is out of support, most likely you would not be able to get it from IBM. You may want to check internally to see if they have any copies of the drivers. Check the below link for some useful information
http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp

Resources