I noticed that JDBC has different Drivers like:
- Type 1 Driver
- Type 2 Driver etc.. to Type 4
Why did they get the name like Type 1, Type 2 etc.? Is there any logic?
I noticed that JDBC has different Drivers like:
Why did they get the name like Type 1, Type 2 etc.? Is there any logic?
I believe it goes back to Sun's original (1997) intro to JDBC:
Note that they didn't actually name them Type 1, 2, 3 and 4, but rather JDBC-ODBC bridge plus ODBC driver, Native-API partly-Java driver, JDBC-Net pure Java driver, and Native-protocol pure Java driver. Each name was a mouthful, so people immediately started referring to them by their number instead.
The numbers aren't very informative. I find it more useful to think of it along the lines of:
I could never remember the numbers, but when someone said "we use a type-4 driver here", I could ask two yes-no questions to know what they were talking about.
http://en.wikipedia.org/wiki/JDBC_driver
Does not seem to be any logic, just plain laziness I guess!
UPDATE: The question was whether there was some logic to calling it type 1, type 2 etc instead of calling type apple, type orange :). I understand that the driver types are different and work/not work based on circumstances, but why the name "Type 1" instead of "Type JDBC-ODBC" or "Type JO" has no reason AFAIK.
In short, each Type uses a different strategy and works better for different types of implementations. I don't think it was laziness. I think it was to be able to more easily and clearly pick out which Type is best for your particular situation.
The type number tells something about how the driver actually communicates with the database.
In general (just by coincidence), how higher the type number, how better the JDBC driver performs.