DB2 und VB .net
- Dieses Thema hat 3 Antworten und 1 Teilnehmer, und wurde zuletzt aktualisiert vor 11 Jahre, 1 Monat von
Anonym.
-
AuthorPosts
-
15. August 2012 um 13:01 Uhr #4160
AnonymInaktivHallo
Wir nutzen DB2 z/os Version 9 mit Java Clients die auf einem WIndows XP laufen. Batch Programme die Massen-Inserts tätigen nutzen die addBatch und executeBatch Funktionalität des JDBC Treibers.
Gibt es eine vergleichbare Möglichkeit für unsere VB .net Visual Studio 2010 Programmierer ? Diese haben zur Zeit massive Performance-Probleme über ihre API mit DB2-Connect
Besten Dank
Andreas
15. August 2012 um 19:26 Uhr #4299
AnonymInaktivHallo Andreas,
welche Version von DB2 Connect nutzt Ihr denn? Die V9.7 FixPack 4 hat sich – aus welchen Gründen auch immer – als "flott" erwiesen.
Es gibt so unglaublich viele Einflussfaktoren, dass ich Dir erstmal einen Blick in das kostenlose IBM Handbuch (PDF) "DB2 9 for z/OS: Distributed Functions" http://www.redbooks.ibm.com/abstracts/sg246952.html?Open empfehlen möchte.
Ein "Multi-Row Insert" könnte das Problem etwas entschärfen.
Veränderte Objekt-Definitionen (physische Implementierung) oder fehlende Objekt-Pflege (REORG, RUNSTATS) am DB2 z/OS können Ursache sein.
Übliche Verdächtige sich auch immer Firewalls und Viren Scanner.
Bin gespannt, wie die Geschichte weitergeht.
Gruß
Gernot
16. August 2012 um 14:11 Uhr #4397
AnonymInaktivHallo Gernot
Habe durch deinen RedBook-Hinweis nun sowas wie DB2BulkCopy und DB2DataAdapter UpdateBatchSize gefunden. Das testen wir mal
Bis dann
Andreas
16. August 2012 um 19:16 Uhr #4463
AnonymInaktivHi Andreas,
mit welchem .net Data Provider arbeitet Ihr? IBM empfiehlt den DB2 .NET Data provider = "DB2 Data Server provider for .net".
Microsoft provides two data providers, the OLE DB .NET Data Provider and ODBC .NET Data Provider. The OLE DB .NET Data Provider is a bridge provider that feeds ADO.NET requests to the IBM OLE DB Provider (by way of the COM interop module). ODBC .NET Data Provider is a bridge provider that feeds ADO.NET requests to the IBM ODBC Driver. These .NET data provider are not recommended for access to DB2 family databases. The IBM Data Server Provider for .NET is a high performance, managed ADO.NET data provider. This is the recommended .NET data provider for use with DB2 family databases. ADO.NET database access using the IBM Data Server Provider for .NET has fewer restrictions, and provides significantly better performance than the OLE DB and ODBC .NET bridge providers.
[code java]
//IBM Data Server Provider for .NET
DB2DataAdapter adapter = new DB2DataAdapter();//Data adapter object has the following public properties:
//*Â The DeleteCommand deletes records using SQL statements or stored procedures from the data set, for example:
adapter.DeleteCommand = new DB2Command(“DELETE From org WHERE
DEPTNUMB= 10â€, connection);
//*Â The InsertCommand inserts new records into a database using SQL or stored procedures, for example:
adapter.InsertCommand = new DB2Command(“INSERT INTO org VALUES
(30,‘Test’, 60, ‘Eastern’, ‘Toronto’)â€, connection);
//*Â The SelectCommand selects records in a database using SQL or stored procedures, for example:
adapter.SelectCommand = new DB2Command(“SELECT manager FROM org WHERE
DEPTNUMB = 30â€, connection);
//*Â The UpdateCommand updates records in a database using SQL or stored procedures, for example:
adapter.UpdateCommand = new DB2Command(“UPDATE org SET manager=70
WHERE DEPTNUMB=20â€, connection);//Data Adapter has the following public methods:
//*Â Fill: This fills records in DataSet, as shown below.
DataSet results= new DataSet();
adapter.SelectCommand = new DB2Command("Select * from dept", connection);
adapter.Fill(results);
//*Â Update: This updates records in DataSet and a database through INSERT, UPDATE, and DELETE operations, for example:
DataSet results= new DataSet();
adapter.UpdateCommand = new DB2Command(“UPDATE org SET Manager=70
WHERE DEPTNUMB=20â€, connection);
adapter.Update(results);
[/code]Viele Grüße
Gernot
-
AuthorPosts
You must be logged in to reply to this topic.