Modified: 
incubator/derby/code/trunk/java/client/org/apache/derby/client/am/ResultSetCallbackInterface.java
URL: 
http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/client/org/apache/derby/client/am/ResultSetCallbackInterface.java?rev=165585&r1=165584&r2=165585&view=diff
==============================================================================
--- 
incubator/derby/code/trunk/java/client/org/apache/derby/client/am/ResultSetCallbackInterface.java
 (original)
+++ 
incubator/derby/code/trunk/java/client/org/apache/derby/client/am/ResultSetCallbackInterface.java
 Sun May  1 23:25:59 2005
@@ -24,16 +24,17 @@
 // certain events that may originate from the material or common layers.
 //
 // Reply implementations may update result set state via this interface.
-public interface ResultSetCallbackInterface
-{
-  // The query was ended at the server because all rows have been retrieved.
-  public void earlyCloseComplete (Sqlca sqlca);
 
-  public int completeSqlca (Sqlca sqlca);
+public interface ResultSetCallbackInterface {
+    // The query was ended at the server because all rows have been retrieved.
+    public void earlyCloseComplete(Sqlca sqlca);
 
-  // Chain a warning on the result set object.
-  public void accumulateWarning (SqlWarning e);
+    public int completeSqlca(Sqlca sqlca);
 
-  public StatementCallbackInterface getStatementCallbackInterface ();
-  public ConnectionCallbackInterface getConnectionCallbackInterface ();
+    // Chain a warning on the result set object.
+    public void accumulateWarning(SqlWarning e);
+
+    public StatementCallbackInterface getStatementCallbackInterface();
+
+    public ConnectionCallbackInterface getConnectionCallbackInterface();
 }

Modified: 
incubator/derby/code/trunk/java/client/org/apache/derby/client/am/Savepoint.java
URL: 
http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/client/org/apache/derby/client/am/Savepoint.java?rev=165585&r1=165584&r2=165585&view=diff
==============================================================================
--- 
incubator/derby/code/trunk/java/client/org/apache/derby/client/am/Savepoint.java
 (original)
+++ 
incubator/derby/code/trunk/java/client/org/apache/derby/client/am/Savepoint.java
 Sun May  1 23:25:59 2005
@@ -20,45 +20,42 @@
 
 package org.apache.derby.client.am;
 
-public class Savepoint implements java.sql.Savepoint
-{
-  // ----------------- internals 
-----------------------------------------------
-
-  int savepointId_ = 0;
-  String savepointName_ = null;
-  Agent agent_;
-
-  
//---------------------constructors/finalizer---------------------------------
-
-  // create a named savepoint.
-  Savepoint (Agent agent, String savepointName)
-  {
-    agent_ = agent;
-    savepointName_ = savepointName;
-  }
-
-  // create an un-named savepoint.
-  Savepoint (Agent agent, int savepointId)
-  {
-    agent_ = agent;
-    savepointId_ = savepointId;
-  }
-
-  // ----------------- externals 
-----------------------------------------------
-
-  public int getSavepointId() throws SqlException
-  {
-    if (savepointId_ != 0)
-      return savepointId_;
-    else
-      throw new SqlException (agent_.logWriter_, "This is a named savepoint.");
-  }
-
-  public String getSavepointName() throws SqlException
-  {
-    if (savepointName_ != null)
-      return savepointName_;
-    else
-      throw new SqlException (agent_.logWriter_, "This is an un-named 
savepoint.");
-  }
+public class Savepoint implements java.sql.Savepoint {
+    // ----------------- internals 
-----------------------------------------------
+
+    int savepointId_ = 0;
+    String savepointName_ = null;
+    Agent agent_;
+
+    
//---------------------constructors/finalizer---------------------------------
+
+    // create a named savepoint.
+    Savepoint(Agent agent, String savepointName) {
+        agent_ = agent;
+        savepointName_ = savepointName;
+    }
+
+    // create an un-named savepoint.
+    Savepoint(Agent agent, int savepointId) {
+        agent_ = agent;
+        savepointId_ = savepointId;
+    }
+
+    // ----------------- externals 
-----------------------------------------------
+
+    public int getSavepointId() throws SqlException {
+        if (savepointId_ != 0) {
+            return savepointId_;
+        } else {
+            throw new SqlException(agent_.logWriter_, "This is a named 
savepoint.");
+        }
+    }
+
+    public String getSavepointName() throws SqlException {
+        if (savepointName_ != null) {
+            return savepointName_;
+        } else {
+            throw new SqlException(agent_.logWriter_, "This is an un-named 
savepoint.");
+        }
+    }
 }

Modified: 
incubator/derby/code/trunk/java/client/org/apache/derby/client/am/Section.java
URL: 
http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/client/org/apache/derby/client/am/Section.java?rev=165585&r1=165584&r2=165585&view=diff
==============================================================================
--- 
incubator/derby/code/trunk/java/client/org/apache/derby/client/am/Section.java 
(original)
+++ 
incubator/derby/code/trunk/java/client/org/apache/derby/client/am/Section.java 
Sun May  1 23:25:59 2005
@@ -17,146 +17,131 @@
 
 package org.apache.derby.client.am;
 
-public class Section
-{
+public class Section {
 
-  protected int sectionNumber;
-  protected String packageName;
-  protected String serverCursorName; // As given by dnc package set
-  int resultSetHoldability_;
-  
-  // Stores the package name and consistency token  
-  byte[] PKGNAMCBytes; 
-  boolean isGenerated; // flag to identify server generated sections
-
-  public Section (Agent agent, String name, int sectionNumber, String 
cursorName, int resultSetHoldability)
-  {
-     // default for all sections except for generated section , isGenerated is 
set to false
-     init(agent,name,sectionNumber,cursorName,resultSetHoldability,false);
-  }
-
-  public Section (Agent agent, String name, int sectionNumber, String 
cursorName, int resultSetHoldability,boolean isGenerated)
-  {
-     
init(agent,name,sectionNumber,cursorName,resultSetHoldability,isGenerated);
-  }
-
-  private void init (Agent agent, String name, int sectionNumber, String 
cursorName, int resultSetHoldability,boolean isGenerated)
-  {
-    this.packageName = name;
-    this.sectionNumber = sectionNumber;
-    this.serverCursorName = cursorName;
-    resultSetHoldability_ = resultSetHoldability;
-    agent_ = agent;
-    this.isGenerated = isGenerated;
-
-    // Store the packagename and consistency token bytes depending on the 
holdability
-    // PKGNAMCBytes will point to the appropriate byte array in SectionManager
-    // that stores the PKGNAMCBytes for reuse
-    // There are 2 byte arrays in SectionManager
-    // 1. holdPKGNAMCBytes which stores the PKGNAMCBytes when holdability is 
set
-    // 2. noHoldPKGNAMCBytes which stores the PKGNAMCBytes when holdability is 
non hold
-    // Note for generated sections, PKGNAMCBytes is generated by the server.
-    if(!isGenerated)
-    {
-       if (resultSetHoldability_ == ResultSet.HOLD_CURSORS_OVER_COMMIT)
-         PKGNAMCBytes = agent_.sectionManager_.holdPKGNAMCBytes;
-       else if (resultSetHoldability_ == ResultSet.CLOSE_CURSORS_AT_COMMIT)
-         PKGNAMCBytes = agent_.sectionManager_.noHoldPKGNAMCBytes;
-    }
-  }
-
-  /**
-   *  Store the Packagename and consistency token information 
-   *  for reuse. 
-   *  Case 1: if it is generated section, just store the byte array in 
PKGNAMCBytes
-   *  Case 2: for not a generated section, information is stored in the 
correct byte array
-   *  depending on the holdability in SectionManager  
-   */
-  public void setPKGNAMCBytes(byte[] b)
-  {
-     if(isGenerated)
-        PKGNAMCBytes = b;
-     else 
-        agent_.sectionManager_.setPKGNAMCBytes(b,resultSetHoldability_);
-  }
-
-  /**
-   * retrieve the package name and consistency token information
-   */
-  public byte[] getPKGNAMCBytes()
-  {
-     return PKGNAMCBytes;
-  }
-
-  public String getPackageName() { return this.packageName; }
-
-
-  // Add a finalizer to free() the section, useful for Statement.executes that 
result in exceptions
-
-  public int getSectionNumber ()
-  {
-    return this.sectionNumber;
-  }
-
-  public String getPackage ()
-  {
-    return this.packageName;
-  }
-
-  public String getServerCursorName ()
-  {
-    return this.serverCursorName;
-  }
-
-  // ------------------------ transient members 
--------------------------------
-
-  public String serverCursorNameForPositionedUpdate_ = null; // member for 
positioned update sections only
-  transient protected String clientCursorName_; // As given by jdbc 
setCursorName(), this can change
-
-  public String getServerCursorNameForPositionedUpdate ()
-  {
-    return serverCursorNameForPositionedUpdate_;
-  }
-
-  public String getClientCursorName ()
-  {
-    return clientCursorName_;
-  }
-
-  public void setClientCursorName (String clientCursorName)
-  { //
-    //System.out.println("clientCursorName is set"+ clientCursorName);
-    this.clientCursorName_ = clientCursorName;
-  }
-
-  protected Agent agent_;
-
-
-  public void free ()
-  {
-    if (resultSetHoldability_ != -1)
-      this.agent_.sectionManager_.freeSection(this, resultSetHoldability_);
-  }
-
-  public boolean isReservedPositionedUpdate ()
-  {
-    return false;
-  }
-
-  public int getStaticStatementType ()
-  {
-    return 0;
-  }
-
-  public Section getPositionedUpdateSection () throws java.sql.SQLException
-  {
-    return agent_.sectionManager_.getPositionedUpdateSection (this);
-  }
-
-  public void setCursorName (String name)
-  {
-    serverCursorName = name;
-  }
+    protected int sectionNumber;
+    protected String packageName;
+    protected String serverCursorName; // As given by dnc package set
+    int resultSetHoldability_;
+
+    // Stores the package name and consistency token
+    byte[] PKGNAMCBytes;
+    boolean isGenerated; // flag to identify server generated sections
+
+    public Section(Agent agent, String name, int sectionNumber, String 
cursorName, int resultSetHoldability) {
+        // default for all sections except for generated section , isGenerated 
is set to false
+        init(agent, name, sectionNumber, cursorName, resultSetHoldability, 
false);
+    }
+
+    public Section(Agent agent, String name, int sectionNumber, String 
cursorName, int resultSetHoldability, boolean isGenerated) {
+        init(agent, name, sectionNumber, cursorName, resultSetHoldability, 
isGenerated);
+    }
+
+    private void init(Agent agent, String name, int sectionNumber, String 
cursorName, int resultSetHoldability, boolean isGenerated) {
+        this.packageName = name;
+        this.sectionNumber = sectionNumber;
+        this.serverCursorName = cursorName;
+        resultSetHoldability_ = resultSetHoldability;
+        agent_ = agent;
+        this.isGenerated = isGenerated;
+
+        // Store the packagename and consistency token bytes depending on the 
holdability
+        // PKGNAMCBytes will point to the appropriate byte array in 
SectionManager
+        // that stores the PKGNAMCBytes for reuse
+        // There are 2 byte arrays in SectionManager
+        // 1. holdPKGNAMCBytes which stores the PKGNAMCBytes when holdability 
is set
+        // 2. noHoldPKGNAMCBytes which stores the PKGNAMCBytes when 
holdability is non hold
+        // Note for generated sections, PKGNAMCBytes is generated by the 
server.
+        if (!isGenerated) {
+            if (resultSetHoldability_ == ResultSet.HOLD_CURSORS_OVER_COMMIT) {
+                PKGNAMCBytes = agent_.sectionManager_.holdPKGNAMCBytes;
+            } else if (resultSetHoldability_ == 
ResultSet.CLOSE_CURSORS_AT_COMMIT) {
+                PKGNAMCBytes = agent_.sectionManager_.noHoldPKGNAMCBytes;
+            }
+        }
+    }
+
+    /**
+     * Store the Packagename and consistency token information for reuse. Case 
1: if it is generated section, just store
+     * the byte array in PKGNAMCBytes Case 2: for not a generated section, 
information is stored in the correct byte
+     * array depending on the holdability in SectionManager
+     */
+    public void setPKGNAMCBytes(byte[] b) {
+        if (isGenerated) {
+            PKGNAMCBytes = b;
+        } else {
+            agent_.sectionManager_.setPKGNAMCBytes(b, resultSetHoldability_);
+        }
+    }
+
+    /**
+     * retrieve the package name and consistency token information
+     */
+    public byte[] getPKGNAMCBytes() {
+        return PKGNAMCBytes;
+    }
+
+    public String getPackageName() {
+        return this.packageName;
+    }
+
+
+    // Add a finalizer to free() the section, useful for Statement.executes 
that result in exceptions
+
+    public int getSectionNumber() {
+        return this.sectionNumber;
+    }
+
+    public String getPackage() {
+        return this.packageName;
+    }
+
+    public String getServerCursorName() {
+        return this.serverCursorName;
+    }
+
+    // ------------------------ transient members 
--------------------------------
+
+    public String serverCursorNameForPositionedUpdate_ = null; // member for 
positioned update sections only
+    transient protected String clientCursorName_; // As given by jdbc 
setCursorName(), this can change
+
+    public String getServerCursorNameForPositionedUpdate() {
+        return serverCursorNameForPositionedUpdate_;
+    }
+
+    public String getClientCursorName() {
+        return clientCursorName_;
+    }
+
+    public void setClientCursorName(String clientCursorName) { //
+        //System.out.println("clientCursorName is set"+ clientCursorName);
+        this.clientCursorName_ = clientCursorName;
+    }
+
+    protected Agent agent_;
+
+
+    public void free() {
+        if (resultSetHoldability_ != -1) {
+            this.agent_.sectionManager_.freeSection(this, 
resultSetHoldability_);
+        }
+    }
+
+    public boolean isReservedPositionedUpdate() {
+        return false;
+    }
+
+    public int getStaticStatementType() {
+        return 0;
+    }
+
+    public Section getPositionedUpdateSection() throws java.sql.SQLException {
+        return agent_.sectionManager_.getPositionedUpdateSection(this);
+    }
+
+    public void setCursorName(String name) {
+        serverCursorName = name;
+    }
 
 }
 

Modified: 
incubator/derby/code/trunk/java/client/org/apache/derby/client/am/SectionManager.java
URL: 
http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/client/org/apache/derby/client/am/SectionManager.java?rev=165585&r1=165584&r2=165585&view=diff
==============================================================================
--- 
incubator/derby/code/trunk/java/client/org/apache/derby/client/am/SectionManager.java
 (original)
+++ 
incubator/derby/code/trunk/java/client/org/apache/derby/client/am/SectionManager.java
 Sun May  1 23:25:59 2005
@@ -21,199 +21,191 @@
 package org.apache.derby.client.am;
 
 
-public class SectionManager
-{
-  String collection_;
-  Agent agent_;
-
-  // Cursor holdability attributes used as package cluster indices.
-  // Not defined in PackageBindOptions because this attribute is part of the
-  // declare cursor [with hold] sql string based on section binds.
-  // By convention, we bind all sections in the same package with
-  // the same holdability.
-  final static int HOLD = 0;
-  final static int NO_HOLD = 1;
-
-  // The following stack of available sections is
-  // for pooling and recycling previously used sections.
-  // For performance, the section objects themselves are pooled,
-  // rather than just keeping track of free section numbers;
-  // this way, we don't have to new-up a section if one is available in the 
pool.
-  java.util.Stack freeSectionsNonHold_ = null;
-  java.util.Stack freeSectionsHold_ = null;
-
-  int nextAvailableSectionNumber_ = 1;
-
-  // store package consistency token information and initialized in
-  // setPKGNAMCBytes 
-  // holdPKGNAMCBytes stores PKGNAMCBytes when holdability is hold
-  // noHoldPKGNAMCBytes stores PKGNAMCBytes when holdability is no hold
-  public  static byte[] holdPKGNAMCBytes = null;
-  public  static byte[] noHoldPKGNAMCBytes = null;
-
-
-  final static String packageNameWithHold__ = "SYSLH000";
-  final static String packageNameWithNoHold__ = "SYSLN000";
-
-  final static String cursorNamePrefixWithHold__ = "SQL_CURLH000C";
-  final static String cursorNamePrefixWithNoHold__ = "SQL_CURLN000C";
-
-  // Jdbc 1 positioned updates are implemented via
-  // sql scan for "...where current of <users-cursor-name>",
-  // the addition of mappings from cursor names to query sections,
-  // and the subtitution of <users-cursor-name> with <canned-cursor-name> in 
the pass-thru sql string
-  // "...where current of <canned-cursor-name>" when user-defined cursor names 
are used.
-  // Both "canned" cursor names (from our jdbc package set) and user-defined 
cursor names are mapped.
-  // Statement.cursorName_ is initialized to null until the cursor name is 
requested or set.
-  // When set (s.setCursorName()) with a user-defined name, then it is added 
to the cursor map at that time;
-  // When requested (rs.getCursorName()), if the cursor name is still null,
-  // then is given the canned cursor name as defined by our jdbc package set 
and added to the cursor map.
-  // Still need to consider how positioned updates should interact with 
multiple result sets from a stored.
-  private java.util.Hashtable positionedUpdateCursorNameToQuerySection_ = new 
java.util.Hashtable();
-
-  // Cursor name to ResultSet mapping is needed for positioned updates to 
check whether
-  // a ResultSet is scrollable.  If so, exception is thrown.
-  private java.util.Hashtable positionedUpdateCursorNameToResultSet_ = new 
java.util.Hashtable();
-
-  String databaseName;
-
-  int maxNumSections_ = 32768;
-
-  public SectionManager (String collection, Agent agent, String databaseName)
-  {
-    collection_ = collection;
-    agent_ = agent;
-    this.databaseName = databaseName;
-    freeSectionsNonHold_ = new java.util.Stack();
-    freeSectionsHold_ = new java.util.Stack();
-  }
-
-  /**
-   *  Store the Packagename and consistency token information 
-   *  This is called from Section.setPKGNAMCBytes
-   *  @param b bytearray that has the PKGNAMC information to be stored
-   *  @param resultSetHoldability depending on the holdability store it in the 
correct 
-   *                             byte array
-   *  packagename and consistency token information for 
-   *  when holdability is set to HOLD_CURSORS_OVER_COMMIT is stored in 
holdPKGNAMCBytes
-   *  and in noHoldPKGNAMCBytes when holdability is set to 
CLOSE_CURSORS_AT_COMMIT  
-   *
-   */
-  public void setPKGNAMCBytes(byte[] b, int resultSetHoldability)
-  {
-    if(resultSetHoldability == 
org.apache.derby.jdbc.ClientDataSource.HOLD_CURSORS_OVER_COMMIT)
-        agent_.sectionManager_.holdPKGNAMCBytes = b;
-    else if (resultSetHoldability == 
org.apache.derby.jdbc.ClientDataSource.CLOSE_CURSORS_AT_COMMIT)
-       agent_.sectionManager_.noHoldPKGNAMCBytes = b;
-  }
-
-
-  //------------------------entry 
points----------------------------------------
-
-  // Get a section for either a jdbc update or query statement.
-  public Section getDynamicSection (
-                                int resultSetHoldability) throws SqlException
-  {
-    int cursorHoldIndex;
-    if (resultSetHoldability == 
org.apache.derby.jdbc.ClientDataSource.HOLD_CURSORS_OVER_COMMIT) {
-      return getSection (freeSectionsHold_, packageNameWithHold__, 
cursorNamePrefixWithHold__, resultSetHoldability);
-    }
-    else if (resultSetHoldability == 
org.apache.derby.jdbc.ClientDataSource.CLOSE_CURSORS_AT_COMMIT)
-      return getSection (freeSectionsNonHold_, packageNameWithNoHold__, 
cursorNamePrefixWithNoHold__, resultSetHoldability);
-    else
-      throw new SqlException (agent_.logWriter_, "resultSetHoldability 
property " + resultSetHoldability + " not supported");
-  }
-
-  protected Section getSection(java.util.Stack freeSections, String 
packageName, String cursorNamePrefix, int resultSetHoldability) throws 
SqlException
- {
-   if (!freeSections.empty()) {
-     return (Section)freeSections.pop();
-   }
-   else if (nextAvailableSectionNumber_ < (maxNumSections_-1))  {
-     String cursorName = cursorNamePrefix + nextAvailableSectionNumber_;
-     Section section = new Section (agent_, packageName, 
nextAvailableSectionNumber_, cursorName, resultSetHoldability);
-     nextAvailableSectionNumber_++;
-     return section;
-   }
-  else
-  // unfortunately we have run out of sections
-  throw new SqlException(agent_.logWriter_, "Run out of sections to 
use,sections limited to 32k currently");
- }
-
-  public void freeSection (Section section, int resultSetHoldability)
-  {
-    if (resultSetHoldability == 
org.apache.derby.jdbc.ClientDataSource.HOLD_CURSORS_OVER_COMMIT)
-      this.freeSectionsHold_.push(section);
-    else if (resultSetHoldability == 
org.apache.derby.jdbc.ClientDataSource.CLOSE_CURSORS_AT_COMMIT)
-      this.freeSectionsNonHold_.push(section);
-  }
-  // Get a section for a jdbc 2 positioned update/delete for the corresponding 
query.
-  // A positioned update section must come from the same package as its query 
section.
-  Section getPositionedUpdateSection (Section querySection) throws SqlException
-  {
-    Connection connection = agent_.connection_;
-    return getDynamicSection (connection.resultSetHoldability_);
-  }
-
-  // Get a section for a jdbc 1 positioned update/delete for the corresponding 
query.
-  // A positioned update section must come from the same package as its query 
section.
-  Section getPositionedUpdateSection (String cursorName, boolean 
useExecuteImmediateSection) throws SqlException
-  {
-    Section querySection = (Section) 
positionedUpdateCursorNameToQuerySection_.get (cursorName);
-
-    // If querySection is null, then the user must have provided a bad cursor 
name.
-    // Otherwise, get a new section and save the client's cursor name and the 
server's
-    // cursor name to the new section.
-    if (querySection != null) {
-      Section section = getPositionedUpdateSection (querySection);
-      // getPositionedUpdateSection gets the next available section from the 
query
-      // package, and it has a different cursor name associated with the 
section.
-      // We need to save the client's cursor name and server's cursor name to 
the
-      // new section.
-      section.setClientCursorName (querySection.getClientCursorName());
-      section.serverCursorNameForPositionedUpdate_ = 
querySection.getServerCursorName();
-      return section;
-    }
-    else
-      return null;
-  }
-
-  void mapCursorNameToQuerySection (String cursorName, Section section)
-  {
-    positionedUpdateCursorNameToQuerySection_.put (cursorName, section);
-  }
-
-  void mapCursorNameToResultSet (String cursorName, ResultSet resultSet)
-  {
-    positionedUpdateCursorNameToResultSet_.put (cursorName, resultSet);
-  }
-
-  ResultSet getPositionedUpdateResultSet (String cursorName) throws 
SqlException
-  {
-    ResultSet rs = (ResultSet)positionedUpdateCursorNameToResultSet_.get 
(cursorName);
-    if (rs == null)
-      throw new SqlException (agent_.logWriter_, "ResultSet for cursor " +
-                              cursorName + " is closed.");
-    return (rs.resultSetType_ == java.sql.ResultSet.TYPE_FORWARD_ONLY) ? null 
: rs;
-  }
-
-  void removeCursorNameToResultSetMapping (String clientCursorName,
-                                           String serverCursorName)
-  {
-    if (clientCursorName != null)
-      positionedUpdateCursorNameToResultSet_.remove (clientCursorName);
-    if (serverCursorName != null)
-      positionedUpdateCursorNameToResultSet_.remove (serverCursorName);
-  }
-
-  void removeCursorNameToQuerySectionMapping (String clientCursorName,
-                                              String serverCursorName)
-  {
-    if (clientCursorName != null)
-      positionedUpdateCursorNameToQuerySection_.remove (clientCursorName);
-    if (serverCursorName != null)
-      positionedUpdateCursorNameToQuerySection_.remove (serverCursorName);
-  }
+public class SectionManager {
+    String collection_;
+    Agent agent_;
+
+    // Cursor holdability attributes used as package cluster indices.
+    // Not defined in PackageBindOptions because this attribute is part of the
+    // declare cursor [with hold] sql string based on section binds.
+    // By convention, we bind all sections in the same package with
+    // the same holdability.
+    final static int HOLD = 0;
+    final static int NO_HOLD = 1;
+
+    // The following stack of available sections is
+    // for pooling and recycling previously used sections.
+    // For performance, the section objects themselves are pooled,
+    // rather than just keeping track of free section numbers;
+    // this way, we don't have to new-up a section if one is available in the 
pool.
+    java.util.Stack freeSectionsNonHold_ = null;
+    java.util.Stack freeSectionsHold_ = null;
+
+    int nextAvailableSectionNumber_ = 1;
+
+    // store package consistency token information and initialized in
+    // setPKGNAMCBytes
+    // holdPKGNAMCBytes stores PKGNAMCBytes when holdability is hold
+    // noHoldPKGNAMCBytes stores PKGNAMCBytes when holdability is no hold
+    public static byte[] holdPKGNAMCBytes = null;
+    public static byte[] noHoldPKGNAMCBytes = null;
+
+
+    final static String packageNameWithHold__ = "SYSLH000";
+    final static String packageNameWithNoHold__ = "SYSLN000";
+
+    final static String cursorNamePrefixWithHold__ = "SQL_CURLH000C";
+    final static String cursorNamePrefixWithNoHold__ = "SQL_CURLN000C";
+
+    // Jdbc 1 positioned updates are implemented via
+    // sql scan for "...where current of <users-cursor-name>",
+    // the addition of mappings from cursor names to query sections,
+    // and the subtitution of <users-cursor-name> with <canned-cursor-name> in 
the pass-thru sql string
+    // "...where current of <canned-cursor-name>" when user-defined cursor 
names are used.
+    // Both "canned" cursor names (from our jdbc package set) and user-defined 
cursor names are mapped.
+    // Statement.cursorName_ is initialized to null until the cursor name is 
requested or set.
+    // When set (s.setCursorName()) with a user-defined name, then it is added 
to the cursor map at that time;
+    // When requested (rs.getCursorName()), if the cursor name is still null,
+    // then is given the canned cursor name as defined by our jdbc package set 
and added to the cursor map.
+    // Still need to consider how positioned updates should interact with 
multiple result sets from a stored.
+    private java.util.Hashtable positionedUpdateCursorNameToQuerySection_ = 
new java.util.Hashtable();
+
+    // Cursor name to ResultSet mapping is needed for positioned updates to 
check whether
+    // a ResultSet is scrollable.  If so, exception is thrown.
+    private java.util.Hashtable positionedUpdateCursorNameToResultSet_ = new 
java.util.Hashtable();
+
+    String databaseName;
+
+    int maxNumSections_ = 32768;
+
+    public SectionManager(String collection, Agent agent, String databaseName) 
{
+        collection_ = collection;
+        agent_ = agent;
+        this.databaseName = databaseName;
+        freeSectionsNonHold_ = new java.util.Stack();
+        freeSectionsHold_ = new java.util.Stack();
+    }
+
+    /**
+     * Store the Packagename and consistency token information This is called 
from Section.setPKGNAMCBytes
+     *
+     * @param b                    bytearray that has the PKGNAMC information 
to be stored
+     * @param resultSetHoldability depending on the holdability store it in 
the correct byte array packagename and
+     *                             consistency token information for when 
holdability is set to HOLD_CURSORS_OVER_COMMIT
+     *                             is stored in holdPKGNAMCBytes and in 
noHoldPKGNAMCBytes when holdability is set to
+     *                             CLOSE_CURSORS_AT_COMMIT
+     */
+    public void setPKGNAMCBytes(byte[] b, int resultSetHoldability) {
+        if (resultSetHoldability == 
org.apache.derby.jdbc.ClientDataSource.HOLD_CURSORS_OVER_COMMIT) {
+            agent_.sectionManager_.holdPKGNAMCBytes = b;
+        } else if (resultSetHoldability == 
org.apache.derby.jdbc.ClientDataSource.CLOSE_CURSORS_AT_COMMIT) {
+            agent_.sectionManager_.noHoldPKGNAMCBytes = b;
+        }
+    }
+
+
+    //------------------------entry 
points----------------------------------------
+
+    // Get a section for either a jdbc update or query statement.
+    public Section getDynamicSection(int resultSetHoldability) throws 
SqlException {
+        int cursorHoldIndex;
+        if (resultSetHoldability == 
org.apache.derby.jdbc.ClientDataSource.HOLD_CURSORS_OVER_COMMIT) {
+            return getSection(freeSectionsHold_, packageNameWithHold__, 
cursorNamePrefixWithHold__, resultSetHoldability);
+        } else if (resultSetHoldability == 
org.apache.derby.jdbc.ClientDataSource.CLOSE_CURSORS_AT_COMMIT) {
+            return getSection(freeSectionsNonHold_, packageNameWithNoHold__, 
cursorNamePrefixWithNoHold__, resultSetHoldability);
+        } else {
+            throw new SqlException(agent_.logWriter_, "resultSetHoldability 
property " + resultSetHoldability + " not supported");
+        }
+    }
+
+    protected Section getSection(java.util.Stack freeSections, String 
packageName, String cursorNamePrefix, int resultSetHoldability) throws 
SqlException {
+        if (!freeSections.empty()) {
+            return (Section) freeSections.pop();
+        } else if (nextAvailableSectionNumber_ < (maxNumSections_ - 1)) {
+            String cursorName = cursorNamePrefix + nextAvailableSectionNumber_;
+            Section section = new Section(agent_, packageName, 
nextAvailableSectionNumber_, cursorName, resultSetHoldability);
+            nextAvailableSectionNumber_++;
+            return section;
+        } else
+        // unfortunately we have run out of sections
+        {
+            throw new SqlException(agent_.logWriter_, "Run out of sections to 
use,sections limited to 32k currently");
+        }
+    }
+
+    public void freeSection(Section section, int resultSetHoldability) {
+        if (resultSetHoldability == 
org.apache.derby.jdbc.ClientDataSource.HOLD_CURSORS_OVER_COMMIT) {
+            this.freeSectionsHold_.push(section);
+        } else if (resultSetHoldability == 
org.apache.derby.jdbc.ClientDataSource.CLOSE_CURSORS_AT_COMMIT) {
+            this.freeSectionsNonHold_.push(section);
+        }
+    }
+
+    // Get a section for a jdbc 2 positioned update/delete for the 
corresponding query.
+    // A positioned update section must come from the same package as its 
query section.
+    Section getPositionedUpdateSection(Section querySection) throws 
SqlException {
+        Connection connection = agent_.connection_;
+        return getDynamicSection(connection.resultSetHoldability_);
+    }
+
+    // Get a section for a jdbc 1 positioned update/delete for the 
corresponding query.
+    // A positioned update section must come from the same package as its 
query section.
+    Section getPositionedUpdateSection(String cursorName, boolean 
useExecuteImmediateSection) throws SqlException {
+        Section querySection = (Section) 
positionedUpdateCursorNameToQuerySection_.get(cursorName);
+
+        // If querySection is null, then the user must have provided a bad 
cursor name.
+        // Otherwise, get a new section and save the client's cursor name and 
the server's
+        // cursor name to the new section.
+        if (querySection != null) {
+            Section section = getPositionedUpdateSection(querySection);
+            // getPositionedUpdateSection gets the next available section from 
the query
+            // package, and it has a different cursor name associated with the 
section.
+            // We need to save the client's cursor name and server's cursor 
name to the
+            // new section.
+            section.setClientCursorName(querySection.getClientCursorName());
+            section.serverCursorNameForPositionedUpdate_ = 
querySection.getServerCursorName();
+            return section;
+        } else {
+            return null;
+        }
+    }
+
+    void mapCursorNameToQuerySection(String cursorName, Section section) {
+        positionedUpdateCursorNameToQuerySection_.put(cursorName, section);
+    }
+
+    void mapCursorNameToResultSet(String cursorName, ResultSet resultSet) {
+        positionedUpdateCursorNameToResultSet_.put(cursorName, resultSet);
+    }
+
+    ResultSet getPositionedUpdateResultSet(String cursorName) throws 
SqlException {
+        ResultSet rs = (ResultSet) 
positionedUpdateCursorNameToResultSet_.get(cursorName);
+        if (rs == null) {
+            throw new SqlException(agent_.logWriter_, "ResultSet for cursor " +
+                    cursorName + " is closed.");
+        }
+        return (rs.resultSetType_ == java.sql.ResultSet.TYPE_FORWARD_ONLY) ? 
null : rs;
+    }
+
+    void removeCursorNameToResultSetMapping(String clientCursorName,
+                                            String serverCursorName) {
+        if (clientCursorName != null) {
+            positionedUpdateCursorNameToResultSet_.remove(clientCursorName);
+        }
+        if (serverCursorName != null) {
+            positionedUpdateCursorNameToResultSet_.remove(serverCursorName);
+        }
+    }
+
+    void removeCursorNameToQuerySectionMapping(String clientCursorName,
+                                               String serverCursorName) {
+        if (clientCursorName != null) {
+            positionedUpdateCursorNameToQuerySection_.remove(clientCursorName);
+        }
+        if (serverCursorName != null) {
+            positionedUpdateCursorNameToQuerySection_.remove(serverCursorName);
+        }
+    }
 
 }
 

Modified: 
incubator/derby/code/trunk/java/client/org/apache/derby/client/am/SetAccessibleAction.java
URL: 
http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/client/org/apache/derby/client/am/SetAccessibleAction.java?rev=165585&r1=165584&r2=165585&view=diff
==============================================================================
--- 
incubator/derby/code/trunk/java/client/org/apache/derby/client/am/SetAccessibleAction.java
 (original)
+++ 
incubator/derby/code/trunk/java/client/org/apache/derby/client/am/SetAccessibleAction.java
 Sun May  1 23:25:59 2005
@@ -21,25 +21,28 @@
 package org.apache.derby.client.am;
 
 // Java 2 PrivilegedExceptionAction encapsulation of the action to set 
accessible flag of an object
-public class SetAccessibleAction implements 
java.security.PrivilegedExceptionAction
-{
-  private boolean accessible_ = false;
-
-  // provides information about, and dynamic access to, a single field of a 
class or an interface
-  private java.lang.reflect.Field field_ = null;
-
-  public SetAccessibleAction (java.lang.reflect.Field field, boolean 
accessible)
-  {
-    field_ = field;
-    accessible_ = accessible;
-  }
-
-  public Object run ()
-  {
-    field_.setAccessible (accessible_);
-    return null;
-  }
 
-  public void setAccessible (boolean accessible) { accessible_ = accessible; }
-  public void setField (java.lang.reflect.Field field) { field_ = field; }
+public class SetAccessibleAction implements 
java.security.PrivilegedExceptionAction {
+    private boolean accessible_ = false;
+
+    // provides information about, and dynamic access to, a single field of a 
class or an interface
+    private java.lang.reflect.Field field_ = null;
+
+    public SetAccessibleAction(java.lang.reflect.Field field, boolean 
accessible) {
+        field_ = field;
+        accessible_ = accessible;
+    }
+
+    public Object run() {
+        field_.setAccessible(accessible_);
+        return null;
+    }
+
+    public void setAccessible(boolean accessible) {
+        accessible_ = accessible;
+    }
+
+    public void setField(java.lang.reflect.Field field) {
+        field_ = field;
+    }
 }

Modified: 
incubator/derby/code/trunk/java/client/org/apache/derby/client/am/SignedBinary.java
URL: 
http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/client/org/apache/derby/client/am/SignedBinary.java?rev=165585&r1=165584&r2=165585&view=diff
==============================================================================
--- 
incubator/derby/code/trunk/java/client/org/apache/derby/client/am/SignedBinary.java
 (original)
+++ 
incubator/derby/code/trunk/java/client/org/apache/derby/client/am/SignedBinary.java
 Sun May  1 23:25:59 2005
@@ -19,96 +19,90 @@
 */
 package org.apache.derby.client.am;
 
-public class SignedBinary
-{
-  // Hide the default constructor, this is a static class.
-  private SignedBinary () {}
-
-  /**
-   * Unix byte-order for signed binary representations.
-   */
-  public final static int BIG_ENDIAN = 1;
-
-  /**
-   * Intel 80/86 reversed byte-order for signed binary representations.
-   */
-  public final static int LITTLE_ENDIAN = 2;
-
-  /**
-   * Build a Java short from a 2-byte signed binary representation.
-   *
-   * @exception IllegalArgumentException if the specified byte order is not 
recognized.
-   */
-  public static final short getShort (byte[] buffer, int offset)
-  {
-    return (short) (((buffer[offset+0] & 0xff) << 8) +
-                    ((buffer[offset+1] & 0xff) << 0));
-  }
-
-  /**
-   * Build a Java int from a 4-byte signed binary representation.
-   *
-   * @exception IllegalArgumentException if the specified byte order is not 
recognized.
-   */
-  public static final int getInt (byte[] buffer, int offset)
-  {
-    return (int) (((buffer[offset+0] & 0xff) << 24) +
-                  ((buffer[offset+1] & 0xff) << 16) +
-                  ((buffer[offset+2] & 0xff) << 8) +
-                  ((buffer[offset+3] & 0xff) << 0));
-  }
-
-  /**
-   * Build a Java long from an 8-byte signed binary representation.
-   *
-   * @exception IllegalArgumentException if the specified byte order is not 
recognized.
-   */
-  public static final long getLong (byte[] buffer, int offset)
-  {
-    return (long) (((buffer[offset+0] & 0xffL) << 56) +
-                   ((buffer[offset+1] & 0xffL) << 48) +
-                   ((buffer[offset+2] & 0xffL) << 40) +
-                   ((buffer[offset+3] & 0xffL) << 32) +
-                   ((buffer[offset+4] & 0xffL) << 24) +
-                   ((buffer[offset+5] & 0xffL) << 16) +
-                   ((buffer[offset+6] & 0xffL) << 8) +
-                   ((buffer[offset+7] & 0xffL) << 0));
-  }
-
-  //--------------------- input converters 
-------------------------------------
-
-  /**
-   * Write a Java short to a 2-byte big endian signed binary representation.
-   */
-  public static final void shortToBigEndianBytes (byte[] buffer, int offset, 
short v)
-  {
-    buffer[offset++] = (byte) ((v >>> 8) & 0xFF);
-    buffer[offset++] = (byte) ((v >>> 0) & 0xFF);
-  }
-
-  /**
-   * Write a Java int to a 4-byte big endian signed binary representation.
-   */
-  public static final void intToBigEndianBytes (byte[] buffer, int offset, int 
v)
-  {
-    buffer[offset++] = (byte) ((v >>> 24) & 0xFF);
-    buffer[offset++] = (byte) ((v >>> 16) & 0xFF);
-    buffer[offset++] = (byte) ((v >>> 8) & 0xFF);
-    buffer[offset++] = (byte) ((v >>> 0) & 0xFF);
-  }
-
-  /**
-   * Write a Java long to an 8-byte big endian signed binary representation.
-   */
-  public static final void longToBigEndianBytes (byte[] buffer, int offset, 
long v)
-  {
-    buffer[offset++] = (byte) ((v >>> 56) & 0xFF);
-    buffer[offset++] = (byte) ((v >>> 48) & 0xFF);
-    buffer[offset++] = (byte) ((v >>> 40) & 0xFF);
-    buffer[offset++] = (byte) ((v >>> 32) & 0xFF);
-    buffer[offset++] = (byte) ((v >>> 24) & 0xFF);
-    buffer[offset++] = (byte) ((v >>> 16) & 0xFF);
-    buffer[offset++] = (byte) ((v >>>  8) & 0xFF);
-    buffer[offset++] = (byte) ((v >>>  0) & 0xFF);
-  }
+public class SignedBinary {
+    // Hide the default constructor, this is a static class.
+    private SignedBinary() {
+    }
+
+    /**
+     * Unix byte-order for signed binary representations.
+     */
+    public final static int BIG_ENDIAN = 1;
+
+    /**
+     * Intel 80/86 reversed byte-order for signed binary representations.
+     */
+    public final static int LITTLE_ENDIAN = 2;
+
+    /**
+     * Build a Java short from a 2-byte signed binary representation.
+     *
+     * @throws IllegalArgumentException if the specified byte order is not 
recognized.
+     */
+    public static final short getShort(byte[] buffer, int offset) {
+        return (short) (((buffer[offset + 0] & 0xff) << 8) +
+                ((buffer[offset + 1] & 0xff) << 0));
+    }
+
+    /**
+     * Build a Java int from a 4-byte signed binary representation.
+     *
+     * @throws IllegalArgumentException if the specified byte order is not 
recognized.
+     */
+    public static final int getInt(byte[] buffer, int offset) {
+        return (int) (((buffer[offset + 0] & 0xff) << 24) +
+                ((buffer[offset + 1] & 0xff) << 16) +
+                ((buffer[offset + 2] & 0xff) << 8) +
+                ((buffer[offset + 3] & 0xff) << 0));
+    }
+
+    /**
+     * Build a Java long from an 8-byte signed binary representation.
+     *
+     * @throws IllegalArgumentException if the specified byte order is not 
recognized.
+     */
+    public static final long getLong(byte[] buffer, int offset) {
+        return (long) (((buffer[offset + 0] & 0xffL) << 56) +
+                ((buffer[offset + 1] & 0xffL) << 48) +
+                ((buffer[offset + 2] & 0xffL) << 40) +
+                ((buffer[offset + 3] & 0xffL) << 32) +
+                ((buffer[offset + 4] & 0xffL) << 24) +
+                ((buffer[offset + 5] & 0xffL) << 16) +
+                ((buffer[offset + 6] & 0xffL) << 8) +
+                ((buffer[offset + 7] & 0xffL) << 0));
+    }
+
+    //--------------------- input converters 
-------------------------------------
+
+    /**
+     * Write a Java short to a 2-byte big endian signed binary representation.
+     */
+    public static final void shortToBigEndianBytes(byte[] buffer, int offset, 
short v) {
+        buffer[offset++] = (byte) ((v >>> 8) & 0xFF);
+        buffer[offset++] = (byte) ((v >>> 0) & 0xFF);
+    }
+
+    /**
+     * Write a Java int to a 4-byte big endian signed binary representation.
+     */
+    public static final void intToBigEndianBytes(byte[] buffer, int offset, 
int v) {
+        buffer[offset++] = (byte) ((v >>> 24) & 0xFF);
+        buffer[offset++] = (byte) ((v >>> 16) & 0xFF);
+        buffer[offset++] = (byte) ((v >>> 8) & 0xFF);
+        buffer[offset++] = (byte) ((v >>> 0) & 0xFF);
+    }
+
+    /**
+     * Write a Java long to an 8-byte big endian signed binary representation.
+     */
+    public static final void longToBigEndianBytes(byte[] buffer, int offset, 
long v) {
+        buffer[offset++] = (byte) ((v >>> 56) & 0xFF);
+        buffer[offset++] = (byte) ((v >>> 48) & 0xFF);
+        buffer[offset++] = (byte) ((v >>> 40) & 0xFF);
+        buffer[offset++] = (byte) ((v >>> 32) & 0xFF);
+        buffer[offset++] = (byte) ((v >>> 24) & 0xFF);
+        buffer[offset++] = (byte) ((v >>> 16) & 0xFF);
+        buffer[offset++] = (byte) ((v >>> 8) & 0xFF);
+        buffer[offset++] = (byte) ((v >>> 0) & 0xFF);
+    }
 }

Modified: 
incubator/derby/code/trunk/java/client/org/apache/derby/client/am/SqlCode.java
URL: 
http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/client/org/apache/derby/client/am/SqlCode.java?rev=165585&r1=165584&r2=165585&view=diff
==============================================================================
--- 
incubator/derby/code/trunk/java/client/org/apache/derby/client/am/SqlCode.java 
(original)
+++ 
incubator/derby/code/trunk/java/client/org/apache/derby/client/am/SqlCode.java 
Sun May  1 23:25:59 2005
@@ -26,22 +26,26 @@
 //
 // SQL codes are architected by the product that issues them.
 //
-public class SqlCode
-{
-  private int code_;
 
-  private SqlCode (int code) { code_ = code; }
+public class SqlCode {
+    private int code_;
 
-  int getCode() { return code_; }
+    private SqlCode(int code) {
+        code_ = code;
+    }
 
-  public final static SqlCode invalidCommitOrRollbackUnderXA = new SqlCode 
(-4200);
+    int getCode() {
+        return code_;
+    }
 
-  public final static SqlCode invalidSetAutoCommitUnderXA = new SqlCode 
(-4201);
+    public final static SqlCode invalidCommitOrRollbackUnderXA = new 
SqlCode(-4200);
 
-  public final static SqlCode queuedXAError = new SqlCode (-4203);
+    public final static SqlCode invalidSetAutoCommitUnderXA = new 
SqlCode(-4201);
 
-  public final static SqlCode disconnectError = new SqlCode (-4499);
+    public final static SqlCode queuedXAError = new SqlCode(-4203);
 
-  public final static SqlCode undefinedError = new SqlCode (-99999);
+    public final static SqlCode disconnectError = new SqlCode(-4499);
+
+    public final static SqlCode undefinedError = new SqlCode(-99999);
 
 }

Modified: 
incubator/derby/code/trunk/java/client/org/apache/derby/client/am/SqlException.java
URL: 
http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/client/org/apache/derby/client/am/SqlException.java?rev=165585&r1=165584&r2=165585&view=diff
==============================================================================
--- 
incubator/derby/code/trunk/java/client/org/apache/derby/client/am/SqlException.java
 (original)
+++ 
incubator/derby/code/trunk/java/client/org/apache/derby/client/am/SqlException.java
 Sun May  1 23:25:59 2005
@@ -47,251 +47,257 @@
 // 2. What is the format and type of the Locale parameter? If there does, I 
would really like to know the format of the locale in order to decide the type 
of the Locale parameter. Even there does not either, the Locale parameter 
probably still needs to be kept there for future extension, and we need to 
figure out the format of the locale.
 // 3. What would be the format of the output message? Is this full message 
text ok or do we only need the explanation message corresponding to an SQL 
code. This somehow matters whether we need the Buffersize and Linewidth 
parameters for the stored procedure.
 // 4. What if the invocation of stored procedure failed (due to, eg, 
connection dropping)? In this case, we probably need to return some client-side 
message.
-public class SqlException extends java.sql.SQLException implements Diagnosable
-{
-  java.lang.Throwable throwable_ = null;
-  protected Sqlca sqlca_ = null; // for engine generated errors only
-  private String batchPositionLabel_; // for batched exceptions only
-
-  
//-----------------constructors-----------------------------------------------
-
-  public SqlException (LogWriter logWriter, ErrorKey errorKey)
-  {
-    super (ResourceUtilities.getResource 
(ResourceKeys.driverOriginationIndicator) +
-           ResourceUtilities.getResource (errorKey.getResourceKey()),
-           errorKey.getSQLState(),
-           errorKey.getErrorCode());
-    if (logWriter != null) logWriter.traceDiagnosable (this);
-  }
-
-  public SqlException (LogWriter logWriter, ErrorKey errorKey, Object[] args)
-  {
-    super (ResourceUtilities.getResource 
(ResourceKeys.driverOriginationIndicator) +
-           ResourceUtilities.getResource (errorKey.getResourceKey(), args),
-           errorKey.getSQLState(),
-           errorKey.getErrorCode());
-    if (logWriter != null) logWriter.traceDiagnosable (this);
-  }
-
-  public SqlException (LogWriter logWriter, ErrorKey errorKey, Object arg)
-  {
-    this (logWriter, errorKey, new Object[] {arg});
-  }
-
-  public SqlException (LogWriter logWriter, Sqlca sqlca)
-  {
-    super ();
-    sqlca_ = sqlca;
-    if (logWriter != null) logWriter.traceDiagnosable (this);
-  }
-
-  // Temporary constructor until all error keys are defined.
-  public SqlException (LogWriter logWriter)
-  {
-    super (null, null, -99999);
-    if (logWriter != null) logWriter.traceDiagnosable (this);
-  }
-
-  /*
-  // Temporary constructor until all error keys are defined.
-  public SQLException (LogWriter logWriter, java.lang.Throwable throwable)
-  {
-    super ();
-    throwable_ = throwable;
-    if (logWriter != null) logWriter.traceDiagnosable (this);
-  }
-  */
-
-  // Temporary constructor until all error keys are defined.
-  public SqlException (LogWriter logWriter, String reason)
-  {
-    super (reason, null, -99999);
-    if (logWriter != null) logWriter.traceDiagnosable (this);
-  }
-
-  // Temporary constructor until all error keys are defined.
-  public SqlException (LogWriter logWriter, java.lang.Throwable throwable, 
String reason)
-  {
-    super (reason, null, -99999);
-    throwable_ = throwable;
-    if (logWriter != null) logWriter.traceDiagnosable (this);
-  }
-
-  // Temporary constructor until all error keys are defined.
-  public SqlException (LogWriter logWriter, java.lang.Throwable throwable, 
String reason, SqlState sqlstate)
-  {
-    super (reason, sqlstate.getState(), -99999);
-    throwable_ = throwable;
-    if (logWriter != null) logWriter.traceDiagnosable (this);
-  }
-
-  // Temporary constructor until all error keys are defined, for subsystem use 
only.
-  public SqlException (LogWriter logWriter, java.lang.Throwable throwable, 
String reason, String sqlstate)
-  {
-    super (reason, sqlstate, -99999);
-    throwable_ = throwable;
-    if (logWriter != null) logWriter.traceDiagnosable (this);
-  }
-
-  // Temporary constructor until all error keys are defined.
-  public SqlException (LogWriter logWriter, String reason, SqlState sqlState)
-  {
-    super (reason, sqlState.getState(), -99999);
-    if (logWriter != null) logWriter.traceDiagnosable (this);
-  }
-
-  // Temporary constructor until all error keys are defined, for subsystem use 
only.
-  public SqlException (LogWriter logWriter, String reason, String sqlState)
-  {
-    super (reason, sqlState, -99999);
-    if (logWriter != null) logWriter.traceDiagnosable (this);
-  }
-
-  // Temporary constructor until all error keys are defined.
-  public SqlException (LogWriter logWriter, String reason, SqlState sqlState, 
SqlCode errorCode)
-  {
-    super (reason, (sqlState == null) ? null : sqlState.getState(), 
errorCode.getCode());
-    if (logWriter != null) logWriter.traceDiagnosable (this);
-  }
-
-  // Temporary constructor until all error keys are defined, for subsystem use 
only.
-  public SqlException (LogWriter logWriter, String reason, String sqlState, 
int errorCode)
-  {
-    super (reason, sqlState, errorCode);
-    if (logWriter != null) logWriter.traceDiagnosable (this);
-  }
-
-  // Temporary constructor until all error keys are defined.
-  public SqlException (LogWriter logWriter, java.lang.Throwable throwable, 
String reason, SqlState sqlState, SqlCode errorCode)
-  {
-    super (reason, sqlState.getState(), errorCode.getCode());
-    throwable_ = throwable;
-    if (logWriter != null) logWriter.traceDiagnosable (this);
-  }
-
-  // Temporary constructor until all error keys are defined, for subsystem use 
only.
-  public SqlException (LogWriter logWriter, java.lang.Throwable throwable, 
String reason, String sqlState, int errorCode)
-  {
-    super (reason, sqlState, errorCode);
-    throwable_ = throwable;
-    if (logWriter != null) logWriter.traceDiagnosable (this);
-  }
-
-  // Label an exception element in a batched update exception chain.
-  // This text will be prepended onto the exceptions message text dynamically
-  // when getMessage() is called.
-  // Called by the Agent.
-  void setBatchPositionLabel (int index)
-  {
-    batchPositionLabel_ = "Error for batch element #" + index + ": ";
-  }
-
-  public Sqlca getSqlca ()
-  {
-    return sqlca_;
-  }
-
-  public java.lang.Throwable getThrowable ()
-  {
-    return throwable_;
-  }
-
-  public String getMessage ()
-  {
-    String message;
-
-    if (sqlca_ == null)
-      message = super.getMessage();
-    else
-      message = ((Sqlca) sqlca_).getJDBCMessage();
-
-    if (batchPositionLabel_ == null)
-      return message;
-
-    return batchPositionLabel_ + message;
-  }
-
-  public String getSQLState ()
-  {
-    if (sqlca_ == null)
-      return super.getSQLState();
-    else
-      return sqlca_.getSqlState();
-  }
-
-  public int getErrorCode ()
-  {
-    if (sqlca_ == null)
-      return super.getErrorCode();
-    else
-      return sqlca_.getSqlCode();
-  }
-
-  public void printTrace (java.io.PrintWriter printWriter, String header)
-  {
-    ExceptionFormatter.printTrace (this, printWriter, header);
-  }
-
-  // Return a single SQLException without the "next" pointing to another 
SQLException.
-  // Because the "next" is a private field in java.sql.SQLException,
-  // we have to create a new SqlException in order to break the chain with 
"next" as null.
-  SqlException copyAsUnchainedSQLException (LogWriter logWriter)
-  {
-    if (sqlca_ != null)
-      return new SqlException (logWriter, sqlca_); // server error
-    else
-      return new SqlException (logWriter, getMessage(), getSQLState(), 
getErrorCode()); // client error
-  }
+
+public class SqlException extends java.sql.SQLException implements Diagnosable 
{
+    java.lang.Throwable throwable_ = null;
+    protected Sqlca sqlca_ = null; // for engine generated errors only
+    private String batchPositionLabel_; // for batched exceptions only
+
+    
//-----------------constructors-----------------------------------------------
+
+    public SqlException(LogWriter logWriter, ErrorKey errorKey) {
+        
super(ResourceUtilities.getResource(ResourceKeys.driverOriginationIndicator) +
+                ResourceUtilities.getResource(errorKey.getResourceKey()),
+                errorKey.getSQLState(),
+                errorKey.getErrorCode());
+        if (logWriter != null) {
+            logWriter.traceDiagnosable(this);
+        }
+    }
+
+    public SqlException(LogWriter logWriter, ErrorKey errorKey, Object[] args) 
{
+        
super(ResourceUtilities.getResource(ResourceKeys.driverOriginationIndicator) +
+                ResourceUtilities.getResource(errorKey.getResourceKey(), args),
+                errorKey.getSQLState(),
+                errorKey.getErrorCode());
+        if (logWriter != null) {
+            logWriter.traceDiagnosable(this);
+        }
+    }
+
+    public SqlException(LogWriter logWriter, ErrorKey errorKey, Object arg) {
+        this(logWriter, errorKey, new Object[]{arg});
+    }
+
+    public SqlException(LogWriter logWriter, Sqlca sqlca) {
+        super();
+        sqlca_ = sqlca;
+        if (logWriter != null) {
+            logWriter.traceDiagnosable(this);
+        }
+    }
+
+    // Temporary constructor until all error keys are defined.
+    public SqlException(LogWriter logWriter) {
+        super(null, null, -99999);
+        if (logWriter != null) {
+            logWriter.traceDiagnosable(this);
+        }
+    }
+
+    /*
+    // Temporary constructor until all error keys are defined.
+    public SQLException (LogWriter logWriter, java.lang.Throwable throwable)
+    {
+      super ();
+      throwable_ = throwable;
+      if (logWriter != null) logWriter.traceDiagnosable (this);
+    }
+    */
+
+    // Temporary constructor until all error keys are defined.
+    public SqlException(LogWriter logWriter, String reason) {
+        super(reason, null, -99999);
+        if (logWriter != null) {
+            logWriter.traceDiagnosable(this);
+        }
+    }
+
+    // Temporary constructor until all error keys are defined.
+    public SqlException(LogWriter logWriter, java.lang.Throwable throwable, 
String reason) {
+        super(reason, null, -99999);
+        throwable_ = throwable;
+        if (logWriter != null) {
+            logWriter.traceDiagnosable(this);
+        }
+    }
+
+    // Temporary constructor until all error keys are defined.
+    public SqlException(LogWriter logWriter, java.lang.Throwable throwable, 
String reason, SqlState sqlstate) {
+        super(reason, sqlstate.getState(), -99999);
+        throwable_ = throwable;
+        if (logWriter != null) {
+            logWriter.traceDiagnosable(this);
+        }
+    }
+
+    // Temporary constructor until all error keys are defined, for subsystem 
use only.
+    public SqlException(LogWriter logWriter, java.lang.Throwable throwable, 
String reason, String sqlstate) {
+        super(reason, sqlstate, -99999);
+        throwable_ = throwable;
+        if (logWriter != null) {
+            logWriter.traceDiagnosable(this);
+        }
+    }
+
+    // Temporary constructor until all error keys are defined.
+    public SqlException(LogWriter logWriter, String reason, SqlState sqlState) 
{
+        super(reason, sqlState.getState(), -99999);
+        if (logWriter != null) {
+            logWriter.traceDiagnosable(this);
+        }
+    }
+
+    // Temporary constructor until all error keys are defined, for subsystem 
use only.
+    public SqlException(LogWriter logWriter, String reason, String sqlState) {
+        super(reason, sqlState, -99999);
+        if (logWriter != null) {
+            logWriter.traceDiagnosable(this);
+        }
+    }
+
+    // Temporary constructor until all error keys are defined.
+    public SqlException(LogWriter logWriter, String reason, SqlState sqlState, 
SqlCode errorCode) {
+        super(reason, (sqlState == null) ? null : sqlState.getState(), 
errorCode.getCode());
+        if (logWriter != null) {
+            logWriter.traceDiagnosable(this);
+        }
+    }
+
+    // Temporary constructor until all error keys are defined, for subsystem 
use only.
+    public SqlException(LogWriter logWriter, String reason, String sqlState, 
int errorCode) {
+        super(reason, sqlState, errorCode);
+        if (logWriter != null) {
+            logWriter.traceDiagnosable(this);
+        }
+    }
+
+    // Temporary constructor until all error keys are defined.
+    public SqlException(LogWriter logWriter, java.lang.Throwable throwable, 
String reason, SqlState sqlState, SqlCode errorCode) {
+        super(reason, sqlState.getState(), errorCode.getCode());
+        throwable_ = throwable;
+        if (logWriter != null) {
+            logWriter.traceDiagnosable(this);
+        }
+    }
+
+    // Temporary constructor until all error keys are defined, for subsystem 
use only.
+    public SqlException(LogWriter logWriter, java.lang.Throwable throwable, 
String reason, String sqlState, int errorCode) {
+        super(reason, sqlState, errorCode);
+        throwable_ = throwable;
+        if (logWriter != null) {
+            logWriter.traceDiagnosable(this);
+        }
+    }
+
+    // Label an exception element in a batched update exception chain.
+    // This text will be prepended onto the exceptions message text dynamically
+    // when getMessage() is called.
+    // Called by the Agent.
+    void setBatchPositionLabel(int index) {
+        batchPositionLabel_ = "Error for batch element #" + index + ": ";
+    }
+
+    public Sqlca getSqlca() {
+        return sqlca_;
+    }
+
+    public java.lang.Throwable getThrowable() {
+        return throwable_;
+    }
+
+    public String getMessage() {
+        String message;
+
+        if (sqlca_ == null) {
+            message = super.getMessage();
+        } else {
+            message = ((Sqlca) sqlca_).getJDBCMessage();
+        }
+
+        if (batchPositionLabel_ == null) {
+            return message;
+        }
+
+        return batchPositionLabel_ + message;
+    }
+
+    public String getSQLState() {
+        if (sqlca_ == null) {
+            return super.getSQLState();
+        } else {
+            return sqlca_.getSqlState();
+        }
+    }
+
+    public int getErrorCode() {
+        if (sqlca_ == null) {
+            return super.getErrorCode();
+        } else {
+            return sqlca_.getSqlCode();
+        }
+    }
+
+    public void printTrace(java.io.PrintWriter printWriter, String header) {
+        ExceptionFormatter.printTrace(this, printWriter, header);
+    }
+
+    // Return a single SQLException without the "next" pointing to another 
SQLException.
+    // Because the "next" is a private field in java.sql.SQLException,
+    // we have to create a new SqlException in order to break the chain with 
"next" as null.
+    SqlException copyAsUnchainedSQLException(LogWriter logWriter) {
+        if (sqlca_ != null) {
+            return new SqlException(logWriter, sqlca_); // server error
+        } else {
+            return new SqlException(logWriter, getMessage(), getSQLState(), 
getErrorCode()); // client error
+        }
+    }
 }
 
 // An intermediate exception encapsulation to provide code-reuse
 // for common ResultSet and ResultSetMetaData column access exceptions.
-class ColumnIndexOutOfBoundsException extends SqlException
-{
-  ColumnIndexOutOfBoundsException (LogWriter logWriter, Throwable throwable, 
int resultSetColumn)
-  {
-    super (logWriter, throwable,
-           "Invalid argument:" +
-           " Result column index " + resultSetColumn + " is out of range.");
-  }
+
+class ColumnIndexOutOfBoundsException extends SqlException {
+    ColumnIndexOutOfBoundsException(LogWriter logWriter, Throwable throwable, 
int resultSetColumn) {
+        super(logWriter, throwable,
+                "Invalid argument:" +
+                " Result column index " + resultSetColumn + " is out of 
range.");
+    }
 }
 
 // An intermediate exception encapsulation to provide code-reuse
 // for common ResultSet data conversion exceptions.
-class NumberFormatConversionException extends SqlException
-{
-  NumberFormatConversionException (LogWriter logWriter, String instance)
-  {
-    super (logWriter,
-            "Invalid data conversion:" +
-           " Result column instance " +
-           instance +
-           " is either an invalid numeric representation" +
-           " or is out of range.");
-  }
+
+class NumberFormatConversionException extends SqlException {
+    NumberFormatConversionException(LogWriter logWriter, String instance) {
+        super(logWriter,
+                "Invalid data conversion:" +
+                " Result column instance " +
+                instance +
+                " is either an invalid numeric representation" +
+                " or is out of range.");
+    }
 }
 
 // An intermediate exception encapsulation to provide code-reuse
 // for common ResultSet data conversion exceptions.
-class ColumnTypeConversionException extends SqlException
-{
-  ColumnTypeConversionException (LogWriter logWriter)
-  {
-    super (logWriter,
-           "Invalid data conversion:" +
-           " Wrong result column type for requested conversion.");
-  }
+
+class ColumnTypeConversionException extends SqlException {
+    ColumnTypeConversionException(LogWriter logWriter) {
+        super(logWriter,
+                "Invalid data conversion:" +
+                " Wrong result column type for requested conversion.");
+    }
 }
 
 // An intermediate exception encapsulation to provide code-reuse
 // for common CrossConverters data conversion exceptions.
-class LossOfPrecisionConversionException extends SqlException
-{
-  LossOfPrecisionConversionException (LogWriter logWriter, String instance)
-  {
-    super (logWriter,
-           "Invalid data conversion:" +
-           "Requested conversion would result in a loss of precision of " +
-           instance);
-  }
+
+class LossOfPrecisionConversionException extends SqlException {
+    LossOfPrecisionConversionException(LogWriter logWriter, String instance) {
+        super(logWriter,
+                "Invalid data conversion:" +
+                "Requested conversion would result in a loss of precision of " 
+
+                instance);
+    }
 }

Modified: 
incubator/derby/code/trunk/java/client/org/apache/derby/client/am/SqlState.java
URL: 
http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/client/org/apache/derby/client/am/SqlState.java?rev=165585&r1=165584&r2=165585&view=diff
==============================================================================
--- 
incubator/derby/code/trunk/java/client/org/apache/derby/client/am/SqlState.java 
(original)
+++ 
incubator/derby/code/trunk/java/client/org/apache/derby/client/am/SqlState.java 
Sun May  1 23:25:59 2005
@@ -29,30 +29,34 @@
 // Therefore Dnc will not attempt to reuse pre-existing sql states 
 // Range for dnc architected sql codes is +/- 4400 to 4499.
 //
-public class SqlState
-{
-  private String state_;
 
-  private SqlState (String state) { state_ = state; }
+public class SqlState {
+    private String state_;
 
-  String getState() { return state_; }
+    private SqlState(String state) {
+        state_ = state;
+    }
 
-  // The following codes are architected by PROTOCOL on page 331 of PROTOCOL 
V2 Volume 1.
-  // SQL States generated by Dnc should be Dnc-specific with the following 
specific exctpions.
-  //
-  public final static SqlState _08004 = new SqlState ("08004");
-  public final static SqlState _58009 = new SqlState ("58009");
-  public final static SqlState _58010 = new SqlState ("58010");
-  public final static SqlState _58014 = new SqlState ("58014");
-  public final static SqlState _58015 = new SqlState ("58015");
-  public final static SqlState _58016 = new SqlState ("58016");
-  public final static SqlState _58017 = new SqlState ("58017");
-  public final static SqlState _24501 = new SqlState ("24501");
-  public final static SqlState _58008 = new SqlState ("58008");
-  public final static SqlState _22021 = new SqlState ("22021");
-  public final static SqlState _2D521 = new SqlState ("2D521");
+    String getState() {
+        return state_;
+    }
 
-  // Dnc-archited sql states follow
-  //
-  public final static SqlState undefined = new SqlState (null);
+    // The following codes are architected by PROTOCOL on page 331 of PROTOCOL 
V2 Volume 1.
+    // SQL States generated by Dnc should be Dnc-specific with the following 
specific exctpions.
+    //
+    public final static SqlState _08004 = new SqlState("08004");
+    public final static SqlState _58009 = new SqlState("58009");
+    public final static SqlState _58010 = new SqlState("58010");
+    public final static SqlState _58014 = new SqlState("58014");
+    public final static SqlState _58015 = new SqlState("58015");
+    public final static SqlState _58016 = new SqlState("58016");
+    public final static SqlState _58017 = new SqlState("58017");
+    public final static SqlState _24501 = new SqlState("24501");
+    public final static SqlState _58008 = new SqlState("58008");
+    public final static SqlState _22021 = new SqlState("22021");
+    public final static SqlState _2D521 = new SqlState("2D521");
+
+    // Dnc-archited sql states follow
+    //
+    public final static SqlState undefined = new SqlState(null);
 }

Modified: 
incubator/derby/code/trunk/java/client/org/apache/derby/client/am/SqlWarning.java
URL: 
http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/client/org/apache/derby/client/am/SqlWarning.java?rev=165585&r1=165584&r2=165585&view=diff
==============================================================================
--- 
incubator/derby/code/trunk/java/client/org/apache/derby/client/am/SqlWarning.java
 (original)
+++ 
incubator/derby/code/trunk/java/client/org/apache/derby/client/am/SqlWarning.java
 Sun May  1 23:25:59 2005
@@ -28,130 +28,136 @@
 
 // Until the "Error Cycle" pass is complete.
 // Use the temporary constructors at the bottom.
-public class SqlWarning extends java.sql.SQLWarning implements Diagnosable
-{
-  private java.lang.Throwable throwable_ = null;
-  protected Sqlca sqlca_ = null; // for engine generated errors only
-
-  
//-----------------constructors-----------------------------------------------
-
-  public SqlWarning (LogWriter logWriter, ErrorKey errorKey)
-  {
-    super (ResourceUtilities.getResource 
(ResourceKeys.driverOriginationIndicator) +
-           ResourceUtilities.getResource (errorKey.getResourceKey()),
-           errorKey.getSQLState(),
-           errorKey.getErrorCode());
-    if (logWriter != null) logWriter.traceDiagnosable (this);
-  }
-
-  public SqlWarning (LogWriter logWriter, ErrorKey errorKey, Object[] args)
-  {
-    super (ResourceUtilities.getResource 
(ResourceKeys.driverOriginationIndicator) +
-           ResourceUtilities.getResource (errorKey.getResourceKey(), args),
-           errorKey.getSQLState(),
-           errorKey.getErrorCode());
-    if (logWriter != null) logWriter.traceDiagnosable (this);
-  }
-
-  public SqlWarning (LogWriter logWriter, ErrorKey errorKey, Object arg)
-  {
-    this (logWriter, errorKey, new Object[] {arg});
-  }
-
-  public SqlWarning (LogWriter logWriter, Sqlca sqlca)
-  {
-    super ();
-    sqlca_ = sqlca;
-    if (logWriter != null) logWriter.traceDiagnosable (this);
-  }
-
-  // Temporary constructor until all error keys are defined.
-  public SqlWarning (LogWriter logWriter)
-  {
-    super ();
-    if (logWriter != null) logWriter.traceDiagnosable (this);
-  }
-
-  // Temporary constructor until all error keys are defined.
-  public SqlWarning (LogWriter logWriter, String text)
-  {
-    super (text);
-    if (logWriter != null) logWriter.traceDiagnosable (this);
-  }
+
+public class SqlWarning extends java.sql.SQLWarning implements Diagnosable {
+    private java.lang.Throwable throwable_ = null;
+    protected Sqlca sqlca_ = null; // for engine generated errors only
+
+    
//-----------------constructors-----------------------------------------------
+
+    public SqlWarning(LogWriter logWriter, ErrorKey errorKey) {
+        
super(ResourceUtilities.getResource(ResourceKeys.driverOriginationIndicator) +
+                ResourceUtilities.getResource(errorKey.getResourceKey()),
+                errorKey.getSQLState(),
+                errorKey.getErrorCode());
+        if (logWriter != null) {
+            logWriter.traceDiagnosable(this);
+        }
+    }
+
+    public SqlWarning(LogWriter logWriter, ErrorKey errorKey, Object[] args) {
+        
super(ResourceUtilities.getResource(ResourceKeys.driverOriginationIndicator) +
+                ResourceUtilities.getResource(errorKey.getResourceKey(), args),
+                errorKey.getSQLState(),
+                errorKey.getErrorCode());
+        if (logWriter != null) {
+            logWriter.traceDiagnosable(this);
+        }
+    }
+
+    public SqlWarning(LogWriter logWriter, ErrorKey errorKey, Object arg) {
+        this(logWriter, errorKey, new Object[]{arg});
+    }
+
+    public SqlWarning(LogWriter logWriter, Sqlca sqlca) {
+        super();
+        sqlca_ = sqlca;
+        if (logWriter != null) {
+            logWriter.traceDiagnosable(this);
+        }
+    }
+
+    // Temporary constructor until all error keys are defined.
+    public SqlWarning(LogWriter logWriter) {
+        super();
+        if (logWriter != null) {
+            logWriter.traceDiagnosable(this);
+        }
+    }
+
+    // Temporary constructor until all error keys are defined.
+    public SqlWarning(LogWriter logWriter, String text) {
+        super(text);
+        if (logWriter != null) {
+            logWriter.traceDiagnosable(this);
+        }
+    }
+
+    // Temporary constructor until all error keys are defined.
+    public SqlWarning(LogWriter logWriter, java.lang.Throwable throwable, 
String text) {
+        super(text);
+        throwable_ = throwable;
+        if (logWriter != null) {
+            logWriter.traceDiagnosable(this);
+        }
+    }
+
+    // Temporary constructor until all error keys are defined.
+    public SqlWarning(LogWriter logWriter, String text, SqlState sqlState) {
+        super(text, sqlState.getState());
+        if (logWriter != null) {
+            logWriter.traceDiagnosable(this);
+        }
+    }
+
+    // Temporary constructor until all error keys are defined, for subsystem 
use only
+    public SqlWarning(LogWriter logWriter, String text, String sqlState) {
+        super(text, sqlState);
+        if (logWriter != null) {
+            logWriter.traceDiagnosable(this);
+        }
+    }
 
     // Temporary constructor until all error keys are defined.
-  public SqlWarning (LogWriter logWriter, java.lang.Throwable throwable, 
String text)
-  {
-    super (text);
-    throwable_ = throwable;
-    if (logWriter != null) logWriter.traceDiagnosable (this);
-  }
-
-  // Temporary constructor until all error keys are defined.
-  public SqlWarning (LogWriter logWriter, String text, SqlState sqlState)
-  {
-    super (text, sqlState.getState());
-    if (logWriter != null) logWriter.traceDiagnosable (this);
-  }
-
-  // Temporary constructor until all error keys are defined, for subsystem use 
only
-  public SqlWarning (LogWriter logWriter, String text, String sqlState)
-  {
-    super (text, sqlState);
-    if (logWriter != null) logWriter.traceDiagnosable (this);
-  }
-
-  // Temporary constructor until all error keys are defined.
-  public SqlWarning (LogWriter logWriter, String text, SqlState sqlState, 
SqlCode errorCode)
-  {
-    super (text, sqlState.getState(), errorCode.getCode());
-    if (logWriter != null) logWriter.traceDiagnosable (this);
-  }
-
-  // Temporary constructor until all error keys are defined, for subsystem use 
only.
-  public SqlWarning (LogWriter logWriter, String text, String sqlState, int 
errorCode)
-  {
-    super (text, sqlState, errorCode);
-    if (logWriter != null) logWriter.traceDiagnosable (this);
-  }
-
-  public java.lang.Throwable getThrowable ()
-  {
-    return throwable_;
-  }
-
-  public Sqlca getSqlca ()
-  {
-    return sqlca_;
-  }
-
-  public String getMessage ()
-  {
-    if (sqlca_ == null)
-      return super.getMessage();
-    else
-      return ((Sqlca) sqlca_).getJDBCMessage();
-  }
-
-  public String getSQLState ()
-  {
-    if (sqlca_ == null)
-      return super.getSQLState();
-    else
-      return sqlca_.getSqlState();
-  }
-
-  public int getErrorCode ()
-  {
-    if (sqlca_ == null)
-      return super.getErrorCode();
-    else
-      return sqlca_.getSqlCode();
-  }
-
-  public void printTrace (java.io.PrintWriter printWriter, String header)
-  {
-    ExceptionFormatter.printTrace (this, printWriter, header);
-  }
+    public SqlWarning(LogWriter logWriter, String text, SqlState sqlState, 
SqlCode errorCode) {
+        super(text, sqlState.getState(), errorCode.getCode());
+        if (logWriter != null) {
+            logWriter.traceDiagnosable(this);
+        }
+    }
+
+    // Temporary constructor until all error keys are defined, for subsystem 
use only.
+    public SqlWarning(LogWriter logWriter, String text, String sqlState, int 
errorCode) {
+        super(text, sqlState, errorCode);
+        if (logWriter != null) {
+            logWriter.traceDiagnosable(this);
+        }
+    }
+
+    public java.lang.Throwable getThrowable() {
+        return throwable_;
+    }
+
+    public Sqlca getSqlca() {
+        return sqlca_;
+    }
+
+    public String getMessage() {
+        if (sqlca_ == null) {
+            return super.getMessage();
+        } else {
+            return ((Sqlca) sqlca_).getJDBCMessage();
+        }
+    }
+
+    public String getSQLState() {
+        if (sqlca_ == null) {
+            return super.getSQLState();
+        } else {
+            return sqlca_.getSqlState();
+        }
+    }
+
+    public int getErrorCode() {
+        if (sqlca_ == null) {
+            return super.getErrorCode();
+        } else {
+            return sqlca_.getSqlCode();
+        }
+    }
+
+    public void printTrace(java.io.PrintWriter printWriter, String header) {
+        ExceptionFormatter.printTrace(this, printWriter, header);
+    }
 }
 


Reply via email to