org.wso2.carbon.dataservices.sql.driver

## Class TDriverUtil

- java.lang.Object
- - org.wso2.carbon.dataservices.sql.driver.TDriverUtil

-     public class TDriverUtil
      extends Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `CONF_REGISTRY_PATH_PREFIX`
    `static String` | `GOV_REGISTRY_PATH_PREFIX`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TDriverUtil()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static com.google.gdata.client.spreadsheet.SpreadsheetQuery` | `createSpreadSheetQuery(String spreadSheetName, URL spreadSheetFeedUrl)`
    `static com.google.gdata.client.spreadsheet.WorksheetQuery` | `createWorkSheetQuery(URL workSheetFeedUrl)`
    `static ParamInfo` | `findParam(ColumnInfo columnInfo, ParamInfo[] params)`
    `static List<String>` | `getAvailableDriverProperties()`
    `static String` | `getCellPosition(String id)`
    `static int` | `getColumnIndex(String id)`
    `static int` | `getCurrentTenantId()` Returns the best effort way of finding the current tenant id, even if this is not in a current message request, i.e.
    `static com.google.gdata.data.spreadsheet.WorksheetEntry` | `getCurrentWorkSheetEntry(TGSpreadConnection connection, String sheetName)`
    `static com.google.gdata.data.spreadsheet.CellFeed` | `getGSpreadCellFeed(TGSpreadConnection connection, com.google.gdata.data.spreadsheet.WorksheetEntry currentWorkSheet)`
    `static ColumnInfo[]` | `getHeaders(Connection connection, String tableName)`
    `static InputStream` | `getInputStreamFromPath(String path)` Creates and returns an InputStream from the file path / http location given.
    `static com.google.gdata.data.spreadsheet.ListFeed` | `getListFeed(TGSpreadConnection connection, com.google.gdata.data.spreadsheet.WorksheetEntry currentWorkSheet)`
    `static int` | `getRowIndex(String id)`
    `static boolean` | `isRegistryPath(String path)`
    `static void` | `writeRecords(org.apache.poi.ss.usermodel.Workbook workbook, String filePath)` Method to write excel data to registry or file output streams.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### GOV_REGISTRY_PATH_PREFIX

          public static final String GOV_REGISTRY_PATH_PREFIX

      See Also:
        Constant Field Values

    - #### CONF_REGISTRY_PATH_PREFIX

          public static final String CONF_REGISTRY_PATH_PREFIX

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### TDriverUtil

          public TDriverUtil()

  - ### Method Detail

    - #### getAvailableDriverProperties

          public static List<String> getAvailableDriverProperties()

    - #### getHeaders

          public static ColumnInfo[] getHeaders(Connection connection,
                                                String tableName)
                                         throws SQLException

      Throws:
        `SQLException`

    - #### getCurrentWorkSheetEntry

          public static com.google.gdata.data.spreadsheet.WorksheetEntry getCurrentWorkSheetEntry(TGSpreadConnection connection,
                                                                                                  String sheetName)
                                                                                           throws SQLException

      Throws:
        `SQLException`

    - #### getGSpreadCellFeed

          public static com.google.gdata.data.spreadsheet.CellFeed getGSpreadCellFeed(TGSpreadConnection connection,
                                                                                      com.google.gdata.data.spreadsheet.WorksheetEntry currentWorkSheet)
                                                                               throws SQLException

      Throws:
        `SQLException`

    - #### getListFeed

          public static com.google.gdata.data.spreadsheet.ListFeed getListFeed(TGSpreadConnection connection,
                                                                               com.google.gdata.data.spreadsheet.WorksheetEntry currentWorkSheet)
                                                                        throws SQLException

      Throws:
        `SQLException`

    - #### getColumnIndex

          public static int getColumnIndex(String id)

    - #### getRowIndex

          public static int getRowIndex(String id)

    - #### getCellPosition

          public static String getCellPosition(String id)

    - #### createSpreadSheetQuery

          public static com.google.gdata.client.spreadsheet.SpreadsheetQuery createSpreadSheetQuery(String spreadSheetName,
                                                                                                    URL spreadSheetFeedUrl)

    - #### createWorkSheetQuery

          public static com.google.gdata.client.spreadsheet.WorksheetQuery createWorkSheetQuery(URL workSheetFeedUrl)

    - #### findParam

          public static ParamInfo findParam(ColumnInfo columnInfo,
                                            ParamInfo[] params)

    - #### writeRecords

          public static void writeRecords(org.apache.poi.ss.usermodel.Workbook workbook,
                                          String filePath)
                                   throws SQLException

      Method to write excel data to registry or file output streams.
      Parameters:
        `workbook` -
        `filePath` -
      Throws:
        `SQLException`

    - #### getInputStreamFromPath

          public static InputStream getInputStreamFromPath(String path)
                                                    throws IOException,
                                                           SQLException

      Creates and returns an InputStream from the file path / http location given.
      Throws:
        `IOException,` - SQLException
        `IOException`
        `SQLException`
      See Also:
        `InputStream`

    - #### isRegistryPath

          public static boolean isRegistryPath(String path)

    - #### getCurrentTenantId

          public static int getCurrentTenantId()

      Returns the best effort way of finding the current tenant id, even if this is not in a current message request, i.e. deploying services. Assumption: when tenants other than the super tenant is activated, the registry service must be available. So, the service deployment and accessing the registry, will happen in the same thread, without the callbacks being used.
      Returns:
        The tenant id

Copyright © 2019 WSO2. All rights reserved.