Pleased to inform you, guys that Cayenne can almost be compiled under jdk1.4. The only compile-time problem is not implementing some methods in the ConnectinWrapper class. Evidently, the Connection interface has been enriched in this version of JDBC.
Andrei, here is a valid ConnectionWrapper variant with the stubs implemented at the very end. I suggest that we use them or something really working at once even if we are not going to shift to the new jdk version.
Andriy.
package org.objectstyle.cayenne.conn;
import java.sql.*;
import java.util.*;
/**
* <p>Cayenne specific java.sql.Connection implementation that allowes to pool
* JDBC connections when a driver used does not support pooled connections.
* This implementation will wrap existing connection object obtained elsewhere,
* delegating all the calls to it, except for "close" method that is
* implemented to return connection to the pool and "isClosed" method that
* returns true if connection was returned to the pool or closed by the pool.</p>
*
* <p>Because of the overhead involved when calling connection methods, this class
* should only be used when a corresponding driver does not support connection
* pooling at all.</p>
*/
public class ConnectionWrapper implements Connection {
//here are your methods
...
//these are new ones
public void setHoldability(int holdability) throws SQLException {
/*..odo: Implement this java.sql.Connection method*/
throw new java.lang.UnsupportedOperationException("Method setHoldability() not yet implemented.");
}
public int getHoldability() throws SQLException {
/*..odo: Implement this java.sql.Connection method*/
throw new java.lang.UnsupportedOperationException("Method getHoldability() not yet implemented.");
}
public Savepoint setSavepoint() throws SQLException {
/*..odo: Implement this java.sql.Connection method*/
throw new java.lang.UnsupportedOperationException("Method setSavepoint() not yet implemented.");
}
public Savepoint setSavepoint(String name) throws SQLException {
/*..odo: Implement this java.sql.Connection method*/
throw new java.lang.UnsupportedOperationException("Method setSavepoint() not yet implemented.");
}
public void rollback(Savepoint savepoint) throws SQLException {
/*..odo: Implement this java.sql.Connection method*/
throw new java.lang.UnsupportedOperationException("Method rollback() not yet implemented.");
}
public void releaseSavepoint(Savepoint savepoint) throws SQLException {
/*..odo: Implement this java.sql.Connection method*/
throw new java.lang.UnsupportedOperationException("Method releaseSavepoint() not yet implemented.");
}
public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException {
/*..odo: Implement this java.sql.Connection method*/
throw new java.lang.UnsupportedOperationException("Method createStatement() not yet implemented.");
}
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException {
/*..odo: Implement this java.sql.Connection method*/
throw new java.lang.UnsupportedOperationException("Method prepareStatement() not yet implemented.");
}
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException {
/*..odo: Implement this java.sql.Connection method*/
throw new java.lang.UnsupportedOperationException("Method prepareCall() not yet implemented.");
}
public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
/*..odo: Implement this java.sql.Connection method*/
throw new java.lang.UnsupportedOperationException("Method prepareStatement() not yet implemented.");
}
public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException {
/*..odo: Implement this java.sql.Connection method*/
throw new java.lang.UnsupportedOperationException("Method prepareStatement() not yet implemented.");
}
public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException {
/*..odo: Implement this java.sql.Connection method*/
throw new java.lang.UnsupportedOperationException("Method prepareStatement() not yet implemented.");
}
}
This archive was generated by hypermail 2b30 : Sat Aug 04 2001 - 16:21:24 EDT