Fix axiondb build for JDK7

master
Vitaliy Filippov 2015-12-26 01:43:26 +03:00
parent 9f4a0016e8
commit aa5449427d
9 changed files with 67 additions and 7 deletions

View File

@ -131,12 +131,6 @@
</dependency>
<!-- TEST DEPENDENCIES-->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>

View File

@ -60,6 +60,7 @@ import java.sql.Struct;
import java.util.Collections;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.Executor;
import org.axiondb.AxionException;
import org.axiondb.Database;
@ -111,6 +112,10 @@ public class AxionConnection implements Connection {
}
}
public void abort(Executor executor) throws SQLException {
throw new SQLException("Not supported");
}
public void commit() throws SQLException {
commit(true);
}
@ -133,6 +138,20 @@ public class AxionConnection implements Connection {
return _autoCommit;
}
public int getNetworkTimeout() throws SQLException {
return 0;
}
public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException {
}
public String getSchema() throws SQLException {
return null;
}
public void setSchema(String schema) throws SQLException {
}
public String getCatalog() throws SQLException {
return "";
}

View File

@ -43,6 +43,8 @@ package org.axiondb.jdbc;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.logging.Logger;
import java.sql.SQLFeatureNotSupportedException;
import javax.sql.DataSource;
@ -91,6 +93,10 @@ public class AxionDataSource extends ConnectionFactory implements DataSource {
_logWriter = log;
}
public Logger getParentLogger() throws SQLFeatureNotSupportedException {
throw new SQLFeatureNotSupportedException();
}
public <T> T unwrap(Class<T> iface) throws SQLException {
throw new SQLException("Unsupported.");
}

View File

@ -188,6 +188,10 @@ public class AxionDatabaseMetaData implements DatabaseMetaData {
public boolean storesLowerCaseIdentifiers() throws SQLException {
return false;
}
public boolean generatedKeyAlwaysReturned() throws SQLException {
return false;
}
/**
* Returns <code>false</code>, since Axion currently ignores case in identifiers.
@ -614,6 +618,12 @@ public class AxionDatabaseMetaData implements DatabaseMetaData {
return rset;
}
public ResultSet getPseudoColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) throws SQLException {
Statement stmt = _connection.createStatement();
ResultSet rset = stmt.executeQuery("select TABLE_CAT, TABLE_SCHEM, TABLE_NAME, COLUMN_NAME, DATA_TYPE, TYPE_NAME, COLUMN_SIZE, BUFFER_LENGTH, DECIMAL_DIGITS, NUM_PREC_RADIX, NULLABLE, REMARKS, COLUMN_DEF, SQL_DATA_TYPE, SQL_DATETIME_SUB, CHAR_OCTET_LENGTH, ORDINAL_POSITION, IS_NULLABLE, SCOPE_CATALOG, SCOPE_SCHEMA, SCOPE_TABLE, SOURCE_DATA_TYPE from AXION_COLUMNS where 0=1 order by TABLE_SCHEM, TABLE_NAME, ORDINAL_POSITION");
return rset;
}
/**
* Supported.
*/

View File

@ -50,6 +50,9 @@ import java.util.Properties;
import org.axiondb.AxionException;
import org.axiondb.util.ExceptionConverter;
import java.util.logging.Logger;
import java.sql.SQLFeatureNotSupportedException;
/**
* A {@link Driver} implementation.
*
@ -94,5 +97,9 @@ public class AxionDriver extends ConnectionFactory implements Driver {
public boolean jdbcCompliant() {
return false;
}
public Logger getParentLogger() throws SQLFeatureNotSupportedException {
throw new SQLFeatureNotSupportedException();
}
}

View File

@ -562,6 +562,14 @@ public class AxionResultSet implements ResultSet {
throw new SQLException("Not supported");
}
public <T> T getObject(int i, Class<T> type) throws SQLException {
return (T)getObject(i);
}
public <T> T getObject(String colName, Class<T> type) throws SQLException {
return (T)getObject(colName);
}
public Object getObject(String colName) throws SQLException {
return getObject(getResultSetIndexForColumnName(colName));
}

View File

@ -164,6 +164,14 @@ public class AxionStatement extends BaseAxionStatement implements Statement {
return 0;
}
public boolean isCloseOnCompletion() throws SQLException {
return false;
}
public void closeOnCompletion() throws SQLException {
throw new SQLException("Not supported");
}
public ResultSet getResultSet() throws SQLException {
ResultSet rs = getCurrentResultSet();
if (rs != null) {

View File

@ -274,6 +274,10 @@ public abstract class BaseAxionResultSetDecorator implements ResultSet {
return _rs.getObject(i, map);
}
public <T> T getObject(int i, Class<T> type) throws SQLException {
return (T)getObject(i);
}
public Object getObject(String columnName) throws SQLException {
return _rs.getObject(columnName);
}
@ -282,6 +286,10 @@ public abstract class BaseAxionResultSetDecorator implements ResultSet {
return _rs.getObject(colName, map);
}
public <T> T getObject(String colName, Class<T> type) throws SQLException {
return (T)getObject(colName);
}
public Ref getRef(int i) throws SQLException {
return _rs.getRef(i);
}

View File

@ -46,7 +46,7 @@
</build>
<modules>
<!-- components: -->
<!--<module>axiondb</module>-->
<module>axiondb</module>
<module>bpelmodel</module>
<module>test-util</module>
<module>common-util</module>