ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum IndexWebSphere Message Broker SupportwebSphere MQ with Postgresql

Post new topicReply to topic Goto page 1, 2  Next
webSphere MQ with Postgresql View previous topic :: View next topic
Author Message
rajat11@
PostPosted: Fri Oct 21, 2016 1:52 am Post subject: webSphere MQ with Postgresql Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Fri Oct 21, 2016 4:22 am Post subject: Re: webSphere MQ with Postgresql Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 25552
Location: Ohio, 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
View user's profile Send private message
rajat11@
PostPosted: Fri Oct 21, 2016 5:20 am Post subject: Reply with quote

Novice

Joined: 27 Jun 2016
Posts: 10

Thank You Vitor.
I've gone through the knowledge center document regarding JDBC type 4 database connection, but the supported database list doesn't include PostgreSQL which i require.
I am confused whether or not it's supported in WMB.

https://www.ibm.com/support/knowledgecenter/en/SSMKHH_9.0.0/com.ibm.etools.mft.doc/ah10030_.htm

https://www.ibm.com/support/knowledgecenter/en/SSMKHH_9.0.0/com.ibm.etools.mft.doc/ac30494_.htm#ac30494_4


Any input will be valuable.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Oct 21, 2016 5:31 am Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Any JDBC provider is supported
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Oct 21, 2016 5:31 am Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 25552
Location: Ohio, 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
View user's profile Send private message
rajat11@
PostPosted: Tue Oct 25, 2016 3:17 am Post subject: Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Tue Oct 25, 2016 3:29 am Post subject: Reply with quote

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
Code:
code
you have written.
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
rajat11@
PostPosted: Tue Oct 25, 2016 4:05 am Post subject: Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Tue Oct 25, 2016 4:14 am Post subject: Reply with quote

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
View user's profile Send private message
rajat11@
PostPosted: Tue Oct 25, 2016 4:36 am Post subject: Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Tue Oct 25, 2016 4:45 am Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 25552
Location: Ohio, 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
View user's profile Send private message
stcft
PostPosted: Tue Oct 25, 2016 6:30 am Post subject: Reply with quote

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
View user's profile Send private message
rajat11@
PostPosted: Tue Oct 25, 2016 6:33 am Post subject: Reply with quote

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
View user's profile Send private message
rajat11@
PostPosted: Tue Oct 25, 2016 6:40 am Post subject: Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Tue Oct 25, 2016 7:10 am Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum IndexWebSphere Message Broker SupportwebSphere MQ with Postgresql
Jump to:



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP


Theme by Dustin Baccetti
Powered by phpBB 2001, 2002 phpBB Group

Copyright MQSeries.net. All rights reserved.