我修改了MySQL Connector / J,在我的修改中,我使用了2个jar(基于JDK1.7构建)。 当我尝试使用ANT构建构建jdbc时遇到以下错误,我认为发生此错误是因为在JDBC的接口上添加了JDK1.7中的新方法,并且在与Generic语法()的兼容性方面存在一些问题,请问如何使用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;