net.sourceforge.squirrel_sql.plugins.oracle.exception
Class OracleExceptionFormatter

java.lang.Object
  extended by net.sourceforge.squirrel_sql.client.session.event.SessionAdapter
      extended by net.sourceforge.squirrel_sql.plugins.oracle.exception.OracleExceptionFormatter
All Implemented Interfaces:
EventListener, ISessionListener, ExceptionFormatter

public class OracleExceptionFormatter
extends SessionAdapter
implements ISessionListener, ExceptionFormatter

An ExceptionFormatter for Oracle which adds the position of the syntax error and moves the caret position to that error position. It does nothing else to format the exception, beyond what the default formatter does.

Author:
manningr

Field Summary
static String OFFSET_FUNCTION_NAME
          The name to give to our function.
 
Constructor Summary
OracleExceptionFormatter()
           
 
Method Summary
 void allSessionsClosed()
           
 String format(Throwable t)
          Pass through to default formatter, detecting the error position and setting the caret position appropriately.
 boolean formatsException(Throwable t)
           
 void sessionClosed(SessionEvent evt)
           
 void sessionClosing(SessionEvent evt)
           
 void setSession(ISession session)
          Sets the Oracle session that this formatter is associated with.
 
Methods inherited from class net.sourceforge.squirrel_sql.client.session.event.SessionAdapter
connectionClosedForReconnect, reconnected, reconnectFailed, sessionActivated, sessionConnected, sessionFinalized
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sourceforge.squirrel_sql.client.session.event.ISessionListener
connectionClosedForReconnect, reconnected, reconnectFailed, sessionActivated, sessionConnected, sessionFinalized
 

Field Detail

OFFSET_FUNCTION_NAME

public static final String OFFSET_FUNCTION_NAME
The name to give to our function. Oracle doesn't support anonymous function blocks.

See Also:
Constant Field Values
Constructor Detail

OracleExceptionFormatter

public OracleExceptionFormatter()
Method Detail

setSession

public void setSession(ISession session)
Sets the Oracle session that this formatter is associated with.

Parameters:
session - the session

format

public String format(Throwable t)
              throws Exception
Pass through to default formatter, detecting the error position and setting the caret position appropriately.

Specified by:
format in interface ExceptionFormatter
Throws:
Exception
See Also:
ExceptionFormatter.format(java.lang.Throwable)

formatsException

public boolean formatsException(Throwable t)
Specified by:
formatsException in interface ExceptionFormatter
See Also:
ExceptionFormatter.formatsException(java.lang.Throwable)

allSessionsClosed

public void allSessionsClosed()
Specified by:
allSessionsClosed in interface ISessionListener
Overrides:
allSessionsClosed in class SessionAdapter
See Also:
ISessionListener.allSessionsClosed()

sessionClosed

public void sessionClosed(SessionEvent evt)
Specified by:
sessionClosed in interface ISessionListener
Overrides:
sessionClosed in class SessionAdapter
See Also:
ISessionListener.sessionClosed(net.sourceforge.squirrel_sql.client.session.event.SessionEvent)

sessionClosing

public void sessionClosing(SessionEvent evt)
Specified by:
sessionClosing in interface ISessionListener
Overrides:
sessionClosing in class SessionAdapter
See Also:
ISessionListener.sessionClosing(net.sourceforge.squirrel_sql.client.session.event.SessionEvent)


Copyright © 2001-2010. All Rights Reserved.