MySQL Connector to J 8.0 q&a

Source: Internet
Author: User
Tags mysql version

Connection Q:driver/datasource Class Name

A:
? Low version: Com.mysql.jdbc.Driver
? High version (5.7+): Com.mysql.cj.jdbc.Driver
?

Q:connection URL Syntax

A:
This is the generic format of the connection URL:

    protocol//[hosts][/database][?properties]

For example:

    jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf8&useSSL=true&serverTimezone=GMT%2B8

Note: Use Tomcat to open a server (port 3306), database name test, properties using ' & ' delimited
?
?

Properties Q:using Character Sets and Unicode

A:
The character encoding between client and server is automatically detected upon connection. You must specify the encoding in server using the URL to connect database.
For example, the to user UTF-8 Chatacter sets with connector/j. You can using the "Characterencoding=utf8" to config your connector/j.


?

q:connecting securely Using SSL

A:
The Ssl:secure Socket Layer is designed to secure data transmission over the Internet, using data encryption (encryption) technology to ensure that it is not intercepted and tapped during transmission over the network.
For example:

    useSSL=true or useSSL=false

?

Q: Using the JDBC driver for time zone-raised issues

A:
1. Lower MySQL version (below 5.6)
2. Add Servertimezone=utc or GMT, if you specify to use the gmt+8 time zone, you need to write as GMT%2B8, otherwise you may resolve to null.

MySQL Connector to J 8.0 q&a

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.