Mysql JDBC interface programming and mysqlJDBC Interface Programming
The relationship between the JDBC interface driver package version of mysql and the mysql version can be found on the official website. For specific examples, see the following. There is no matching description with the JDBC version.
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.
There are probably the following mappings. You need to check the specific version.
Connector/J 5.1 supports Mysql 4.1, Mysql 5.0, Mysql 5.1, and Mysql 6.0 alpha versions.
Connector/J 5.0 supports MySQL 4.1, MySQL 5.0 servers, and distributed transaction (XA ).
Connector/J 3.1 supports MySQL 4.1, MySQL 5.0 servers, and MySQL 5.0 distributed t distributed transaction (XA) support.
Connector/J 3.0 supports MySQL 3.x or MySQL 4.1.
The following is an example of connecting the jdbc interface to mysql. character encoding is specified 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 ();
}
-----------------
Please refer to the following source for reprinting:
Blog.csdn.net/beiigang