看不懂什么错误 求救 大神帮我看看

来源:2-2 JDBC实战---打通数据库

慕函数3291551

2018-05-22 20:39

<ConnectionProperties>

 <PropertyCategory name="Connection/Authentication">

  <Property name="user" required="No" default="" sortOrder="-2147483647" since="all versions">

    The user to connect as

  </Property>

  <Property name="password" required="No" default="" sortOrder="-2147483646" since="all versions">

    The password to use when connecting

  </Property>

  <Property name="socketFactory" required="No" default="com.mysql.jdbc.StandardSocketFactory" sortOrder="4" since="3.0.3">

    The name of the class that the driver should use for creating socket connections to the server. This class must implement the interface 'com.mysql.jdbc.SocketFactory' and have public no-args constructor.

  </Property>

  <Property name="connectTimeout" required="No" default="0" sortOrder="9" since="3.0.1">

    Timeout for socket connect (in milliseconds), with 0 being no timeout. Only works on JDK-1.4 or newer. Defaults to '0'.

  </Property>

  <Property name="socketTimeout" required="No" default="0" sortOrder="10" since="3.0.1">

    Timeout on network socket operations (0, the default means no timeout).

  </Property>

  <Property name="connectionLifecycleInterceptors" required="No" default="" sortOrder="2147483647" since="5.1.4">

    A comma-delimited list of classes that implement "com.mysql.jdbc.ConnectionLifecycleInterceptor" that should notified of connection lifecycle events (creation, destruction, commit, rollback, setCatalog and setAutoCommit) and potentially alter the execution of these commands. ConnectionLifecycleInterceptors are "stackable", more than one interceptor may be specified via the configuration property as a comma-delimited list, with the interceptors executed in order from left to right.

  </Property>

  <Property name="useConfigs" required="No" default="" sortOrder="2147483647" since="3.1.5">

    Load the comma-delimited list of configuration properties before parsing the URL or applying user-specified properties. These configurations are explained in the 'Configurations' of the documentation.

  </Property>

  <Property name="authenticationPlugins" required="No" default="" sortOrder="alpha" since="5.1.19">

    Comma-delimited list of classes that implement com.mysql.jdbc.AuthenticationPlugin and which will be used for authentication unless disabled by "disabledAuthenticationPlugins" property.

  </Property>

  <Property name="defaultAuthenticationPlugin" required="No" default="com.mysql.jdbc.authentication.MysqlNativePasswordPlugin" sortOrder="alpha" since="5.1.19">

    Name of a class implementing com.mysql.jdbc.AuthenticationPlugin which will be used as the default authentication plugin (see below). It is an error to use a class which is not listed in "authenticationPlugins" nor it is one of the built-in plugins. It is an error to set as default a plugin which was disabled with "disabledAuthenticationPlugins" property. It is an error to set this value to null or the empty string (i.e. there must be at least a valid default authentication plugin specified for the connection, meeting all constraints listed above).

  </Property>

  <Property name="disabledAuthenticationPlugins" required="No" default="" sortOrder="alpha" since="5.1.19">

    Comma-delimited list of classes implementing com.mysql.jdbc.AuthenticationPlugin or mechanisms, i.e. "mysql_native_password". The authentication plugins or mechanisms listed will not be used for authentication which will fail if it requires one of them. It is an error to disable the default authentication plugin (either the one named by "defaultAuthenticationPlugin" property or the hard-coded one if "defaultAuthenticationPlugin" property is not set).

  </Property>

  <Property name="disconnectOnExpiredPasswords" required="No" default="true" sortOrder="alpha" since="5.1.23">

    If "disconnectOnExpiredPasswords" is set to "false" and password is expired then server enters "sandbox" mode and sends ERR(08001, ER_MUST_CHANGE_PASSWORD) for all commands that are not needed to set a new password until a new password is set.

  </Property>

  <Property name="interactiveClient" required="No" default="false" sortOrder="alpha" since="3.1.0">

    Set the CLIENT_INTERACTIVE flag, which tells MySQL to timeout connections based on INTERACTIVE_TIMEOUT instead of WAIT_TIMEOUT

  </Property>

  <Property name="localSocketAddress" required="No" default="" sortOrder="alpha" since="5.0.5">

    Hostname or IP address given to explicitly configure the interface that the driver will bind the client side of the TCP/IP connection to when connecting.

  </Property>

  <Property name="propertiesTransform" required="No" default="" sortOrder="alpha" since="3.1.4">

    An implementation of com.mysql.jdbc.ConnectionPropertiesTransform that the driver will use to modify URL properties passed to the driver before attempting a connection

  </Property>

  <Property name="useCompression" required="No" default="false" sortOrder="alpha" since="3.0.17">

    Use zlib compression when communicating with the server (true/false)? Defaults to 'false'.

  </Property>

 </PropertyCategory>

 <PropertyCategory name="Networking">

  <Property name="maxAllowedPacket" required="No" default="-1" sortOrder="alpha" since="5.1.8">

    Maximum allowed packet size to send to server. If not set, the value of system variable 'max_allowed_packet' will be used to initialize this upon connecting. This value will not take effect if set larger than the value of 'max_allowed_packet'.

  </Property>

  <Property name="tcpKeepAlive" required="No" default="true" sortOrder="alpha" since="5.0.7">

    If connecting using TCP/IP, should the driver set SO_KEEPALIVE?

  </Property>

  <Property name="tcpNoDelay" required="No" default="true" sortOrder="alpha" since="5.0.7">

    If connecting using TCP/IP, should the driver set SO_TCP_NODELAY (disabling the Nagle Algorithm)?

  </Property>

  <Property name="tcpRcvBuf" required="No" default="0" sortOrder="alpha" since="5.0.7">

    If connecting using TCP/IP, should the driver set SO_RCV_BUF to the given value? The default value of '0', means use the platform default value for this property)

  </Property>

  <Property name="tcpSndBuf" required="No" default="0" sortOrder="alpha" since="5.0.7">

    If connecting using TCP/IP, should the driver set SO_SND_BUF to the given value? The default value of '0', means use the platform default value for this property)

  </Property>

  <Property name="tcpTrafficClass" required="No" default="0" sortOrder="alpha" since="5.0.7">

    If connecting using TCP/IP, should the driver set traffic class or type-of-service fields ?See the documentation for java.net.Socket.setTrafficClass() for more information.

  </Property>

 </PropertyCategory>

 <PropertyCategory name="High Availability and Clustering">

  <Property name="autoReconnect" required="No" default="false" sortOrder="0" since="1.1">

    Should the driver try to re-establish stale and/or dead connections? If enabled the driver will throw an exception for a queries issued on a stale or dead connection, which belong to the current transaction, but will attempt reconnect before the next query issued on the connection in a new transaction. The use of this feature is not recommended, because it has side effects related to session state and data consistency when applications don't handle SQLExceptions properly, and is only designed to be used when you are unable to configure your application to handle SQLExceptions resulting from dead and stale connections properly. Alternatively, as a last option, investigate setting the MySQL server variable "wait_timeout" to a high value, rather than the default of 8 hours.

  </Property>

  <Property name="autoReconnectForPools" required="No" default="false" sortOrder="1" since="3.1.3">

    Use a reconnection strategy appropriate for connection pools (defaults to 'false')

  </Property>

  <Property name="failOverReadOnly" required="No" default="true" sortOrder="2" since="3.0.12">

    When failing over in autoReconnect mode, should the connection be set to 'read-only'?

    





我跟这老师的步骤一步步到最后运行程序没有显示  小美  22.给我报出这么大一堆代码 完全不懂什么意思?  代码太多 只截取了一部分! 求大神帮我解答 我百度搜不到。。

写回答 关注

3回答

  • 慕斯2123924
    2018-05-30 12:12:50
    "jdbc:mysql://127.0.0.1:3306/imooc?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC";


  • 慕斯2123924
    2018-05-30 12:10:59

    改成这样试试:

    private static final String URL = "jdbc:mysql://127.0.0.1:3306/imooc?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC";


  • chrome1121
    2018-05-26 17:23:28

    看起来像和连接数据库有关,你的是什么开发工具?什么版本?JDBC是什么版本?数据库是什么版本?

    慕函数329...

    我的数据库是是mysql5.7.22 开发工具是eclipse 4.7.3a JDBC版本是5.1.26

    2018-05-26 18:40:33

    共 1 条回复 >

JDBC之 “ 对岸的女孩看过来”

一起领略JDBC的奥秘,为进一步学习集成框架打下良好的基础

99324 学习 · 856 问题

查看课程

相似问题