Class DOFJdbcUtil

java.lang.Object
org.eclnt.ccaddons.dof.util.DOFJdbcUtil

public class DOFJdbcUtil extends Object
Utilities for managing JDBC access.
  • Constructor Details

    • DOFJdbcUtil

      public DOFJdbcUtil()
  • Method Details

    • instance

      public static DOFJdbcUtil instance()
      Central factory method to obtain an instance of this util class.
    • designTimeInstance

      public static DOFJdbcUtil designTimeInstance(DOFProjectInfo dpi)
    • initialize

      public static void initialize(String driverClassName, String connectionURL)
      Initialization of JDBC connection. To be called prior to any other functions.
    • initialize

      public static void initialize(String driverClassName, String connectionURL, String userName, String password)
      Initialization of JDBC connection. To be called prior to any other functions.
    • initialize

      public static void initialize(IJDBCConnectionProvider connectionProvider)
      Initialization of JDBC connection. To be called prior to any other functions.
    • initializeViaDataSource

      public static void initializeViaDataSource(String dataSourceName)
    • initializeViaDataSource

      public static void initializeViaDataSource(String dataSourceName, String userName, String password)
    • getDbType

      public DOFJdbcDBType getDbType()
      Type of database. Use one of the DBTYPE* constants defined within this class.
    • setDbType

      public void setDbType(DOFJdbcDBType dbType)
    • setDbTypeById

      public void setDbTypeById(String id)
    • getDriverClassName

      public String getDriverClassName()
    • setDriverClassName

      public void setDriverClassName(String driverClassName)
    • getConnectionURL

      public String getConnectionURL()
    • setConnectionURL

      public void setConnectionURL(String connectionURL)
    • getUserName

      public String getUserName()
    • setUserName

      public void setUserName(String userName)
    • getPassword

      public String getPassword()
    • setPassword

      public void setPassword(String password)
    • getDataSourceName

      public String getDataSourceName()
    • setDataSourceName

      public void setDataSourceName(String dataSourceName)
    • createListEditor

      public DOFObjectListEditorUI createListEditor(String tableName)
      Create list editor for SQL table.
    • createListEditor

      public DOFObjectListEditorUI createListEditor(String tableName, IModeList modeList)
      Create list editor for SQL table.
    • createListEditor

      public DOFObjectListEditorUI createListEditor(String queryId, String query, IModeList modeList)
      Create list editor. The name of the queryId must be the name of the table that is edited.
      Parameters:
      queryId - Name of the table that is queried. E.g. "PERSON".
      query - Query that is executed for loading data. E.g. "SELECT * FROM PERSON".
    • updateListEditor

      public void updateListEditor(DOFObjectListEditorUI listEditor, String queryId, String query)
      Update the content of the list editor.
    • createListEditor

      public DOFObjectListEditorUI createListEditor(String queryId, ResultSet resultSet, IModeList modeList)
      Create list editor. The name of the queryId must be the name of the table that is edited.
      Parameters:
      queryId - Name of the table that is queried. E.g. "PERSON".
      resultSet - Result set of data that should be displayed within the list editor.
    • updateListEditor

      public void updateListEditor(DOFObjectListEditorUI listEditor, String queryId, ResultSet resultSet)
      Update the content of the list editor.
    • getObjectType

      protected DOFObjectType getObjectType(String queryId, ResultSet resultSet)
    • createFromResultSet

      public static List<DOFObject> createFromResultSet(String queryId, ResultSet resultSet)
    • createFromResultSet

      public static List<DOFObject> createFromResultSet(String queryId, ResultSet resultSet, int maxCount)
    • createFromSingleResultSet

      protected static DOFObject createFromSingleResultSet(String queryId, ResultSet resultSet)
    • registerResultSetInRepository

      protected static void registerResultSetInRepository(String queryId, ResultSet resultSet)
    • createDOFObjectTypeFromResultSet

      public DOFObjectType createDOFObjectTypeFromResultSet(String id, ResultSet resultSet)
    • pickConnection

      public Connection pickConnection()
      Create a JDBC connection, based on the JDBC connection information that was passed via initialize(String, String).
    • checkIfSQLSelectTopIsSupported

      public static boolean checkIfSQLSelectTopIsSupported()
    • checkIfSQLSelectFirstIsSupported

      public static boolean checkIfSQLSelectFirstIsSupported()
    • checkIfSQLSelectLimitIsSupported

      public static boolean checkIfSQLSelectLimitIsSupported()
    • registerObjectTypeForTable

      public DOFObjectType registerObjectTypeForTable(String queryId)
    • checkIfPropertyTypeIsClob

      public static boolean checkIfPropertyTypeIsClob(DOFPropertyType propertyType)