提交 55ac4c1d 编写于 作者: Z zyyang

change

上级 a8133047
......@@ -41,6 +41,7 @@ public class TSDBPreparedStatement extends TSDBStatement implements PreparedStat
private boolean isSaved;
private SavedPreparedStatement savedPreparedStatement;
private ParameterMetaData parameterMetaData;
TSDBPreparedStatement(TSDBConnection connection, TSDBJNIConnector connecter, String sql) {
super(connection, connecter);
......@@ -240,8 +241,8 @@ public class TSDBPreparedStatement extends TSDBStatement implements PreparedStat
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_STATEMENT_CLOSED);
if (!isSupportedSQLType(sqlType) || parameterIndex < 0)
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_INVALID_VARIABLE);
if (parameterIndex >= parameters.size())
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_PARAMETER_INDEX_OUT_BOUNDARY);
// if (parameterIndex >= parameters.size())
// throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_PARAMETER_INDEX_OUT_BOUNDARY);
setObject(parameterIndex, "NULL");
}
......@@ -446,7 +447,8 @@ public class TSDBPreparedStatement extends TSDBStatement implements PreparedStat
public ResultSetMetaData getMetaData() throws SQLException {
if (isClosed())
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_STATEMENT_CLOSED);
return this.getResultSet().getMetaData();
// return this.getResultSet().getMetaData();
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
}
@Override
......@@ -489,9 +491,9 @@ public class TSDBPreparedStatement extends TSDBStatement implements PreparedStat
public ParameterMetaData getParameterMetaData() throws SQLException {
if (isClosed())
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_STATEMENT_CLOSED);
//TODO:
return null;
// throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
//TODO: parameterMetaData not supported
// return null;
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
}
@Override
......
......@@ -160,11 +160,9 @@ public class TSDBPreparedStatementTest {
pstmt_insert.setArray(1, null);
}
@Test
@Test(expected = SQLFeatureNotSupportedException.class)
public void getMetaData() throws SQLException {
ResultSetMetaData metaData = pstmt_insert.getMetaData();
Assert.assertNotNull(metaData);
//TODO
pstmt_insert.getMetaData();
}
@Test(expected = SQLFeatureNotSupportedException.class)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册