Package org.eclnt.ccaddons.dof.util
Class DOFJdbcUtil
java.lang.Object
org.eclnt.ccaddons.dof.util.DOFJdbcUtil
Utilities for managing JDBC access.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
checkIfPropertyTypeIsClob
(DOFPropertyType propertyType) static boolean
static boolean
static boolean
createDOFObjectTypeFromResultSet
(String id, ResultSet resultSet) createFromResultSet
(String queryId, ResultSet resultSet) createFromResultSet
(String queryId, ResultSet resultSet, int maxCount) protected static DOFObject
createFromSingleResultSet
(String queryId, ResultSet resultSet) createListEditor
(String tableName) Create list editor for SQL table.createListEditor
(String queryId, String query, IModeList modeList) Create list editor.createListEditor
(String queryId, ResultSet resultSet, IModeList modeList) Create list editor.createListEditor
(String tableName, IModeList modeList) Create list editor for SQL table.static DOFJdbcUtil
Type of database.protected DOFObjectType
getObjectType
(String queryId, ResultSet resultSet) static void
initialize
(String driverClassName, String connectionURL) Initialization of JDBC connection.static void
initialize
(String driverClassName, String connectionURL, String userName, String password) Initialization of JDBC connection.static void
initialize
(IJDBCConnectionProvider connectionProvider) Initialization of JDBC connection.static void
initializeViaDataSource
(String dataSourceName) static void
initializeViaDataSource
(String dataSourceName, String userName, String password) static DOFJdbcUtil
instance()
Central factory method to obtain an instance of this util class.Create a JDBC connection, based on the JDBC connection information that was passed viainitialize(String, String)
.registerObjectTypeForTable
(String queryId) protected static void
registerResultSetInRepository
(String queryId, ResultSet resultSet) void
setConnectionURL
(String connectionURL) void
setDataSourceName
(String dataSourceName) void
setDbType
(DOFJdbcDBType dbType) void
setDbTypeById
(String id) void
setDriverClassName
(String driverClassName) void
setPassword
(String password) void
setUserName
(String userName) void
updateListEditor
(DOFObjectListEditorUI listEditor, String queryId, String query) Update the content of the list editor.void
updateListEditor
(DOFObjectListEditorUI listEditor, String queryId, ResultSet resultSet) Update the content of the list editor.
-
Constructor Details
-
DOFJdbcUtil
public DOFJdbcUtil()
-
-
Method Details
-
instance
Central factory method to obtain an instance of this util class. -
designTimeInstance
-
initialize
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
Initialization of JDBC connection. To be called prior to any other functions. -
initializeViaDataSource
-
initializeViaDataSource
-
getDbType
Type of database. Use one of the DBTYPE* constants defined within this class. -
setDbType
-
setDbTypeById
-
getDriverClassName
-
setDriverClassName
-
getConnectionURL
-
setConnectionURL
-
getUserName
-
setUserName
-
getPassword
-
setPassword
-
getDataSourceName
-
setDataSourceName
-
createListEditor
Create list editor for SQL table. -
createListEditor
Create list editor for SQL table. -
createListEditor
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
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
Update the content of the list editor. -
getObjectType
-
createFromResultSet
-
createFromResultSet
-
createFromSingleResultSet
-
registerResultSetInRepository
-
createDOFObjectTypeFromResultSet
-
pickConnection
Create a JDBC connection, based on the JDBC connection information that was passed viainitialize(String, String)
. -
checkIfSQLSelectTopIsSupported
public static boolean checkIfSQLSelectTopIsSupported() -
checkIfSQLSelectFirstIsSupported
public static boolean checkIfSQLSelectFirstIsSupported() -
checkIfSQLSelectLimitIsSupported
public static boolean checkIfSQLSelectLimitIsSupported() -
registerObjectTypeForTable
-
checkIfPropertyTypeIsClob
-