提交 cd1bdc74 编写于 作者: Z zyyang

change

上级 9a58d6d8
...@@ -126,9 +126,9 @@ public abstract class AbstractConnection extends WrapperImpl implements Connecti ...@@ -126,9 +126,9 @@ public abstract class AbstractConnection extends WrapperImpl implements Connecti
case Connection.TRANSACTION_READ_COMMITTED: case Connection.TRANSACTION_READ_COMMITTED:
case Connection.TRANSACTION_REPEATABLE_READ: case Connection.TRANSACTION_REPEATABLE_READ:
case Connection.TRANSACTION_SERIALIZABLE: case Connection.TRANSACTION_SERIALIZABLE:
throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
default: default:
throw new SQLException(TSDBConstants.INVALID_VARIABLES); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_INVALID_VARIABLE);
} }
//do nothing //do nothing
} }
......
...@@ -160,12 +160,12 @@ public class DatabaseMetaDataResultSet implements ResultSet { ...@@ -160,12 +160,12 @@ public class DatabaseMetaDataResultSet implements ResultSet {
@Override @Override
public Date getDate(int columnIndex) throws SQLException { public Date getDate(int columnIndex) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public Time getTime(int columnIndex) throws SQLException { public Time getTime(int columnIndex) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
...@@ -176,17 +176,17 @@ public class DatabaseMetaDataResultSet implements ResultSet { ...@@ -176,17 +176,17 @@ public class DatabaseMetaDataResultSet implements ResultSet {
@Override @Override
public InputStream getAsciiStream(int columnIndex) throws SQLException { public InputStream getAsciiStream(int columnIndex) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public InputStream getUnicodeStream(int columnIndex) throws SQLException { public InputStream getUnicodeStream(int columnIndex) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public InputStream getBinaryStream(int columnIndex) throws SQLException { public InputStream getBinaryStream(int columnIndex) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
...@@ -256,22 +256,22 @@ public class DatabaseMetaDataResultSet implements ResultSet { ...@@ -256,22 +256,22 @@ public class DatabaseMetaDataResultSet implements ResultSet {
@Override @Override
public InputStream getAsciiStream(String columnLabel) throws SQLException { public InputStream getAsciiStream(String columnLabel) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public InputStream getUnicodeStream(String columnLabel) throws SQLException { public InputStream getUnicodeStream(String columnLabel) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public InputStream getBinaryStream(String columnLabel) throws SQLException { public InputStream getBinaryStream(String columnLabel) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public SQLWarning getWarnings() throws SQLException { public SQLWarning getWarnings() throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
...@@ -281,7 +281,7 @@ public class DatabaseMetaDataResultSet implements ResultSet { ...@@ -281,7 +281,7 @@ public class DatabaseMetaDataResultSet implements ResultSet {
@Override @Override
public String getCursorName() throws SQLException { public String getCursorName() throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
...@@ -313,12 +313,12 @@ public class DatabaseMetaDataResultSet implements ResultSet { ...@@ -313,12 +313,12 @@ public class DatabaseMetaDataResultSet implements ResultSet {
@Override @Override
public Reader getCharacterStream(int columnIndex) throws SQLException { public Reader getCharacterStream(int columnIndex) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public Reader getCharacterStream(String columnLabel) throws SQLException { public Reader getCharacterStream(String columnLabel) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
...@@ -353,22 +353,22 @@ public class DatabaseMetaDataResultSet implements ResultSet { ...@@ -353,22 +353,22 @@ public class DatabaseMetaDataResultSet implements ResultSet {
@Override @Override
public void beforeFirst() throws SQLException { public void beforeFirst() throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void afterLast() throws SQLException { public void afterLast() throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public boolean first() throws SQLException { public boolean first() throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public boolean last() throws SQLException { public boolean last() throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
...@@ -383,17 +383,17 @@ public class DatabaseMetaDataResultSet implements ResultSet { ...@@ -383,17 +383,17 @@ public class DatabaseMetaDataResultSet implements ResultSet {
@Override @Override
public boolean absolute(int row) throws SQLException { public boolean absolute(int row) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public boolean relative(int rows) throws SQLException { public boolean relative(int rows) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public boolean previous() throws SQLException { public boolean previous() throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
...@@ -443,227 +443,227 @@ public class DatabaseMetaDataResultSet implements ResultSet { ...@@ -443,227 +443,227 @@ public class DatabaseMetaDataResultSet implements ResultSet {
@Override @Override
public void updateNull(int columnIndex) throws SQLException { public void updateNull(int columnIndex) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void updateBoolean(int columnIndex, boolean x) throws SQLException { public void updateBoolean(int columnIndex, boolean x) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void updateByte(int columnIndex, byte x) throws SQLException { public void updateByte(int columnIndex, byte x) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void updateShort(int columnIndex, short x) throws SQLException { public void updateShort(int columnIndex, short x) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void updateInt(int columnIndex, int x) throws SQLException { public void updateInt(int columnIndex, int x) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void updateLong(int columnIndex, long x) throws SQLException { public void updateLong(int columnIndex, long x) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void updateFloat(int columnIndex, float x) throws SQLException { public void updateFloat(int columnIndex, float x) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void updateDouble(int columnIndex, double x) throws SQLException { public void updateDouble(int columnIndex, double x) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException { public void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void updateString(int columnIndex, String x) throws SQLException { public void updateString(int columnIndex, String x) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void updateBytes(int columnIndex, byte[] x) throws SQLException { public void updateBytes(int columnIndex, byte[] x) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void updateDate(int columnIndex, Date x) throws SQLException { public void updateDate(int columnIndex, Date x) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void updateTime(int columnIndex, Time x) throws SQLException { public void updateTime(int columnIndex, Time x) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void updateTimestamp(int columnIndex, Timestamp x) throws SQLException { public void updateTimestamp(int columnIndex, Timestamp x) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void updateAsciiStream(int columnIndex, InputStream x, int length) throws SQLException { public void updateAsciiStream(int columnIndex, InputStream x, int length) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void updateBinaryStream(int columnIndex, InputStream x, int length) throws SQLException { public void updateBinaryStream(int columnIndex, InputStream x, int length) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void updateCharacterStream(int columnIndex, Reader x, int length) throws SQLException { public void updateCharacterStream(int columnIndex, Reader x, int length) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void updateObject(int columnIndex, Object x, int scaleOrLength) throws SQLException { public void updateObject(int columnIndex, Object x, int scaleOrLength) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void updateObject(int columnIndex, Object x) throws SQLException { public void updateObject(int columnIndex, Object x) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void updateNull(String columnLabel) throws SQLException { public void updateNull(String columnLabel) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void updateBoolean(String columnLabel, boolean x) throws SQLException { public void updateBoolean(String columnLabel, boolean x) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void updateByte(String columnLabel, byte x) throws SQLException { public void updateByte(String columnLabel, byte x) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void updateShort(String columnLabel, short x) throws SQLException { public void updateShort(String columnLabel, short x) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void updateInt(String columnLabel, int x) throws SQLException { public void updateInt(String columnLabel, int x) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void updateLong(String columnLabel, long x) throws SQLException { public void updateLong(String columnLabel, long x) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void updateFloat(String columnLabel, float x) throws SQLException { public void updateFloat(String columnLabel, float x) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void updateDouble(String columnLabel, double x) throws SQLException { public void updateDouble(String columnLabel, double x) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void updateBigDecimal(String columnLabel, BigDecimal x) throws SQLException { public void updateBigDecimal(String columnLabel, BigDecimal x) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void updateString(String columnLabel, String x) throws SQLException { public void updateString(String columnLabel, String x) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void updateBytes(String columnLabel, byte[] x) throws SQLException { public void updateBytes(String columnLabel, byte[] x) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void updateDate(String columnLabel, Date x) throws SQLException { public void updateDate(String columnLabel, Date x) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void updateTime(String columnLabel, Time x) throws SQLException { public void updateTime(String columnLabel, Time x) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void updateTimestamp(String columnLabel, Timestamp x) throws SQLException { public void updateTimestamp(String columnLabel, Timestamp x) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void updateAsciiStream(String columnLabel, InputStream x, int length) throws SQLException { public void updateAsciiStream(String columnLabel, InputStream x, int length) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void updateBinaryStream(String columnLabel, InputStream x, int length) throws SQLException { public void updateBinaryStream(String columnLabel, InputStream x, int length) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void updateCharacterStream(String columnLabel, Reader reader, int length) throws SQLException { public void updateCharacterStream(String columnLabel, Reader reader, int length) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void updateObject(String columnLabel, Object x, int scaleOrLength) throws SQLException { public void updateObject(String columnLabel, Object x, int scaleOrLength) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void updateObject(String columnLabel, Object x) throws SQLException { public void updateObject(String columnLabel, Object x) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void insertRow() throws SQLException { public void insertRow() throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void updateRow() throws SQLException { public void updateRow() throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void deleteRow() throws SQLException { public void deleteRow() throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void refreshRow() throws SQLException { public void refreshRow() throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void cancelRowUpdates() throws SQLException { public void cancelRowUpdates() throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void moveToInsertRow() throws SQLException { public void moveToInsertRow() throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public void moveToCurrentRow() throws SQLException { public void moveToCurrentRow() throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
...@@ -673,12 +673,12 @@ public class DatabaseMetaDataResultSet implements ResultSet { ...@@ -673,12 +673,12 @@ public class DatabaseMetaDataResultSet implements ResultSet {
@Override @Override
public Object getObject(int columnIndex, Map<String, Class<?>> map) throws SQLException { public Object getObject(int columnIndex, Map<String, Class<?>> map) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public Ref getRef(int columnIndex) throws SQLException { public Ref getRef(int columnIndex) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
...@@ -1043,12 +1043,12 @@ public class DatabaseMetaDataResultSet implements ResultSet { ...@@ -1043,12 +1043,12 @@ public class DatabaseMetaDataResultSet implements ResultSet {
@Override @Override
public <T> T getObject(int columnIndex, Class<T> type) throws SQLException { public <T> T getObject(int columnIndex, Class<T> type) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
public <T> T getObject(String columnLabel, Class<T> type) throws SQLException { public <T> T getObject(String columnLabel, Class<T> type) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORTED_METHOD_EXCEPTION_MSG); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@Override @Override
......
...@@ -103,7 +103,6 @@ public class TSDBJNIConnector { ...@@ -103,7 +103,6 @@ public class TSDBJNIConnector {
this.taos = this.connectImp(host, port, dbName, user, password); this.taos = this.connectImp(host, port, dbName, user, password);
if (this.taos == TSDBConstants.JNI_NULL_POINTER) { if (this.taos == TSDBConstants.JNI_NULL_POINTER) {
throw TSDBError.createSQLException(this.getErrCode(0l), this.getErrMsg(0L)); throw TSDBError.createSQLException(this.getErrCode(0l), this.getErrMsg(0L));
// throw new SQLException(TSDBConstants.WrapErrMsg(, "", );
} }
// invoke connectImp only here // invoke connectImp only here
taosInfo.conn_open_increment(); taosInfo.conn_open_increment();
...@@ -274,7 +273,7 @@ public class TSDBJNIConnector { ...@@ -274,7 +273,7 @@ public class TSDBJNIConnector {
public void closeConnection() throws SQLException { public void closeConnection() throws SQLException {
int code = this.closeConnectionImp(this.taos); int code = this.closeConnectionImp(this.taos);
if (code < 0) { if (code < 0) {
throw new SQLException(TSDBConstants.FixErrMsg(code), "", this.getErrCode(0l)); throw TSDBError.createSQLException(this.getErrCode(0l), this.getErrMsg(0L));
} else if (code == 0) { } else if (code == 0) {
this.taos = TSDBConstants.JNI_NULL_POINTER; this.taos = TSDBConstants.JNI_NULL_POINTER;
} else { } else {
......
...@@ -106,7 +106,7 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet { ...@@ -106,7 +106,7 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet {
@Override @Override
public boolean next() throws SQLException { public boolean next() throws SQLException {
if (isClosed()) if (isClosed())
throw new SQLException(TSDBConstants.WrapErrMsg(TSDBConstants.RESULT_SET_IS_CLOSED)); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_RESULTSET_CLOSED);
pos++; pos++;
if (pos <= resultSet.size() - 1) { if (pos <= resultSet.size() - 1) {
return true; return true;
...@@ -124,14 +124,14 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet { ...@@ -124,14 +124,14 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet {
@Override @Override
public boolean wasNull() throws SQLException { public boolean wasNull() throws SQLException {
if (isClosed()) if (isClosed())
throw new SQLException(TSDBConstants.WrapErrMsg(TSDBConstants.RESULT_SET_IS_CLOSED)); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_RESULTSET_CLOSED);
return resultSet.isEmpty(); return resultSet.isEmpty();
} }
@Override @Override
public String getString(int columnIndex) throws SQLException { public String getString(int columnIndex) throws SQLException {
if (isClosed()) if (isClosed())
throw new SQLException(TSDBConstants.WrapErrMsg(TSDBConstants.RESULT_SET_IS_CLOSED)); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_RESULTSET_CLOSED);
if (columnIndex > resultSet.get(pos).size()) { if (columnIndex > resultSet.get(pos).size()) {
throw new SQLException(TSDBConstants.WrapErrMsg("Column Index out of range, " + columnIndex + " > " + resultSet.get(pos).size())); throw new SQLException(TSDBConstants.WrapErrMsg("Column Index out of range, " + columnIndex + " > " + resultSet.get(pos).size()));
...@@ -144,7 +144,7 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet { ...@@ -144,7 +144,7 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet {
@Override @Override
public boolean getBoolean(int columnIndex) throws SQLException { public boolean getBoolean(int columnIndex) throws SQLException {
if (isClosed()) if (isClosed())
throw new SQLException(TSDBConstants.WrapErrMsg(TSDBConstants.RESULT_SET_IS_CLOSED)); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_RESULTSET_CLOSED);
columnIndex = getTrueColumnIndex(columnIndex); columnIndex = getTrueColumnIndex(columnIndex);
int result = getInt(columnIndex); int result = getInt(columnIndex);
...@@ -154,7 +154,7 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet { ...@@ -154,7 +154,7 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet {
@Override @Override
public short getShort(int columnIndex) throws SQLException { public short getShort(int columnIndex) throws SQLException {
if (isClosed()) if (isClosed())
throw new SQLException(TSDBConstants.WrapErrMsg(TSDBConstants.RESULT_SET_IS_CLOSED)); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_RESULTSET_CLOSED);
columnIndex = getTrueColumnIndex(columnIndex); columnIndex = getTrueColumnIndex(columnIndex);
return Short.parseShort(resultSet.get(pos).get(columnIndex).toString()); return Short.parseShort(resultSet.get(pos).get(columnIndex).toString());
} }
...@@ -162,7 +162,7 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet { ...@@ -162,7 +162,7 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet {
@Override @Override
public int getInt(int columnIndex) throws SQLException { public int getInt(int columnIndex) throws SQLException {
if (isClosed()) if (isClosed())
throw new SQLException(TSDBConstants.WrapErrMsg(TSDBConstants.RESULT_SET_IS_CLOSED)); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_RESULTSET_CLOSED);
columnIndex = getTrueColumnIndex(columnIndex); columnIndex = getTrueColumnIndex(columnIndex);
return Integer.parseInt(resultSet.get(pos).get(columnIndex).toString()); return Integer.parseInt(resultSet.get(pos).get(columnIndex).toString());
} }
...@@ -170,7 +170,7 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet { ...@@ -170,7 +170,7 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet {
@Override @Override
public long getLong(int columnIndex) throws SQLException { public long getLong(int columnIndex) throws SQLException {
if (isClosed()) if (isClosed())
throw new SQLException(TSDBConstants.WrapErrMsg(TSDBConstants.RESULT_SET_IS_CLOSED)); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_RESULTSET_CLOSED);
columnIndex = getTrueColumnIndex(columnIndex); columnIndex = getTrueColumnIndex(columnIndex);
return Long.parseLong(resultSet.get(pos).get(columnIndex).toString()); return Long.parseLong(resultSet.get(pos).get(columnIndex).toString());
} }
...@@ -178,7 +178,7 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet { ...@@ -178,7 +178,7 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet {
@Override @Override
public float getFloat(int columnIndex) throws SQLException { public float getFloat(int columnIndex) throws SQLException {
if (isClosed()) if (isClosed())
throw new SQLException(TSDBConstants.WrapErrMsg(TSDBConstants.RESULT_SET_IS_CLOSED)); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_RESULTSET_CLOSED);
columnIndex = getTrueColumnIndex(columnIndex); columnIndex = getTrueColumnIndex(columnIndex);
return Float.parseFloat(resultSet.get(pos).get(columnIndex).toString()); return Float.parseFloat(resultSet.get(pos).get(columnIndex).toString());
} }
...@@ -186,7 +186,7 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet { ...@@ -186,7 +186,7 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet {
@Override @Override
public double getDouble(int columnIndex) throws SQLException { public double getDouble(int columnIndex) throws SQLException {
if (isClosed()) if (isClosed())
throw new SQLException(TSDBConstants.WrapErrMsg(TSDBConstants.RESULT_SET_IS_CLOSED)); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_RESULTSET_CLOSED);
columnIndex = getTrueColumnIndex(columnIndex); columnIndex = getTrueColumnIndex(columnIndex);
return Double.parseDouble(resultSet.get(pos).get(columnIndex).toString()); return Double.parseDouble(resultSet.get(pos).get(columnIndex).toString());
...@@ -208,7 +208,7 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet { ...@@ -208,7 +208,7 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet {
@Override @Override
public Timestamp getTimestamp(int columnIndex) throws SQLException { public Timestamp getTimestamp(int columnIndex) throws SQLException {
if (isClosed()) if (isClosed())
throw new SQLException(TSDBConstants.WrapErrMsg(TSDBConstants.RESULT_SET_IS_CLOSED)); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_RESULTSET_CLOSED);
columnIndex = getTrueColumnIndex(columnIndex); columnIndex = getTrueColumnIndex(columnIndex);
String strDate = resultSet.get(pos).get(columnIndex).toString(); String strDate = resultSet.get(pos).get(columnIndex).toString();
...@@ -220,7 +220,7 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet { ...@@ -220,7 +220,7 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet {
@Override @Override
public ResultSetMetaData getMetaData() throws SQLException { public ResultSetMetaData getMetaData() throws SQLException {
if (isClosed()) if (isClosed())
throw new SQLException(TSDBConstants.WrapErrMsg(TSDBConstants.RESULT_SET_IS_CLOSED)); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_RESULTSET_CLOSED);
return this.metaData; return this.metaData;
} }
...@@ -233,7 +233,7 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet { ...@@ -233,7 +233,7 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet {
@Override @Override
public int findColumn(String columnLabel) throws SQLException { public int findColumn(String columnLabel) throws SQLException {
if (isClosed()) if (isClosed())
throw new SQLException(TSDBConstants.WrapErrMsg(TSDBConstants.RESULT_SET_IS_CLOSED)); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_RESULTSET_CLOSED);
int columnIndex = columnNames.indexOf(columnLabel); int columnIndex = columnNames.indexOf(columnLabel);
if (columnIndex == -1) if (columnIndex == -1)
...@@ -244,14 +244,14 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet { ...@@ -244,14 +244,14 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet {
@Override @Override
public boolean isBeforeFirst() throws SQLException { public boolean isBeforeFirst() throws SQLException {
if (isClosed()) if (isClosed())
throw new SQLException(TSDBConstants.WrapErrMsg(TSDBConstants.RESULT_SET_IS_CLOSED)); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_RESULTSET_CLOSED);
return this.pos == -1 && this.resultSet.size() != 0; return this.pos == -1 && this.resultSet.size() != 0;
} }
@Override @Override
public boolean isAfterLast() throws SQLException { public boolean isAfterLast() throws SQLException {
if (isClosed()) if (isClosed())
throw new SQLException(TSDBConstants.WrapErrMsg(TSDBConstants.RESULT_SET_IS_CLOSED)); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_RESULTSET_CLOSED);
return this.pos >= resultSet.size() && this.resultSet.size() != 0; return this.pos >= resultSet.size() && this.resultSet.size() != 0;
} }
...@@ -259,14 +259,14 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet { ...@@ -259,14 +259,14 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet {
@Override @Override
public boolean isFirst() throws SQLException { public boolean isFirst() throws SQLException {
if (isClosed()) if (isClosed())
throw new SQLException(TSDBConstants.WrapErrMsg(TSDBConstants.RESULT_SET_IS_CLOSED)); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_RESULTSET_CLOSED);
return this.pos == 0; return this.pos == 0;
} }
@Override @Override
public boolean isLast() throws SQLException { public boolean isLast() throws SQLException {
if (isClosed()) if (isClosed())
throw new SQLException(TSDBConstants.WrapErrMsg(TSDBConstants.RESULT_SET_IS_CLOSED)); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_RESULTSET_CLOSED);
if (this.resultSet.size() == 0) if (this.resultSet.size() == 0)
return false; return false;
return this.pos == (this.resultSet.size() - 1); return this.pos == (this.resultSet.size() - 1);
...@@ -275,7 +275,7 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet { ...@@ -275,7 +275,7 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet {
@Override @Override
public void beforeFirst() throws SQLException { public void beforeFirst() throws SQLException {
if (isClosed()) if (isClosed())
throw new SQLException(TSDBConstants.WrapErrMsg(TSDBConstants.RESULT_SET_IS_CLOSED)); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_RESULTSET_CLOSED);
synchronized (this) { synchronized (this) {
if (this.resultSet.size() > 0) { if (this.resultSet.size() > 0) {
...@@ -287,7 +287,7 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet { ...@@ -287,7 +287,7 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet {
@Override @Override
public void afterLast() throws SQLException { public void afterLast() throws SQLException {
if (isClosed()) if (isClosed())
throw new SQLException(TSDBConstants.WrapErrMsg(TSDBConstants.RESULT_SET_IS_CLOSED)); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_RESULTSET_CLOSED);
synchronized (this) { synchronized (this) {
if (this.resultSet.size() > 0) { if (this.resultSet.size() > 0) {
this.pos = this.resultSet.size(); this.pos = this.resultSet.size();
...@@ -298,7 +298,7 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet { ...@@ -298,7 +298,7 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet {
@Override @Override
public boolean first() throws SQLException { public boolean first() throws SQLException {
if (isClosed()) if (isClosed())
throw new SQLException(TSDBConstants.WrapErrMsg(TSDBConstants.RESULT_SET_IS_CLOSED)); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_RESULTSET_CLOSED);
if (this.resultSet.size() == 0) if (this.resultSet.size() == 0)
return false; return false;
...@@ -312,7 +312,7 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet { ...@@ -312,7 +312,7 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet {
@Override @Override
public boolean last() throws SQLException { public boolean last() throws SQLException {
if (isClosed()) if (isClosed())
throw new SQLException(TSDBConstants.WrapErrMsg(TSDBConstants.RESULT_SET_IS_CLOSED)); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_RESULTSET_CLOSED);
if (this.resultSet.size() == 0) if (this.resultSet.size() == 0)
return false; return false;
synchronized (this) { synchronized (this) {
...@@ -324,7 +324,7 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet { ...@@ -324,7 +324,7 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet {
@Override @Override
public int getRow() throws SQLException { public int getRow() throws SQLException {
if (isClosed()) if (isClosed())
throw new SQLException(TSDBConstants.WrapErrMsg(TSDBConstants.RESULT_SET_IS_CLOSED)); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_RESULTSET_CLOSED);
int row; int row;
synchronized (this) { synchronized (this) {
if (this.pos < 0 || this.pos >= this.resultSet.size()) if (this.pos < 0 || this.pos >= this.resultSet.size())
...@@ -396,7 +396,7 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet { ...@@ -396,7 +396,7 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet {
@Override @Override
public Statement getStatement() throws SQLException { public Statement getStatement() throws SQLException {
if (isClosed()) if (isClosed())
throw new SQLException(TSDBConstants.WrapErrMsg(TSDBConstants.RESULT_SET_IS_CLOSED)); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_RESULTSET_CLOSED);
return this.statement; return this.statement;
} }
...@@ -407,5 +407,4 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet { ...@@ -407,5 +407,4 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet {
} }
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册