Author |
Message
|
rajat11@ |
Posted: Fri Oct 21, 2016 1:52 am Post subject: webSphere MQ with Postgresql |
|
|
Novice
Joined: 27 Jun 2016 Posts: 10
|
Hi everyone,
Currently i am using Db2 as a database , But for some requirement change i need to shift on opensource database POSTGRESQL , can anyone please tell me how to establish CONNECTION or create configure file to connect java app & database (In java i am using jdbc type 4 driver) ?? |
|
Back to top |
|
 |
Vitor |
Posted: Fri Oct 21, 2016 4:22 am Post subject: Re: webSphere MQ with Postgresql |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
rajat11@ wrote: |
(In java i am using jdbc type 4 driver) ?? |
IIB supports the use of jdbc type 4 drivers. The procedure for doing this is fully laid out in the Knowledge Center. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
rajat11@ |
Posted: Fri Oct 21, 2016 5:20 am Post subject: |
|
|
Novice
Joined: 27 Jun 2016 Posts: 10
|
|
Back to top |
|
 |
mqjeff |
Posted: Fri Oct 21, 2016 5:31 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
|
Back to top |
|
 |
Vitor |
Posted: Fri Oct 21, 2016 5:31 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
rajat11@ wrote: |
I am confused whether or not it's supported in WMB. |
I don't see why. You posted this link:
https://www.ibm.com/support/knowledgecenter/en/SSMKHH_9.0.0/com.ibm.etools.mft.doc/ah10030_.htm.
This page says:
Quote: |
Any JDBC provider is supported, therefore if a JDBC provider is not listed in the supported database table in the previous section, IBM Integration Bus provides limited support subject to the following restrictions |
It then goes on to list the criteria, and I've no idea if your particular db meets the criteria. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
rajat11@ |
Posted: Tue Oct 25, 2016 3:17 am Post subject: |
|
|
Novice
Joined: 27 Jun 2016 Posts: 10
|
I've downloaded the necessary jars for connecting WMB to postgres but now i'm getting a new error
ERROR-
<com.ibm.broker.plugin.MbDatabaseException class:com.ibm.broker.jdbctype4.jdbcdbasemgr.JDBCType4Connection@4868ded8 method:JDBCType4Connection::createXAConnection source:BIPmsgs key:6233 >
at com.ibm.broker.jdbcnodes.JDBCCommon.throwException(JDBCCommon.java:566)
at com.ibm.broker.jdbctype4.jdbcdbasemgr.JDBCType4Connection.createXAConnection(JDBCType4Connection.java:446)
do you have any idea regarding this? |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Oct 25, 2016 3:29 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Again, from the link you posted
Quote: |
For XA connections, the following restrictions apply:
On distributed platforms, only DB2 and Oracle are supported.
On z/OS, XA connections are not supported.
|
Please show the
you have written. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
rajat11@ |
Posted: Tue Oct 25, 2016 4:05 am Post subject: |
|
|
Novice
Joined: 27 Jun 2016 Posts: 10
|
I'am using getJDBCType4Connection() API call from the java compute node to make the connection with the DB. I've given the JDBC provider configurable service file-name(i.e. JDBC_DSN) as the data source name parameter of the API.
As shown below,
Connection conn = getJDBCType4Connection(JDBC_DSN, JDBC_TransactionType.MB_TRANSACTION_AUTO);
And my configurable service contains the following data:
connectionUrlFormat - jdbc:postgresql://[dbhost]:[port]/[dbname]
type4DatasourceClassName - org.postgresql.ds.PGSimpleDataSource
type4DriverClassName - org.postgresql.Driver
and other details like servername, port etc. |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Oct 25, 2016 4:14 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Ok, so you're using MB_TRANSACTION_AUTO, which is the only one you can use when you use getJDBCType4Connection. We've seen people try and do their own JDBC commits and a whole lot of other bad practices.
Look at the transaction mode of the flow, and the JavaComputeNode. You need to make sure at least one of them specifies that it is not a transaction. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
rajat11@ |
Posted: Tue Oct 25, 2016 4:36 am Post subject: |
|
|
Novice
Joined: 27 Jun 2016 Posts: 10
|
Thanks for looking into the issue
I've tried several things but still facing the error. Should I change the getJDBCType4Connection() part and use some other way to make connection with the database?? |
|
Back to top |
|
 |
Vitor |
Posted: Tue Oct 25, 2016 4:45 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
rajat11@ wrote: |
Should I change the getJDBCType4Connection() part and use some other way to make connection with the database?? |
I concur with my most worthy associate. You should widen your view, stop looking directly at this connection statement and review the rest of the node / flow to ensure proper transaction handling. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
stcft |
Posted: Tue Oct 25, 2016 6:30 am Post subject: |
|
|
Newbie
Joined: 25 Oct 2016 Posts: 1
|
rajat11@ wrote: |
I've tried several things but still facing the error. Should I change the getJDBCType4Connection() part and use some other way to make connection with the database?? |
Have you tried making successful connection with any database other than PostgreSQL? |
|
Back to top |
|
 |
rajat11@ |
Posted: Tue Oct 25, 2016 6:33 am Post subject: |
|
|
Novice
Joined: 27 Jun 2016 Posts: 10
|
stcft wrote: |
Have you tried making successful connection with any database other than PostgreSQL? |
yes, my message flow was making successful connection to DB2 earlier, which I need to change to PostgreSQL.
Last edited by rajat11@ on Tue Oct 25, 2016 6:41 am; edited 1 time in total |
|
Back to top |
|
 |
rajat11@ |
Posted: Tue Oct 25, 2016 6:40 am Post subject: |
|
|
Novice
Joined: 27 Jun 2016 Posts: 10
|
Vitor wrote: |
stop looking directly at this connection statement and review the rest of the node / flow to ensure proper transaction handling.
|
I've reviewed the complete flow and codes and it's perfectly handling the transaction
It's just the API call which is raising the MbdatabaseException.
Maybe there is something wrong with my configurable service which I need to figure out. |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Oct 25, 2016 7:10 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Your JavaCompute node can not be in a message flow transaction, afaik.
It has to be outside the transaction. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
|