我用的是MySQL 数据库,第一次连接成功,能查到结果集,并输出,但是在另外一个工程里用同样的代码,却不能连接,出现了一大串英文,不知是什么错误。我把它贴出来
<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>
      ..................(中间有很多)
" default="true" sortOrder="alpha" since="3.1.9">
    Should the JDBC driver treat the MySQL type "YEAR" as a java.sql.Date, or as a SHORT?
  </Property>
  <Property name="zeroDateTimeBehavior" required="No" default="exception" sortOrder="alpha" since="3.1.4">
    What should happen when the driver encounters DATETIME values that are composed entirely of zeros (used by MySQL to represent invalid dates)? Valid values are "exception", "round" and "convertToNull".
  </Property>
 </PropertyCategory>
</ConnectionProperties>
这到底是什么呢,请指教!!

解决方案 »

  1.   

    连接错误吧!
    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.
      

  2.   

    你的 JDK(工程用的那个) 是哪个版本。
      

  3.   

    什么意思???怎么改,之前都可以的啊,怎么会跳出这个错误的呢。。jdk1.6.0_22
      

  4.   

    我也遇到过这个问题,是你运行时错误了,应该点“java application”运行就没有错误了~~~