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 Index » WebSphere Message Broker (ACE) Support » Best Approach To Insert Data To SQL DB - IIB9

Post new topic  Reply to topic Goto page 1, 2  Next
 Best Approach To Insert Data To SQL DB - IIB9 « View previous topic :: View next topic » 
Author Message
bdaoust
PostPosted: Mon Aug 10, 2015 8:19 am    Post subject: Best Approach To Insert Data To SQL DB - IIB9 Reply with quote

Centurion

Joined: 23 Sep 2010
Posts: 130

I have a requirement to data an XML file and store data from that XML if certain conditions are met. For instance, if the Elements Node has a Element description of 'SSD' then move the premium value over to a field called SSDPremium.

I was able to do this using a mapping node to DFDL definition and a temporary queue so I could see the results.

Now, I'm being asked to have this stored in a SQL database so the users can run a SSRS report.

I'm wondering what the best approach is to take here. I've used Database Node and ESQL back in WMB7, but didn't know if there is a better approach to consider. I read somewhere use .NET, but unfortunately our broker is on Unix.

I should also mention that I must first need to determine if the record in SQL exist because if not, then it's an insert, otherwise it's an update.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Aug 10, 2015 8:27 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

The mapping node will use JDBC to talk to databases.
Back to top
View user's profile Send private message
bdaoust
PostPosted: Mon Aug 10, 2015 9:12 am    Post subject: Reply with quote

Centurion

Joined: 23 Sep 2010
Posts: 130

Thanks mqjeff.

If there a way to connect using an existing ODBC connection? Our current use of database connections is using the Database node which we can supply the data source, which is a ODBC connection defined on the server.

I'm not certain that our Unix admins will be willing to install any additional drivers, such as the JDBC driver.

Thanks
Back to top
View user's profile Send private message
ganesh
PostPosted: Mon Aug 10, 2015 9:17 am    Post subject: Reply with quote

Master

Joined: 18 Jul 2010
Posts: 294

bdaoust wrote:
Thanks mqjeff.

If there a way to connect using an existing ODBC connection? Our current use of database connections is using the Database node which we can supply the data source, which is a ODBC connection defined on the server.

I'm not certain that our Unix admins will be willing to install any additional drivers, such as the JDBC driver.

Thanks


Just create a data source and use, you do not need any additional drivers to connect to SQL DB.

Better approach for you to insert the data to db if it is not present already would be to create a stored procedure and let the stored procedure do all of that and just return a return code based on outcome.
Back to top
View user's profile Send private message
bdaoust
PostPosted: Mon Aug 10, 2015 9:44 am    Post subject: Reply with quote

Centurion

Joined: 23 Sep 2010
Posts: 130

When you say just create a data source and use, do you mean a Data Design Project?

Looks to me that a data source needs to be created on the server that hosts the broker, which I don't have access to.

According to the documentation, if I want to use a database in the mapping node, I have to have a data design project and cannot simply just indicate a data source like you can with a database node.
Back to top
View user's profile Send private message
ganesh
PostPosted: Mon Aug 10, 2015 10:07 am    Post subject: Reply with quote

Master

Joined: 18 Jul 2010
Posts: 294

bdaoust wrote:


Looks to me that a data source needs to be created on the server that hosts the broker, which I don't have access to.
.


Ask your admins to create one for you.
Back to top
View user's profile Send private message
bdaoust
PostPosted: Mon Aug 10, 2015 11:36 am    Post subject: Reply with quote

Centurion

Joined: 23 Sep 2010
Posts: 130

Ganesh:

As I already said:

According to the documentation, if I want to use a database in the mapping node, I have to have a data design project and cannot simply just indicate a data source like you can with a database node. And it looks like a data design project requires the use of JDBC driver.

Can anyone confirm what I'm reading ?

Thanks
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Aug 10, 2015 11:46 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

bdaoust wrote:
Ganesh:

As I already said:

