Java Can';将MySQL连接器/J与JDK1.7兼容

Java Can';将MySQL连接器/J与JDK1.7兼容,java,mysql,jdbc,ant,Java,Mysql,Jdbc,Ant,我修改了MySQL连接器/J,在修改中使用了2个JAR(构建于JDK1.7之上)。 当我尝试使用ANT build构建jdbc时,我遇到了以下错误,我认为发生此错误是因为JDK1.7中在jdbc的接口上添加了新方法,并且在与泛型语法()的兼容性方面存在一些问题,请给出如何使用JDK1.7构建此jdbc的建议: clean: [delete] Deleting directory C:\Users\osbieh\Desktop\JDBC-Test\MySql_JDBC_OLD\build -in

我修改了MySQL连接器/J,在修改中使用了2个JAR(构建于JDK1.7之上)。 当我尝试使用ANT build构建jdbc时,我遇到了以下错误,我认为发生此错误是因为JDK1.7中在jdbc的接口上添加了新方法,并且在与泛型语法()的兼容性方面存在一些问题,请给出如何使用JDK1.7构建此jdbc的建议:

clean:
[delete] Deleting directory C:\Users\osbieh\Desktop\JDBC-Test\MySql_JDBC_OLD\build

-init-copy:
[mkdir] Created dir: C:\Users\osbieh\Desktop\JDBC-Test\MySql_JDBC_OLD\build
 [exec] Execute failed: java.io.IOException: Cannot run program "svn": CreateProcess error=2, The system cannot find the file specified
 [copy] Copying 235 files to C:\Users\osbieh\Desktop\JDBC-Test\MySql_JDBC_OLD\build\mysql-connector-java-5.1.6
 [copy] Copied 33 empty directories to 3 empty directories under C:\Users\osbieh\Desktop\JDBC-Test\MySql_JDBC_OLD\build\mysql-connector-java-5.1.6
 [copy] Copying 15 files to C:\Users\osbieh\Desktop\JDBC-Test\MySql_JDBC_OLD\build\mysql-connector-java-5.1.6
-init-no-crypto:

init:
[mkdir] Created dir: C:\Users\osbieh\Desktop\JDBC-Test\MySql_JDBC_OLD\build\mysql-connector-java-5.1.6\lib-nodist

-clean-output:
compile-driver-jdbc3:
[javac] C:\Users\osbieh\Desktop\JDBC-Test\MySql_JDBC_OLD\build.xml:724: warning:'includeantruntime' was not set, defaulting to build.sysclasspath=last; setto false for repeatable builds
[javac] Compiling 132 source files to C:\Users\osbieh\Desktop\JDBC-Test\MySql_JDBC_OL\build\mysql-connector-java-5.1.6
[javac] C:\Users\osbieh\Desktop\JDBC-Test\MySql_JDBC_OLD\build\mysql-connectorjava-5.1.6\com\mysql\jdbc\LoadBalancingConnectionProxy.java:413: warning: non
-varargs call of varargs method with inexact argument type for last parameter;
[javac]                             return ((Long) getLocalTimeMethod.invoke(null, null))
[javac]
   ^
