﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Issues  » DB2 Provider - updates/CRUD</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 04:15:07 GMT</lastBuildDate><ttl>20</ttl><item><title>DB2 Provider - updates/CRUD</title><link>http://forum.strataframe.net/FindPost11443.aspx</link><description>I finally got connected to our AS400 using DB2Connect software from IBM, not sure why I need another product to do this but according to IBM I do, and our IBM guy says that isnt a stranger model for them to have. Oh well, moving on.&lt;br&gt;
&lt;br&gt;
I am able to use the BO Mapper against my AS400 OS400 DB2 databases,libraries, and tables, map to business objects and use the "read only" type controls like bound textboxes, the SF Maintenance form, ListView, and BrowseDialog, a hug improvement from 2 weeks ago :)&lt;br&gt;
&lt;br&gt;
Now I need to figure out what to set up for updates and CRUD settings, when I try to "save" it blows out saying there is no primekey on the table (which there is). I imaging is is because I have always relied on the DDT to create sprocs for CRUD, and I cant with the DB2 model.&lt;br&gt;
&lt;br&gt;
So, where do I go from here? Do I need to create sprocs on the 400 for these? Our in-house 400 guy is an RPM programmer and has never used stored procedures. I nudge along the right direction will be much appreciated.&lt;br&gt;
&lt;br&gt;
Licensing for the DB2Connect product is about $500.00 for a sinlge user, or $2,500.00 for 25 named users, if anyone was curious.&lt;br&gt;
&lt;br&gt;
Thanks,&lt;br&gt;
&lt;br&gt;
Keith</description><pubDate>Wed, 19 Sep 2007 12:47:35 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item><item><title>RE: DB2 Provider - updates/CRUD</title><link>http://forum.strataframe.net/FindPost11587.aspx</link><description>Aha, glad to set you straight :)</description><pubDate>Wed, 19 Sep 2007 12:47:35 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: DB2 Provider - updates/CRUD</title><link>http://forum.strataframe.net/FindPost11580.aspx</link><description>[quote]&lt;br&gt;
'-- Change the SetDataSources() method in the AppMain.vb to use your new class, not the SF item&lt;br&gt;
[/quote]&lt;br&gt;
&lt;br&gt;
that is the piece I was missing thanks Ben!!</description><pubDate>Wed, 19 Sep 2007 09:48:58 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item><item><title>RE: DB2 Provider - updates/CRUD</title><link>http://forum.strataframe.net/FindPost11577.aspx</link><description>Sure thing :)&lt;/P&gt;&lt;P&gt;'-- Custom data source class&lt;BR&gt;Public Class MyDb2DataSourceItem&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Inherits MicroFour.StrataFrame.Data.Db2.Db2DataSourceItem&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Sub New(ByVal dataSourceKey As String, ByVal connectionString As String)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyBase.New(dataSourceKey, connectionString, _&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Data.Common.DbProviderFactories.GetFactory("IBM.Data.DB2"))&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Overrides Function CreateBlankDbConnection() As System.Data.Common.DbConnection&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim conn As System.Data.Common.DbConnection&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; conn = MyBase.CreateBlankDbConnection()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DirectCast(conn, IBM.DB2.Data.DB2Connection).NoJournaling = True&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return conn&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Function&lt;/P&gt;&lt;P&gt;End Class&lt;BR&gt;&lt;BR&gt;'-- Change the SetDataSources() method in the AppMain.vb to use your new class, not the SF item&lt;BR&gt;Public Shared Sub SetDataSources()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataLayer.DataSources.Add(New MyDb2DataSourceItem("", "db2 connection string"))&lt;BR&gt;End Sub&lt;/P&gt;&lt;P&gt;So, create your own class, and all you have to override is the CreateBlankDbConnection().&amp;nbsp; So, get the connection and modify that journaling property before you return it.</description><pubDate>Wed, 19 Sep 2007 09:14:58 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: DB2 Provider - updates/CRUD</title><link>http://forum.strataframe.net/FindPost11561.aspx</link><description>I feel dumb asking with all the "of course" language, but can you expand upon this, I do not know how to implement your solution.&lt;br&gt;
&lt;br&gt;
Thanks.</description><pubDate>Tue, 18 Sep 2007 18:46:53 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item><item><title>RE: DB2 Provider - updates/CRUD</title><link>http://forum.strataframe.net/FindPost11549.aspx</link><description>Or, of course, call MyBase.CreateBlankDbConnection() and just modify the property on the return value before you return it ;)</description><pubDate>Tue, 18 Sep 2007 13:50:23 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: DB2 Provider - updates/CRUD</title><link>http://forum.strataframe.net/FindPost11548.aspx</link><description>You can accomplish this by subclassing the Db2DataSourceItem class and overriding the CreateBlankDbConnection() method.&amp;nbsp; This is the current code, so just modify it to turn off journaling on the connection before you return it:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Overrides Function CreateBlankDbConnection() As System.Data.Common.DbConnection&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim conn As DbConnection = Me._Factory.CreateConnection()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; conn.ConnectionString = Me.ConnectionString&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return conn&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Function&lt;/P&gt;&lt;P&gt;The _Factory is, of course private, but you can either override the constructor and store it off yourself, or just create a new DB2Connection object, since you know what provider you're using :)</description><pubDate>Tue, 18 Sep 2007 13:49:50 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: DB2 Provider - updates/CRUD</title><link>http://forum.strataframe.net/FindPost11535.aspx</link><description>I have this problem. Any idea where I can set the property IBM refers to as the fix? I think the connection object is encapsulated in your DB2 provider, yes?&lt;br&gt;
&lt;br&gt;
My customer does not want to turn on journaling.&lt;br&gt;
&lt;br&gt;
http://www-1.ibm.com/support/docview.wss?uid=swg21206832</description><pubDate>Tue, 18 Sep 2007 11:05:46 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item><item><title>RE: DB2 Provider - updates/CRUD</title><link>http://forum.strataframe.net/FindPost11452.aspx</link><description>[quote]What I would give for "edit your own post" ability, sorry for the above, been a bad day.&lt;/P&gt;&lt;P&gt;RPM = RPG[/quote]&lt;/P&gt;&lt;P&gt;Hehe, I just figured the guy was really a car mechanic ;)&lt;/P&gt;&lt;P&gt;As for the stored procedures, you don't have to use them.&amp;nbsp; If you want you use them, you'll need to hand code them (good luck), otherwise, the businss object will generate the CRUD statements on its own.&amp;nbsp; So, as for why the BOMapper isn't picking up on the primary key, I don't know.&amp;nbsp; When you view the fields within the BOMapper, do any of the fields show up with the little key icon?&amp;nbsp; If not, you can specify the primary key for the business object by going into the business object's properties within the BOMapper.&amp;nbsp; There is a field for overriding the PK specification.&amp;nbsp; You can't enter the field, but if you hit the browse button, you'll get a dialog that allows you to enter the field(s) that is the primary key.&amp;nbsp; Once you have that set, everything should be good and allow you enter records.</description><pubDate>Thu, 13 Sep 2007 09:45:14 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: DB2 Provider - updates/CRUD</title><link>http://forum.strataframe.net/FindPost11444.aspx</link><description>What I would give for "edit your own post" ability, sorry for the above, been a bad day.&lt;br&gt;
&lt;br&gt;
RPM = RPG</description><pubDate>Wed, 12 Sep 2007 11:17:28 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item></channel></rss>