Mysql JDBC interface programming and mysqlJDBC Interface Programming

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.