incubator-connectors-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1153702 - /incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/Database.java
Date Wed, 03 Aug 2011 23:28:30 GMT
Author: kwright
Date: Wed Aug  3 23:28:29 2011
New Revision: 1153702

URL: http://svn.apache.org/viewvc?rev=1153702&view=rev
Log:
More fixes for CONNECTORS-235.  Also use streams properly under PostgreSQL.

Modified:
    incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/Database.java

Modified: incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/Database.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/Database.java?rev=1153702&r1=1153701&r2=1153702&view=diff
==============================================================================
--- incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/Database.java
(original)
+++ incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/Database.java
Wed Aug  3 23:28:29 2011
@@ -955,14 +955,25 @@ public class Database
           {
           case java.sql.Types.CHAR :
           case java.sql.Types.VARCHAR :
-            if ((resultString = rs.getString(col)) != null)
+            switch (desiredForm)
             {
-              if (rsmd.getColumnDisplaySize(col) < resultString.length())
+            case ResultSpecification.FORM_DEFAULT:
+            case ResultSpecification.FORM_STRING:
+              if ((resultString = rs.getString(col)) != null)
               {
-                result = resultString.substring(0,rsmd.getColumnDisplaySize(col));
+                if (rsmd.getColumnDisplaySize(col) < resultString.length())
+                {
+                  result = resultString.substring(0,rsmd.getColumnDisplaySize(col));
+                }
+                else
+                  result = resultString;
               }
-              else
-                result = resultString;
+              break;
+            case ResultSpecification.FORM_STREAM:
+              result = new TempFileCharacterInput(rs.getCharacterStream(col));
+              break;
+            default:
+              throw new ManifoldCFException("Illegal form requested for column "+Integer.toString(col)+":
"+Integer.toString(desiredForm));
             }
             break;
           case java.sql.Types.CLOB :



Mime
View raw message