change
This commit is contained in:
parent
9d773e1234
commit
2e2767c0ee
|
@ -109,6 +109,18 @@ public abstract class AbstractConnection extends WrapperImpl implements Connecti
|
|||
public void setTransactionIsolation(int level) throws SQLException {
|
||||
if (isClosed())
|
||||
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_CONNECTION_CLOSED);
|
||||
|
||||
switch (level) {
|
||||
case Connection.TRANSACTION_NONE:
|
||||
break;
|
||||
case Connection.TRANSACTION_READ_UNCOMMITTED:
|
||||
case Connection.TRANSACTION_READ_COMMITTED:
|
||||
case Connection.TRANSACTION_REPEATABLE_READ:
|
||||
case Connection.TRANSACTION_SERIALIZABLE:
|
||||
throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG);
|
||||
default:
|
||||
throw new SQLException(TSDBConstants.INVALID_VARIABLES);
|
||||
}
|
||||
//do nothing
|
||||
}
|
||||
|
||||
|
|
|
@ -122,6 +122,7 @@ public class TSDBConnectionTest {
|
|||
|
||||
@Test
|
||||
public void getCatalog() throws SQLException {
|
||||
conn.setCatalog("log");
|
||||
Assert.assertEquals("log", conn.getCatalog());
|
||||
}
|
||||
|
||||
|
@ -129,7 +130,6 @@ public class TSDBConnectionTest {
|
|||
public void setTransactionIsolation() throws SQLException {
|
||||
conn.setTransactionIsolation(Connection.TRANSACTION_NONE);
|
||||
Assert.assertEquals(Connection.TRANSACTION_NONE, conn.getTransactionIsolation());
|
||||
|
||||
conn.setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
|
||||
}
|
||||
|
||||
|
@ -238,7 +238,7 @@ public class TSDBConnectionTest {
|
|||
int status = rs.getInt("server_status()");
|
||||
Assert.assertEquals(1, status);
|
||||
|
||||
conn.prepareStatement("select server_status", ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);
|
||||
conn.prepareStatement("select server_status", ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);
|
||||
}
|
||||
|
||||
@Test(expected = SQLFeatureNotSupportedException.class)
|
||||
|
|
Loading…
Reference in New Issue