change
This commit is contained in:
parent
a8133047bc
commit
55ac4c1dc6
|
@ -41,6 +41,7 @@ public class TSDBPreparedStatement extends TSDBStatement implements PreparedStat
|
||||||
private boolean isSaved;
|
private boolean isSaved;
|
||||||
|
|
||||||
private SavedPreparedStatement savedPreparedStatement;
|
private SavedPreparedStatement savedPreparedStatement;
|
||||||
|
private ParameterMetaData parameterMetaData;
|
||||||
|
|
||||||
TSDBPreparedStatement(TSDBConnection connection, TSDBJNIConnector connecter, String sql) {
|
TSDBPreparedStatement(TSDBConnection connection, TSDBJNIConnector connecter, String sql) {
|
||||||
super(connection, connecter);
|
super(connection, connecter);
|
||||||
|
@ -240,8 +241,8 @@ public class TSDBPreparedStatement extends TSDBStatement implements PreparedStat
|
||||||
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_STATEMENT_CLOSED);
|
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_STATEMENT_CLOSED);
|
||||||
if (!isSupportedSQLType(sqlType) || parameterIndex < 0)
|
if (!isSupportedSQLType(sqlType) || parameterIndex < 0)
|
||||||
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_INVALID_VARIABLE);
|
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_INVALID_VARIABLE);
|
||||||
if (parameterIndex >= parameters.size())
|
// if (parameterIndex >= parameters.size())
|
||||||
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_PARAMETER_INDEX_OUT_BOUNDARY);
|
// throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_PARAMETER_INDEX_OUT_BOUNDARY);
|
||||||
|
|
||||||
setObject(parameterIndex, "NULL");
|
setObject(parameterIndex, "NULL");
|
||||||
}
|
}
|
||||||
|
@ -446,7 +447,8 @@ public class TSDBPreparedStatement extends TSDBStatement implements PreparedStat
|
||||||
public ResultSetMetaData getMetaData() throws SQLException {
|
public ResultSetMetaData getMetaData() throws SQLException {
|
||||||
if (isClosed())
|
if (isClosed())
|
||||||
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_STATEMENT_CLOSED);
|
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_STATEMENT_CLOSED);
|
||||||
return this.getResultSet().getMetaData();
|
// return this.getResultSet().getMetaData();
|
||||||
|
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -489,9 +491,9 @@ public class TSDBPreparedStatement extends TSDBStatement implements PreparedStat
|
||||||
public ParameterMetaData getParameterMetaData() throws SQLException {
|
public ParameterMetaData getParameterMetaData() throws SQLException {
|
||||||
if (isClosed())
|
if (isClosed())
|
||||||
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_STATEMENT_CLOSED);
|
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_STATEMENT_CLOSED);
|
||||||
//TODO:
|
//TODO: parameterMetaData not supported
|
||||||
return null;
|
// return null;
|
||||||
// throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
|
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -160,11 +160,9 @@ public class TSDBPreparedStatementTest {
|
||||||
pstmt_insert.setArray(1, null);
|
pstmt_insert.setArray(1, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test(expected = SQLFeatureNotSupportedException.class)
|
||||||
public void getMetaData() throws SQLException {
|
public void getMetaData() throws SQLException {
|
||||||
ResultSetMetaData metaData = pstmt_insert.getMetaData();
|
pstmt_insert.getMetaData();
|
||||||
Assert.assertNotNull(metaData);
|
|
||||||
//TODO
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = SQLFeatureNotSupportedException.class)
|
@Test(expected = SQLFeatureNotSupportedException.class)
|
||||||
|
|
Loading…
Reference in New Issue