I get confused with type 2 native API driver, could someone give me a brief explanation about it. Also where can I download a type 2 driver for MySQL?
-
Why? You don't care what type of driver the vendor supplies. I don't think there has even been a native driver for MySQL. Just download the latest MySQLConnector/J.– user207421Feb 12, 2017 at 1:16
-
@ElliotFrisch I am unable to see how a question about a nonexistent MySqQL driver can possibly be a duplicate of a question about Oracle drivers.– user207421Feb 12, 2017 at 1:28
-
As a general rule, you want to go with the driver of the highest type you can get as they are generally more portable. MySQL's Connector/J is a Type 4 driver, meaning it's written entirely in Java.– PowerlordFeb 12, 2017 at 1:55
2 Answers
A type 2 driver converts JDBC calls into native calls of the database API. Kind of a succinct answer, but it's unclear what kind of detail you are looking for.
-
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review– AT82Feb 12, 2017 at 8:47
-
@AJT_82 An answer to the question is exactly what is provided here. Don't review indiscriminately. Feb 12, 2017 at 10:38
-
@EJP I do not review indiscriminately, if so, I wouldn't be allowed to review due to the audits ;) I feel this should be a comment, or then answer the question at hand completely. This is my opinion, luckily my review alone won't determine the fate of this answer. If other reviewers have determined that this answer is a good answer, there should be no problem :)– AT82Feb 12, 2017 at 10:47
-
@AJT_82 You did on this occasion. The question asks what is a type 2 driver, and this post answers it. Your comment is incomprehensible. I can only suggest you delete it. Feb 12, 2017 at 10:49
-
Occasion, what do you mean? Don't understand what's the problem here. As said, other reviewers will determine the fate of this answer, not me alone, so if this is a good answer it will be kept. This came up as a low quality post flagged by someone. I reviewed it and agreed. So if other reviewers feel this a good answer, it will be kept! So there should be no problem at all.– AT82Feb 12, 2017 at 10:54
To quote from the JDBC 4.2 specification:
Type 2 — drivers that are written partly in the Java programming language and partly in native code. These drivers use a native client library specific to the data source to which they connect. Again, because of the native code, their portability is limited.
Other than that their behavior would be exactly the same as a type 4 driver (or a type 1 or type 3, but you rarely see those types).
MySQL has not Type 2 driver, so we can't point you to a download for that.