User: kz      
Date: 2008-03-05 17:27:13+0000
Modified:
   dba/reportdesign/java/com/sun/star/report/SDBCReportData.java

Log:
 INTEGRATION: CWS rptchart01_DEV300 (1.2.70); FILE MERGED
 2008/02/20 10:52:55 oj 1.2.70.1: format changes

File Changes:

Directory: /dba/reportdesign/java/com/sun/star/report/
======================================================

File [changed]: SDBCReportData.java
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/java/com/sun/star/report/SDBCReportData.java?r1=1.2&r2=1.3
Delta lines:  +238 -238
-----------------------
--- SDBCReportData.java 2007-07-09 11:56:03+0000        1.2
+++ SDBCReportData.java 2008-03-05 17:27:10+0000        1.3
@@ -32,7 +32,6 @@
  *    MA  02111-1307  USA
  *
  ************************************************************************/
-
 package com.sun.star.report;
 
 import com.sun.star.beans.XPropertySet;
@@ -53,6 +52,7 @@
 
 public class SDBCReportData implements DataSource
 {
+
   private XRowSet rowSet;
   private XRow row;
   private int rowCount;
@@ -67,16 +67,18 @@
     row = (XRow) UnoRuntime.queryInterface(XRow.class, rowSet);
     this.rowSet = rowSet;
 
-    XParametersSupplier xSuppParams = 
(XParametersSupplier)UnoRuntime.queryInterface(
-      XParametersSupplier.class, rowSet );
-    if ( xSuppParams != null )
+        XParametersSupplier xSuppParams = (XParametersSupplier) 
UnoRuntime.queryInterface(
+                XParametersSupplier.class, rowSet);
+        if (xSuppParams != null)
+        {
       parameters = xSuppParams.getParameters();
+        }
 
     final XResultSetMetaDataSupplier sup = (XResultSetMetaDataSupplier) 
UnoRuntime.queryInterface(XResultSetMetaDataSupplier.class, rowSet);
     final XResultSetMetaData resultSetMetaData = sup.getMetaData();
 
     columnCount = resultSetMetaData.getColumnCount();
-    if ( parameters != null )
+        if (parameters != null)
     {
       firstParameterIndex = columnCount + 1;
       columnCount += parameters.getCount();
@@ -85,26 +87,26 @@
     columnTypes = new int[columnCount];
     columnNames = new String[columnCount];
 
-    for (int i = 1;i <= columnCount;++i)
+        for (int i = 1; i <= columnCount; ++i)
     {
-      if ( i < firstParameterIndex )
+            if (i < firstParameterIndex)
       {
-        columnNames[i-1] = resultSetMetaData.getColumnName(i);
-        columnTypes[i-1] = resultSetMetaData.getColumnType(i);
+                columnNames[i - 1] = resultSetMetaData.getColumnName(i);
+                columnTypes[i - 1] = resultSetMetaData.getColumnType(i);
       }
       else
       {
         try
         {
-          XPropertySet paramColumn = (XPropertySet)UnoRuntime.queryInterface(
-            XPropertySet.class, parameters.getByIndex(i-firstParameterIndex) );
-          columnNames[i-1] = (String)paramColumn.getPropertyValue( "Name" );
-          columnTypes[i-1] = ((Integer)paramColumn.getPropertyValue( "Type" 
)).intValue();
+                    XPropertySet paramColumn = (XPropertySet) 
UnoRuntime.queryInterface(
+                            XPropertySet.class, parameters.getByIndex(i - 
firstParameterIndex));
+                    columnNames[i - 1] = (String) 
paramColumn.getPropertyValue("Name");
+                    columnTypes[i - 1] = ((Integer) 
paramColumn.getPropertyValue("Type")).intValue();
         }
-        catch( Exception e )
+                catch (Exception e)
         {
-          columnNames[i-1] = "Error";
-          columnTypes[i-1] = DataType.CHAR;
+                    columnNames[i - 1] = "Error";
+                    columnTypes[i - 1] = DataType.CHAR;
         }
       }
     }
@@ -179,7 +181,6 @@
 //      throw new DataSourceException(e.getMessage(), e);
 //    }
 //  }
-
   static private java.sql.Date getDate(final Object obj)
   {
     java.sql.Date date = null;
@@ -242,8 +243,7 @@
     if (obj != null && obj instanceof Time)
     {
       final Time unoTime = (Time) obj;
-      time = java.sql.Time.valueOf
-          (getTimeString(unoTime.Hours, unoTime.Minutes, 
unoTime.Seconds).toString());
+            time = java.sql.Time.valueOf(getTimeString(unoTime.Hours, 
unoTime.Minutes, unoTime.Seconds).toString());
     }
     return time;
   }
@@ -268,30 +268,30 @@
   {
     try
     {
-      boolean isParameterValue = ( parameters != null ) && ( column >= 
firstParameterIndex );
+            boolean isParameterValue = (parameters != null) && (column >= 
firstParameterIndex);
       Object obj = null;
       boolean wasNull = true;
-      if ( isParameterValue )
+            if (isParameterValue)
       {
         try
         {
-          XPropertySet paramCol = (XPropertySet)UnoRuntime.queryInterface(
-            XPropertySet.class, parameters.getByIndex( column - 
firstParameterIndex ) );
-          obj = paramCol.getPropertyValue( "Value" );
+                    XPropertySet paramCol = (XPropertySet) 
UnoRuntime.queryInterface(
+                            XPropertySet.class, parameters.getByIndex(column - 
firstParameterIndex));
+                    obj = paramCol.getPropertyValue("Value");
           wasNull = false;
         }
-        catch( Exception e )
+                catch (Exception e)
         {
           wasNull = true;
         }
       }
       else
       {
-        obj = row.getObject( column, null );
+                obj = row.getObject(column, null);
         wasNull = row.wasNull();
       }
 
-      if ( wasNull )
+            if (wasNull)
       {
         return null;
       }




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to