summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-02-25 13:38:38 +0200
committerNoel Grandin <noel@peralex.com>2016-02-25 13:50:26 +0200
commit414a66587b73dfc69c121118e9a6337de4e843d2 (patch)
tree425457f56fc3454bcea051b702fb8fa7340eea34 /connectivity
parent960d4ebf76d3e7c757d2625a1e52a22556da9d40 (diff)
convert StandardSQLState to scoped enum
Change-Id: Ia0a1526140cfed35a73a6fea1a173d2fb5005960
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/commontools/dbexception.cxx54
-rw-r--r--connectivity/source/commontools/dbmetadata.cxx2
-rw-r--r--connectivity/source/commontools/dbtools.cxx2
-rw-r--r--connectivity/source/drivers/firebird/PreparedStatement.cxx6
-rw-r--r--connectivity/source/drivers/firebird/ResultSet.cxx4
-rw-r--r--connectivity/source/parse/sqliterator.cxx2
6 files changed, 35 insertions, 35 deletions
diff --git a/connectivity/source/commontools/dbexception.cxx b/connectivity/source/commontools/dbexception.cxx
index c46a0d807a5d..911c212d9f47 100644
--- a/connectivity/source/commontools/dbexception.cxx
+++ b/connectivity/source/commontools/dbexception.cxx
@@ -349,7 +349,7 @@ void throwFunctionSequenceException(const Reference< XInterface >& _Context, con
throw SQLException(
aResources.getResourceString(STR_ERRORMSG_SEQUENCE),
_Context,
- getStandardSQLState( SQL_FUNCTION_SEQUENCE_ERROR ),
+ getStandardSQLState( StandardSQLState::FUNCTION_SEQUENCE_ERROR ),
0,
_Next
);
@@ -362,7 +362,7 @@ void throwInvalidIndexException(const ::com::sun::star::uno::Reference< ::com::s
throw SQLException(
aResources.getResourceString(STR_INVALID_INDEX),
_Context,
- getStandardSQLState( SQL_INVALID_DESCRIPTOR_INDEX ),
+ getStandardSQLState( StandardSQLState::INVALID_DESCRIPTOR_INDEX ),
0,
_Next
);
@@ -380,7 +380,7 @@ void throwFunctionNotSupportedSQLException(const OUString& _rFunctionName,
throw SQLException(
sError,
_rxContext,
- getStandardSQLState( SQL_FUNCTION_NOT_SUPPORTED ),
+ getStandardSQLState( StandardSQLState::FUNCTION_NOT_SUPPORTED ),
0,
_rNextException
);
@@ -410,7 +410,7 @@ void throwGenericSQLException(const OUString& _rMsg, const ::com::sun::star::uno
void throwGenericSQLException(const OUString& _rMsg, const Reference< XInterface >& _rxSource, const Any& _rNextException)
throw (SQLException)
{
- throw SQLException( _rMsg, _rxSource, getStandardSQLState( SQL_GENERAL_ERROR ), 0, _rNextException);
+ throw SQLException( _rMsg, _rxSource, getStandardSQLState( StandardSQLState::GENERAL_ERROR ), 0, _rNextException);
}
void throwFeatureNotImplementedSQLException( const OUString& _rFeatureName, const Reference< XInterface >& _rxContext, const Any* _pNextException )
@@ -425,7 +425,7 @@ void throwFeatureNotImplementedSQLException( const OUString& _rFeatureName, cons
throw SQLException(
sError,
_rxContext,
- getStandardSQLState( SQL_FEATURE_NOT_IMPLEMENTED ),
+ getStandardSQLState( StandardSQLState::FEATURE_NOT_IMPLEMENTED ),
0,
_pNextException ? *_pNextException : Any()
);
@@ -450,7 +450,7 @@ void throwInvalidColumnException( const OUString& _rColumnName, const Reference<
OUString sErrorMessage( aResources.getResourceStringWithSubstitution(
STR_INVALID_COLUMNNAME,
"$columnname$",_rColumnName) );
- throwSQLException( sErrorMessage, SQL_COLUMN_NOT_FOUND, _rxContext );
+ throwSQLException( sErrorMessage, StandardSQLState::COLUMN_NOT_FOUND, _rxContext );
}
void throwSQLException( const OUString& _rMessage, const OUString& _rSQLState,
@@ -478,27 +478,27 @@ OUString getStandardSQLState( StandardSQLState _eState )
{
switch ( _eState )
{
- case SQL_WRONG_PARAMETER_NUMBER: return OUString("07001");
- case SQL_INVALID_DESCRIPTOR_INDEX: return OUString("07009");
- case SQL_UNABLE_TO_CONNECT: return OUString("08001");
- case SQL_NUMERIC_OUT_OF_RANGE: return OUString("22003");
- case SQL_INVALID_DATE_TIME: return OUString("22007");
- case SQL_INVALID_CURSOR_STATE: return OUString("24000");
- case SQL_TABLE_OR_VIEW_EXISTS: return OUString("42S01");
- case SQL_TABLE_OR_VIEW_NOT_FOUND: return OUString("42S02");
- case SQL_INDEX_ESISTS: return OUString("42S11");
- case SQL_INDEX_NOT_FOUND: return OUString("42S12");
- case SQL_COLUMN_EXISTS: return OUString("42S21");
- case SQL_COLUMN_NOT_FOUND: return OUString("42S22");
- case SQL_GENERAL_ERROR: return OUString("HY000");
- case SQL_INVALID_SQL_DATA_TYPE: return OUString("HY004");
- case SQL_OPERATION_CANCELED: return OUString("HY008");
- case SQL_FUNCTION_SEQUENCE_ERROR: return OUString("HY010");
- case SQL_INVALID_CURSOR_POSITION: return OUString("HY109");
- case SQL_INVALID_BOOKMARK_VALUE: return OUString("HY111");
- case SQL_FEATURE_NOT_IMPLEMENTED: return OUString("HYC00");
- case SQL_FUNCTION_NOT_SUPPORTED: return OUString("IM001");
- case SQL_CONNECTION_DOES_NOT_EXIST: return OUString("08003");
+ case StandardSQLState::WRONG_PARAMETER_NUMBER: return OUString("07001");
+ case StandardSQLState::INVALID_DESCRIPTOR_INDEX: return OUString("07009");
+ case StandardSQLState::UNABLE_TO_CONNECT: return OUString("08001");
+ case StandardSQLState::NUMERIC_OUT_OF_RANGE: return OUString("22003");
+ case StandardSQLState::INVALID_DATE_TIME: return OUString("22007");
+ case StandardSQLState::INVALID_CURSOR_STATE: return OUString("24000");
+ case StandardSQLState::TABLE_OR_VIEW_EXISTS: return OUString("42S01");
+ case StandardSQLState::TABLE_OR_VIEW_NOT_FOUND: return OUString("42S02");
+ case StandardSQLState::INDEX_ESISTS: return OUString("42S11");
+ case StandardSQLState::INDEX_NOT_FOUND: return OUString("42S12");
+ case StandardSQLState::COLUMN_EXISTS: return OUString("42S21");
+ case StandardSQLState::COLUMN_NOT_FOUND: return OUString("42S22");
+ case StandardSQLState::GENERAL_ERROR: return OUString("HY000");
+ case StandardSQLState::INVALID_SQL_DATA_TYPE: return OUString("HY004");
+ case StandardSQLState::OPERATION_CANCELED: return OUString("HY008");
+ case StandardSQLState::FUNCTION_SEQUENCE_ERROR: return OUString("HY010");
+ case StandardSQLState::INVALID_CURSOR_POSITION: return OUString("HY109");
+ case StandardSQLState::INVALID_BOOKMARK_VALUE: return OUString("HY111");
+ case StandardSQLState::FEATURE_NOT_IMPLEMENTED: return OUString("HYC00");
+ case StandardSQLState::FUNCTION_NOT_SUPPORTED: return OUString("IM001");
+ case StandardSQLState::CONNECTION_DOES_NOT_EXIST: return OUString("08003");
default: return OUString("HY001"); // General Error
}
}
diff --git a/connectivity/source/commontools/dbmetadata.cxx b/connectivity/source/commontools/dbmetadata.cxx
index 1498478a711f..26f857fe8948 100644
--- a/connectivity/source/commontools/dbmetadata.cxx
+++ b/connectivity/source/commontools/dbmetadata.cxx
@@ -113,7 +113,7 @@ namespace dbtools
{
::connectivity::SharedResources aResources;
const OUString sError( aResources.getResourceString(STR_NO_CONNECTION_GIVEN));
- throwSQLException( sError, SQL_CONNECTION_DOES_NOT_EXIST, nullptr );
+ throwSQLException( sError, StandardSQLState::CONNECTION_DOES_NOT_EXIST, nullptr );
}
}
diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx
index e7b11fc3fafc..3baab99890d7 100644
--- a/connectivity/source/commontools/dbtools.cxx
+++ b/connectivity/source/commontools/dbtools.cxx
@@ -737,7 +737,7 @@ SQLException prependErrorInfo( const SQLException& _rChainedException, const Ref
const OUString& _rAdditionalError, const StandardSQLState _eSQLState, const sal_Int32 _nErrorCode )
{
return SQLException( _rAdditionalError, _rxContext,
- _eSQLState == SQL_ERROR_UNSPECIFIED ? OUString() : getStandardSQLState( _eSQLState ),
+ _eSQLState == StandardSQLState::ERROR_UNSPECIFIED ? OUString() : getStandardSQLState( _eSQLState ),
_nErrorCode, makeAny( _rChainedException ) );
}
diff --git a/connectivity/source/drivers/firebird/PreparedStatement.cxx b/connectivity/source/drivers/firebird/PreparedStatement.cxx
index 6ebc8ac7303d..ac2778fb91f7 100644
--- a/connectivity/source/drivers/firebird/PreparedStatement.cxx
+++ b/connectivity/source/drivers/firebird/PreparedStatement.cxx
@@ -226,7 +226,7 @@ void SAL_CALL OPreparedStatement::setString(sal_Int32 nParameterIndex,
default:
::dbtools::throwSQLException(
"Incorrect type for setString",
- ::dbtools::SQL_INVALID_SQL_DATA_TYPE,
+ ::dbtools::StandardSQLState::INVALID_SQL_DATA_TYPE,
*this);
}
}
@@ -342,7 +342,7 @@ void OPreparedStatement::setValue(sal_Int32 nIndex, T& nValue, ISC_SHORT nType)
{
::dbtools::throwSQLException(
"Incorrect type for setString",
- ::dbtools::SQL_INVALID_SQL_DATA_TYPE,
+ ::dbtools::StandardSQLState::INVALID_SQL_DATA_TYPE,
*this);
}
@@ -693,7 +693,7 @@ void OPreparedStatement::checkParameterIndex(sal_Int32 nParameterIndex)
{
::dbtools::throwSQLException(
"No column " + OUString::number(nParameterIndex),
- ::dbtools::SQL_COLUMN_NOT_FOUND,
+ ::dbtools::StandardSQLState::COLUMN_NOT_FOUND,
*this);
}
}
diff --git a/connectivity/source/drivers/firebird/ResultSet.cxx b/connectivity/source/drivers/firebird/ResultSet.cxx
index 764f561c245d..edb09269b963 100644
--- a/connectivity/source/drivers/firebird/ResultSet.cxx
+++ b/connectivity/source/drivers/firebird/ResultSet.cxx
@@ -288,7 +288,7 @@ void SAL_CALL OResultSet::checkColumnIndex(sal_Int32 nIndex)
{
::dbtools::throwSQLException(
"No column " + OUString::number(nIndex),
- ::dbtools::SQL_COLUMN_NOT_FOUND,
+ ::dbtools::StandardSQLState::COLUMN_NOT_FOUND,
*this);
}
}
@@ -303,7 +303,7 @@ void SAL_CALL OResultSet::checkRowIndex()
{
::dbtools::throwSQLException(
"Invalid Row",
- ::dbtools::SQL_INVALID_CURSOR_POSITION,
+ ::dbtools::StandardSQLState::INVALID_CURSOR_POSITION,
*this);
}
}
diff --git a/connectivity/source/parse/sqliterator.cxx b/connectivity/source/parse/sqliterator.cxx
index 64942d33c116..4f42b96b4301 100644
--- a/connectivity/source/parse/sqliterator.cxx
+++ b/connectivity/source/parse/sqliterator.cxx
@@ -2088,7 +2088,7 @@ void OSQLParseTreeIterator::impl_appendError( IParseContext::ErrorCode _eError,
}
impl_appendError( SQLException(
- sErrorMessage, nullptr, getStandardSQLState( SQL_GENERAL_ERROR ), 1000, Any() ) );
+ sErrorMessage, nullptr, getStandardSQLState( StandardSQLState::GENERAL_ERROR ), 1000, Any() ) );
}