I use Hibernate in my JSF application to manage a database. The entities have finders and some other methods.
I have a need to integrate this data into a WebSphere Message Broker (WMB) application. I can load all the classes just fine, my entities work up to making the connection to the JDBC Oracle database.
Now I can connect to that same database from WMB application using a Configurable JDBC Service from Java, as follows...
Code:
try {
// Obtain a java.sql.Connection using a JDBC Type4 datasource - in this example for a
// JDBC broker configurable service called "MyDB2"
Connection conn = getJDBCType4Connection("DOCDBCS",
JDBC_TransactionType.MB_TRANSACTION_AUTO);
// Example of using the Connection to create a java.sql.Statement
Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
ResultSet rs = stmt.executeQuery("SELECT * FROM NGATE_USER.DOC_RULE_DEFINITION");
So I am getting a good Connection and can execute Statements ok. How do I get hibernate to use this same connection?