[javac]   cast to Object for a varargs call
[javac]   cast to Object[] for a non-varargs call and to suppress this warning
[javac] C:\Users\osbieh\Desktop\JDBC-Test\MySql_JDBC_OLD\build\mysql-connector-java-5.1.6\com\mysql\jdbc\StatementImpl.java:65: error: StatementImpl is notabstract and does not override abstract method isCloseOnCompletion() in Statement
[javac] public class StatementImpl implements Statement {
[javac]        ^
[javac] C:\Users\osbieh\Desktop\JDBC-Test\MySql_JDBC_OLD\build\mysql-connector-java-5.1.6\com\mysql\jdbc\PreparedStatement.java:85: error: com.mysql.jdbc.PreparedStatement is not abstract and does not override abstract methodsetSQLXML(int,SQLXML) in java.sql.PreparedStatement
[javac] public class PreparedStatement extends com.mysql.jdbc.StatementImpl
implements
[javac]        ^
[javac] C:\Users\osbieh\Desktop\JDBC-Test\MySql_JDBC_OLD\build\mysql-connector-java-5.1.6\com\mysql\jdbc\ConnectionImpl.java:74: error: ConnectionImpl is not abstract and does not override abstract method getNetworkTimeout() in Connection
[javac] public class ConnectionImpl extends ConnectionPropertiesImpl implements
[javac]        ^
[javac] C:\Users\osbieh\Desktop\JDBC-Test\MySql_JDBC_OLD\build\mysql-connector-java-5.1.6\com\mysql\jdbc\CallableStatement.java:55: error: com.mysql.jdbc.CallableStatement is not abstract and does not override abstract method<T>getObject(String,Class<T>) in java.sql.CallableStatement
[javac] public class CallableStatement extends PreparedStatement implements
[javac]        ^
[javac]   where T is a type-variable:
[javac]     T extends Object declared in method <T>getObject(String,Class<T>)
[javac] C:\Users\osbieh\Desktop\JDBC-Test\MySql_JDBC_OLD\build\mysql-connectorjava-5.1.6\com\mysql\jdbc\ResultSetImpl.java:120: error: ResultSetImpl is notabstract and doesnot override abstract method <T>getObject(String,Class<T>) inResultSet
[javac] public class ResultSetImpl implements ResultSetInternalMethods {
[javac]        ^
[javac]   where T is a type-variable:
[javac]     T extends Object declared in method <T>getObject(String,Class<T>)
[javac] C:\Users\osbieh\Desktop\JDBC-Test\MySql_JDBC_OLD\build\mysql-connectorjava5.1.6\com\mysql\jdbc\DatabaseMetaData.java:64: error: com.mysql.jdbc.DatabaseMetaData is notabstract and does not override abstract method generatedKeyAlwaysReturned() in java.sql.DatabaseMetaData
[javac] public class DatabaseMetaData implements java.sql.DatabaseMetaData {

[javac]        ^
[javac] C:\Users\osbieh\Desktop\JDBC-Test\MySql_JDBC_OLD\build\mysql-connector-java-5.1.6\com\mysql\jdbc\NonRegisteringDriver.java:67: error: NonRegistering
Driver is not abstract and does not override abstract method getParentLogger() in Driver
[javac] public class NonRegisteringDriver implements java.sql.Driver {
[javac]        ^
[javac] C:\Users\osbieh\Desktop\JDBC-Test\MySql_JDBC_OLD\build\mysql-connector-java-5.1.6\com\mysql\jdbc\Driver.java:53: error: com.mysql.jdbc.Driver is not abstract and does not override abstract method getParentLogger() in java.sql.Driver
[javac] public class Driver extends NonRegisteringDriver implements java.sql.Driver {
[javac]        ^
[javac] C:\Users\osbieh\Desktop\JDBC-Test\MySql_JDBC_OLD\build\mysql-connector-java-5.1.6\com\mysql\jdbc\ReplicationConnection.java:45: error: ReplicationConnection is not abstract and does not override abstract method getNetworkTimeout() in Connection
[javac] public class ReplicationConnection implements Connection, PingTarget
{
[javac]        ^
[javac] C:\Users\osbieh\Desktop\JDBC-Test\MySql_JDBC_OLD\build\mysql-connector-java-5.1.6\com\mysql\jdbc\ReplicationDriver.java:54: error: ReplicationDriveris not abstract and does not override abstract method getParentLogger() in Driver
[javac] public class ReplicationDriver extends NonRegisteringReplicationDriver
[javac]        ^
[javac] C:\Users\osbieh\Desktop\JDBC-Test\MySql_JDBC_OLD\build\mysql-connector-java-5.1.6\com\mysql\jdbc\StringUtils.java:100: warning: non-varargs call of varargs method with inexact argument type for last parameter;
[javac]                             return (String) toPlainStringMethod.invoke(decimal, null);
[javac]
        ^
[javac]   cast to Object for a varargs call
[javac]   cast to Object[] for a non-varargs call and to suppress this warning
[javac] C:\Users\osbieh\Desktop\JDBC-Test\MySql_JDBC_OLD\build\mysql-connectorjava5.1.6\com\mysql\jdbc\Util.java:54: warning: non-varargs call of varargs method with inexact argument type for last parameter;
[javac]                     systemNanoTimeMethod = System.class.getMethod("nanoTime",null);
[javac]
      ^
[javac]   cast to Class<?> for a varargs call
[javac]   cast to Class<?>[] for a non-varargs call and to suppress this warning
[javac] C:\Users\osbieh\Desktop\JDBC-Test\MySql_JDBC_OLD\build\mysql-connector java-5.1.6\com\mysql\jdbc\Util.java:447: warning: non-varargs call of varargs method with inexact argument type for last parameter;
[javac]                     return networkInterfaceClass.getMethod("getByName", null).invoke(
[javac]
^
[javac]   cast to Class for a varargs call
[javac]   cast to Class[] for a non-varargs call and to suppress this warning
[javac] C:\Users\osbieh\Desktop\JDBC-Test\MySql_JDBC_OLD\build\mysql-connector-java-5.1.6\com\mysql\jdbc\Util.java:477: warning: non-varargs call of varargs method with inexact argument type for last parameter;
[javac]                             return ((Long) systemNanoTimeMethod.invoke(null, null))
[javac]
     ^
[javac]   cast to Object for a varargs call
[javac]   cast to Object[] for a non-varargs call and to suppress this warning
[javac] C:\Users\osbieh\Desktop\JDBC-Test\MySql_JDBC_OLD\build\mysql-connector-java-5.1.6\com\mysql\jdbc\jdbc2\optional\StatementWrapper.java:46: error: StatementWrapper is not abstract and does not override abstract method isCloseOnCompletion() in Statement
[javac] public class StatementWrapper extends WrapperBase implements Statement {
 [javac]        ^
[javac] C:\Users\osbieh\Desktop\JDBC-Test\MySql_JDBC_OLD\build\mysql-connector-java-5.1.6\com\mysql\jdbc\jdbc2\optional\PreparedStatementWrapper.java:58: error: PreparedStatementWrapper is not abstract and does not override abstract method setNClob(int,Reader) in PreparedStatement
[javac] public class PreparedStatementWrapper extends StatementWrapper implements
[javac]        ^
[javac] C:\Users\osbieh\Desktop\JDBC-Test\MySql_JDBC_OLD\build\mysql-connector-java-5.1.6\com\mysql\jdbc\jdbc2\optional\CallableStatementWrapper.java:53: error: CallableStatementWrapper is not abstract and does not override abstract method <T>getObject(String,Class<T>) in CallableStatement
[javac] public class CallableStatementWrapper extends PreparedStatementWrapper
[javac]        ^
[javac]   where T is a type-variable:
[javac]     T extends Object declared in method <T>getObject(String,Class<T>)
[javac] C:\Users\osbieh\Desktop\JDBC-Test\MySql_JDBC_OLD\build\mysql-connector-java-5.1.6\com\mysql\jdbc\jdbc2\optional\ConnectionWrapper.java:62: error: ConnectionWrapper is not abstract and does not override abstract method getNetworkTimeout() in Connection
[javac] public class ConnectionWrapper extends WrapperBase implements Connection {
[javac]        ^
[javac] C:\Users\osbieh\Desktop\JDBC-Test\MySql_JDBC_OLD\build\mysql-connector-java-5.1.6\com\mysql\jdbc\jdbc2\optional\MysqlPooledConnection.java:50: error: MysqlPooledConnection is not abstract and does not override abstract method removeStatementEventListener(StatementEventListener) in PooledConnection
[javac] public class MysqlPooledConnection implements PooledConnection {
[javac]        ^
[javac] C:\Users\osbieh\Desktop\JDBC-Test\MySql_JDBC_OLD\build\mysql-connector-java-5.1.6\com\mysql\jdbc\jdbc2\optional\MysqlDataSource.java:46: error: MysqlDataSourceis not abstract and does not override abstract method getParentLogger() in CommonDataSource
[javac] public class MysqlDataSource extends ConnectionPropertiesImpl implements
[javac]        ^
[javac] C:\Users\osbieh\Desktop\JDBC-Test\MySql_JDBC_OLD\build\mysql-connector-java-5.1.6\com\mysql\jdbc\jdbc2\optional\MysqlConnectionPoolDataSource.java:44: error: MysqlConnectionPoolDataSource is not abstract and does not override abstract method getParentLogger() in CommonDataSource
[javac] public class MysqlConnectionPoolDataSource extends MysqlDataSource implements
[javac]        ^
[javac] C:\Users\osbieh\Desktop\JDBC-Test\MySql_JDBC_OLD\build\mysql-connector-java-5.1.6\com\mysql\jdbc\jdbc2\optional\MysqlXAConnection.java:65: error: MysqlXAConnection is not abstract and does not override abstract method removeStatementEventListener(StatementEventListener) in PooledConnection
[javac] public class MysqlXAConnection extends MysqlPooledConnection implements
[javac]        ^
[javac] C:\Users\osbieh\Desktop\JDBC-Test\MySql_JDBC_OLD\build\mysql-connector-java-5.1.6\com\mysql\jdbc\jdbc2\optional\MysqlXADataSource.java:39: error: MysqlXADataSource is not abstract and does not override abstract method getParentLogger() in CommonDataSource
[javac] public class MysqlXADataSource extends MysqlDataSource implements
[javac]        ^
[javac] C:\Users\osbieh\Desktop\JDBC-Test\MySql_JDBC_OLD\build\mysql-connector-java-5.1.6\com\mysql\jdbc\jdbc2\optional\SuspendableXAConnection.java:17: error: SuspendableXAConnection is not abstract and does not override abstract method removeStatementEventListener(StatementEventListener) in PooledConnection
[javac] public class SuspendableXAConnection extends MysqlPooledConnection implements
[javac]        ^
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 20 errors
[javac] 5 warnings

BUILD FAILED
C:\Users\osbieh\Desktop\JDBC-Test\MySql_JDBC_OLD\build.xml:724: Compile failed;
clean:
[删除]删除目录C:\Users\osbieh\Desktop\JDBC Test\MySql\u JDBC\u OLD\build
-初始副本:
[mkdir]创建目录:C:\Users\osbieh\Desktop\JDBC Test\MySql\u JDBC\u OLD\build
[exec]执行失败:java.io.IOException:无法运行程序“svn”:CreateProcess error=2,系统找不到指定的文件
[复制]将235个文件复制到C:\Users\osbieh\Desktop\JDBC Test\MySql\u JDBC\u OLD\build\MySql-connector-java-5.1.6
[copy]将33个空目录复制到C:\Users\osbieh\Desktop\JDBC Test\MySql\U JDBC\U OLD\build\MySql-connector-java-5.1.6下的3个空目录中
[copy]将15个文件复制到C:\Users\osbieh\Desktop\JDBC Test\MySql\U JDBC\U OLD\build\MySql-connector-java-5.1.6
-初始化无加密:
初始化:
[mkdir]创建目录:C:\Users\osbieh\Desktop\JDBC Test\MySql\u JDBC\u OLD\build\MySql-connector-java-5.1.6\lib节点列表
-清洁输出:
编译-driver-jdbc3:
[javac]C:\Users\osbieh\Desktop\JDBC Test\MySql\u JDBC\u OLD\build.xml:724:警告:未设置“includeantruntime”,默认为build.sysclasspath=last;对于可重复的生成,将设置为false
[javac]将132个源文件编译为C:\Users\osbieh\Desktop\JDBC Test\MySql\u JDBC\u OL\build\MySql-connector-java-5.1.6
[javac]C:\Users\osbieh\Desktop\JDBC Test\MySql\u JDBC\u OLD\build\MySql-connectorjava-5.1.6\com\MySql\JDBC\LoadBalancingConnectionProxy.java:413:警告:非
-varargs调用varargs方法,最后一个参数的参数类型不精确;
[javac]返回((长)getLocalTimeMethod.invoke(null,null))
[javac]
^
[javac]为varargs调用强制转换到对象
[javac]强制转换为对象[]以进行非varargs调用并抑制此警告
[javac]C:\Users\osbieh\Desktop\JDBC Test\MySql\u JDBC\u OLD\build\MySql-connector-java-5.1.6\com\MySql\JDBC\StatementImpl.java:65:错误:StatementImpl不是抽象的,不重写语句中的抽象方法isCloseOnCompletion()
[javac]公共类语句impl实现语句{
[javac]^
[javac]C:\Users\osbieh\Desktop\JDBC Test\MySql\u JDBC\u OLD\build\MySql-connector-java-5.1.6\com\MySql\JDBC\PreparedStatement.java:85:error:com.MySql.JDBC.PreparedStatement不是抽象的,不重写java.sql.PreparedStatement中的抽象方法集SQLXML(int,SQLXML)
[javac]公共类PreparedStatement扩展了com.mysql.jdbc.StatementImpl
工具
[javac]^
[javac]C:\Users\osbieh\Desktop\JDBC Test\MySql\u JDBC\u OLD\build\MySql-connector-java-5.1.6\com\MySql\JDBC\ConnectionImpl.java:74:错误:ConnectionImpl不是抽象的,并且不会覆盖连接中的抽象方法getNetworkTimeout()
[javac]公共类ConnectionImpl扩展ConnectionPropertiesImpl实现
[javac]^
[javac]C:\Users\osbieh\Desktop\JDBC Test\MySql\u JDBC\u OLD\build\MySql-connector-java-5.1.6\com\MySql\JDBC\CallableStatement.java:55:error:com.MySql.JDBC.CallableStatement不是抽象的,不重写java.sql.CallableStatement中的抽象methodgetObject(String,Class)
[javac]公共类CallableStatement扩展PreparedStatement实现
[javac]^
[javac]其中T是一个类型变量:
[javac]T扩展方法getObject中声明的对象(字符串,类)
[javac]C:\Users\osbieh\Desktop\JDBC Test\MySql\u JDBC\u OLD\build\MySql-connectorjava-5.1.6\com\MySql\JDBC\ResultSetImpl.java:120:error:ResultSetImpl不是抽象的,不重写resultset中的抽象方法getObject(String,Class)
[javac]公共类ResultSetImpl实现ResultSetInternalMethods{
[javac]^
[javac]其中T是一个类型变量:
[javac]T扩展方法getObject中声明的对象(字符串,类)
[javac]C:\Users\osbieh\Desktop\JDBC Test\MySql\u JDBC\u OLD\build\MySql-connectorjava5.1.6\com\MySql\JDBC\DatabaseMetaData.java:64:error:com.MySql.JDBC.DatabaseMetaData不是抽象的,不会覆盖java.sql.DatabaseMetaData中的抽象方法generatedKeyAlwaysReturn()
[javac]公共类DatabaseMetaData实现java.sql.DatabaseMetaData{
[javac]^
[javac]C:\Users\osbieh\Desktop\JDBC Test\MySql\u JDBC\u OLD\build\MySql-connector-java-5.1.6\com\MySql\JDBC\NonRegisteringDriver.java:67:错误:nonregisting
驱动程序不是抽象的,并且不会重写驱动程序中的抽象方法getParentLogger()
[javac]公共类非注册驱动程序实现java.sql.Driver{
[javac]^
[javac]C:\Users\osbieh\Desktop\JDBC Test\MySql\u JDBC\u OLD\build\MySql-connector-java-5.1.6\com\MySql\JDBC\Driver.java:53:error:com.MySql.JDBC.Driver不是抽象的,不重写java.sql.Driver中的抽象方法getParentLogger()
[javac]公共类驱动程序扩展非注册驱动程序实现java.sql.Driver{
[javac]^
[javac]C:\Users\osbieh\Desktop\JDBC Test\MySql\u JDBC\u OLD\build\MySql-connector-java-5.1.6\com\MySql\JDBC\ReplicationConnection.java:45:错误:ReplicationConnection不是抽象的,不会覆盖连接中的抽象方法getNetworkTimeout()
[javac]公共类ReplicationConnection实现连接,PingTarget
{
[javac]^
[javac]C:\Users\osbieh\Desktop\JDBC Test\MySql\u JDBC\u OLD\build\MySql-connector-java-5.1.6\com\MySql\JDBC\ReplicationDriver.java:54:错误:ReplicationDriver不是抽象的,不重写驱动程序中的抽象方法getParentLogger()
[javac]公共类ReplicationDriver扩展了非注册ReplicationDriver
[javac]^
[javac]C:\Users\osbieh\Desktop\JDBC Test\MySql\u JDBC\u OLD\build\MySql-connector-java-5.1.6\com\MySql\JDBC\StringUtils.java:100:warning:varargs方法的非varargs调用,最后一个参数的参数类型不准确;
[javac]