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?
Asked
Active
Viewed 466 times
-1
-
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. – user207421 Feb 12 '17 at 01: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. – user207421 Feb 12 '17 at 01: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](https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-overview.html), meaning it's written entirely in Java. – Powerlord Feb 12 '17 at 01:55
2 Answers
1
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.

Chris D'Englere
- 406
- 2
- 7
-
This does not provide an answer to the question. Once you have sufficient [reputation](http://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](http://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](http://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/low-quality-posts/15182480) – AT82 Feb 12 '17 at 08:47
-
@AJT_82 An answer to the question is **exactly** what is provided here. Don't review indiscriminately. – user207421 Feb 12 '17 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 :) – AT82 Feb 12 '17 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. – user207421 Feb 12 '17 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. – AT82 Feb 12 '17 at 10:54
-
@AJT_82 The problem is that you reviewed this post indiscriminately, and that you shouldn't do that, and also that you have denied all this several times despite the evidence. You don't appear to have even read the answer, or the question. – user207421 Feb 12 '17 at 10:57
-
To be exact, OP had two questions, this only answers the other one. Therefore the review. And I did not review this indiscriminately. That was the main reason I reviewed it as I did. Answers should be complete, that's the rules. And again, not only me determines the fate of this question, so there should be no problem. – AT82 Feb 12 '17 at 11:00
-
@EJP So please don't tell me that I did not read the question or answer, because that is **exactly** what I did and saw that the answer is not complete ;) – AT82 Feb 12 '17 at 11:08
1
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.

Mark Rotteveel
- 100,966
- 191
- 140
- 197