MySQL Programming for JDBC interfaces

Source: Internet
Author: User

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

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.