db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fuzzylo...@apache.org
Subject svn commit: r407473 - /db/derby/code/branches/10.1/java/client/org/apache/derby/client/net/NetConnectionReply.java
Date Thu, 18 May 2006 06:30:09 GMT
Author: fuzzylogic
Date: Wed May 17 23:30:08 2006
New Revision: 407473

URL: http://svn.apache.org/viewvc?rev=407473&view=rev
Log:
DERBY-900: Merge revision 398944 to Derby 10.1 branch.

Modified:
    db/derby/code/branches/10.1/java/client/org/apache/derby/client/net/NetConnectionReply.java

Modified: db/derby/code/branches/10.1/java/client/org/apache/derby/client/net/NetConnectionReply.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/client/org/apache/derby/client/net/NetConnectionReply.java?rev=407473&r1=407472&r2=407473&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/client/org/apache/derby/client/net/NetConnectionReply.java
(original)
+++ db/derby/code/branches/10.1/java/client/org/apache/derby/client/net/NetConnectionReply.java
Wed May 17 23:30:08 2006
@@ -28,6 +28,7 @@
 import org.apache.derby.client.am.SqlException;
 import org.apache.derby.client.am.SqlState;
 import org.apache.derby.client.am.Sqlca;
+import java.io.UnsupportedEncodingException;
 
 public class NetConnectionReply extends Reply
         implements ConnectionReplyInterface {
@@ -3122,35 +3123,42 @@
     // SQLDCXGRP; PROTOCOL TYPE N-GDA; ENVLID 0xD3; Length Override 1
     private int parseSQLDCGRP(Sqlca[] rowsetSqlca, int lastRow) throws DisconnectException
{
         int sqldcCode = readFastInt(); // SQLCODE
-        String sqldcState = readFastString(5, netAgent_.targetTypdef_.getCcsidSbcEncoding());
// SQLSTATE
+        String sqldcState = readFastString(5, Typdef.UTF8ENCODING); // SQLSTATE
         int sqldcReason = readFastInt();  // REASON_CODE
         int sqldcLinen = readFastInt(); // LINE_NUMBER
         int sqldcRown = (int) readFastLong(); // ROW_NUMBER
 
-        // save +20237 in the 0th entry of the rowsetSqlca's.
-        // this info is going to be used when a subsequent fetch prior is issued, and if
already
-        // received a +20237 then we've gone beyond the first row and there is no need to
-        // flow another fetch to the server.
-        if (sqldcCode == 20237) {
-            rowsetSqlca[0] = new NetSqlca(netAgent_.netConnection_,
-                    sqldcCode,
-                    sqldcState.getBytes(),
-                    null,
-                    netAgent_.targetTypdef_.getCcsidSbc());
-        } else {
-            if (rowsetSqlca[sqldcRown] != null) {
-                rowsetSqlca[sqldcRown].resetRowsetSqlca(netAgent_.netConnection_,
+        try
+        {
+            // save +20237 in the 0th entry of the rowsetSqlca's.
+            // this info is going to be used when a subsequent fetch prior is issued, and
if already
+            // received a +20237 then we've gone beyond the first row and there is no need
to
+            // flow another fetch to the server.
+            if (sqldcCode == 20237) {
+                rowsetSqlca[0] = new NetSqlca(netAgent_.netConnection_,
                         sqldcCode,
-                        sqldcState.getBytes(),
+                        sqldcState.getBytes(Typdef.UTF8ENCODING),
                         null,
                         netAgent_.targetTypdef_.getCcsidSbc());
             } else {
-                rowsetSqlca[sqldcRown] = new NetSqlca(netAgent_.netConnection_,
-                        sqldcCode,
-                        sqldcState.getBytes(),
-                        null,
-                        netAgent_.targetTypdef_.getCcsidSbc());
+                if (rowsetSqlca[sqldcRown] != null) {
+                    rowsetSqlca[sqldcRown].resetRowsetSqlca(netAgent_.netConnection_,
+                            sqldcCode,
+                            sqldcState.getBytes(Typdef.UTF8ENCODING),
+                            null,
+                            netAgent_.targetTypdef_.getCcsidSbc());
+                } else {
+                    rowsetSqlca[sqldcRown] = new NetSqlca(netAgent_.netConnection_,
+                            sqldcCode,
+                            sqldcState.getBytes(Typdef.UTF8ENCODING),
+                            null,
+                            netAgent_.targetTypdef_.getCcsidSbc());
+                }
             }
+        }
+        catch(UnsupportedEncodingException uee)
+        {
+            throw new DisconnectException(uee,netAgent_); 
         }
 
         // reset all entries between lastRow and sqldcRown to null



Mime
View raw message