The relationship between MySQL's JDBC Interface driver package version and MySQL version can be found on the official website, see below, there is no relevant description of JDBC version matching.
Http://dev.mysql.com/doc/relnotes/connector-j/en/news-5-1-34.html
Version 5.1.34 is a maintenance release of the Production 5.1 branch. It is suitable for use with MySQL server versions 5.5, and 5.6.
Probably have the following correspondence, the specific version needs to be specifically checked
Connector/j 5.1 supports MySQL 4.1, MySQL 5.0, MySQL 5.1, MySQL 6.0 alpha versions.
CONNECTOR/J 5.0 supports MySQL 4.1, MySQL 5.0 servers, distributed Transaction (XA).
CONNECTOR/J 3.1 supports MySQL 4.1, MySQL 5.0 servers, MySQL 5.0 except Distributed transaction (XA) support.
CONNECTOR/J 3.0 supports MySQL 3.x or MySQL 4.1.
The following is an example of the JDBC interface connection to MySQL, which specifies the character encoding in the connection string.
try{
Class.forName (Com.mysql.jdbc.Driver);
System.out.println (Success loading Mysql driver!);
String url = "jdbc:mysql://localhost/dbname?user=soft&password=soft1234&useunicode=true& Characterencoding=8859_1 "
Connection conn= drivermanager.getconnection (URL);
}catch (Exception e)
{
System.out.println (Error jdbc to mysql!);
E.printstacktrace ();
}
-----------------
Reprint please specify the source:
Blog.csdn.net/beiigang
MySQL JDBC Interface programming