According to the documentation, if I want to use a database in the mapping node, I have to have a data design project and cannot simply just indicate a data source like you can with a database node. And it looks like a data design project requires the use of JDBC driver.

Can anyone confirm what I'm reading ?


If you're using a Mapping node, the node requires the layout of the database through a data design project in the same way it requires the layout of the message (through DFDL & XSD). It does not allow you to write anonymous ESQL the way the Database node does, because it's a graphical mapper and not a code container.

The Mapping node also used a JDBC connection instead of an ODBC connection. Any database that has ODBC drivers loaded probably has JDBC drivers loaded, and you don't need a "data source" because JDBC doesn't use data sources. You do need a JDBC connection but that's on the broker side not the database side.

You can of course use a Database node and ESQL like you did in v7. But

bdaoust wrote:
didn't know if there is a better approach to consider


That would be the Mapping node mentioned by my most worthy associate.
_________________
Honesty is the best policy.
Insanity is the best defence.


Last edited by Vitor on Mon Aug 10, 2015 11:47 am; edited 1 time in total
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Aug 10, 2015 11:46 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

The mapping node requires a Data Design project *in the toolkit ONLY*. So that it can know about your database schemas so that you can build the map.

In runtime, you should get your admins to create a JDBC Configurable Service.
Back to top
View user's profile Send private message
bdaoust
PostPosted: Mon Aug 10, 2015 11:57 am    Post subject: Reply with quote

Centurion

Joined: 23 Sep 2010
Posts: 130

Thanks for the replies.

So if I get the data design working within my toolkit, there is a separate task the admins will need to do?

Usually they just deploy my BAR. If there will be additional tasks for them to do, I should make sure they can/will do that before I invest time into a data design on my end.
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Aug 10, 2015 12:16 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

bdaoust wrote:
So if I get the data design working within my toolkit, there is a separate task the admins will need to do?




mqjeff wrote:
In runtime, you should get your admins to create a JDBC Configurable Service




bdaoust wrote:
Usually they just deploy my BAR. If there will be additional tasks for them to do, I should make sure they can/will do that before I invest time into a data design on my end.


You've got a fairly dull broker code base if the broker admins have never had to do anything except deploy the bar file.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
bdaoust
PostPosted: Mon Aug 10, 2015 12:30 pm    Post subject: Reply with quote

Centurion

Joined: 23 Sep 2010
Posts: 130

Oh I don't disagree. Most of projects were built in WMB6 days and since then there hasn't been a lot of interest in doing tasks in message broker. I've been trying to do new things in broker to show them the possibilities, but often it's hard to get them to buy in.

It's unfortunate because I really enjoy working in the toolkit. I see a lot of potential.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Aug 11, 2015 4:16 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

May be you should provide them with the additional scripts to execute.
So on top of running the bar file, have them run a generic script.
Have that script call all the specific scripts you need for the deployment...

Makes it easier for them. They'd have to run 2 scripts only...

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
bdaoust
PostPosted: Wed Aug 12, 2015 12:16 pm    Post subject: Reply with quote

Centurion

Joined: 23 Sep 2010
Posts: 130

fjb_saper:

Not sure what the other scripts would do that you are referring to.

Perhaps execute some mqsi commands?

One thing that also comes into play is that I'm running windows with only toolkit (no local broker instance) and broker runs in Unix on our servers.
Back to top
View user's profile Send private message
bdaoust
PostPosted: Wed Aug 12, 2015 12:21 pm    Post subject: Reply with quote

Centurion

Joined: 23 Sep 2010
Posts: 130

So ganesh made the suggestion of doing a stored procedure. I'm assuming the stored procedure would be on the SQL server side and broker just calls it passing the message as a parameter and waits for a return value.

the SP on SQL server would parse the XML message into the database.

Any pros/cons to that?

Again, looking for the best approach and if it means I go into unchartered terriority - that is fine. I'm not afraid.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Best Approach To Insert Data To SQL DB - IIB9
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.