Package oracle.jdbc.babelfish
Class Translator
- java.lang.Object
-
- oracle.jdbc.babelfish.Translator
-
public class Translator extends Object
Translates queries and errors. If a connection is available the translation happens on the server else for errors related to connection establishment the translator tries to translate using the translations available in the local error translation file.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
activateServerTranslation(Connection babelfishConnection)
The Translator by default starts in Local mode since the translator can be used to translate connection attempt errors.protected oracle.jdbc.internal.OracleConnection
getConnectionDuringExceptionHandling()
SQLException
translateError(SQLException ex)
Translate the error codes.
-
-
-
Method Detail
-
translateError
public SQLException translateError(SQLException ex) throws SQLException
Translate the error codes. If a connection to the server is established then the translation happens on the server. If connection is not available then if a local error translation file is used and contains a translation then its used.- Parameters:
ex
- SQLException with oracle error codes to be translated- Returns:
- SQLException with translated error codes
- Throws:
SQLException
-
activateServerTranslation
public void activateServerTranslation(Connection babelfishConnection) throws SQLException
The Translator by default starts in Local mode since the translator can be used to translate connection attempt errors. Once the connection is established it can be provided to the translator using this method thus putting the translator in Server mode. IN Local mode only error translations are possible and the translation will happen using the Local Error Translation File provided as a connection property. In Server mode it will delegate the translation to the server.- Parameters:
babelfishConnection
-- Throws:
SQLException
-
getConnectionDuringExceptionHandling
protected oracle.jdbc.internal.OracleConnection getConnectionDuringExceptionHandling()
-
-