|
> date: Tue, 21 Jun 2005 09:39:39 -0400 > from: Steve Richter <stephenrichter@xxxxxxxxx> > subject: Re: Java vs .NET was: RPGIII compiler vs Visual Basic > > The advantage of using sql server in .net code is you get better > dataset functionality. As I understand it, to change from sqlserver > to mysql in .NET code you have to actually change your code - use the > MySqlCommand class in place of the SqlCommand class. You can code > initially using the generic whatever classes, but you lose some data > set functionality. A DataSet is a DataSet is a DataSet. All the Managed Providers can return a DataSet (using DataAdapter.Fill()) or you can read through with a DataReader. From a .NET perspective, what is easier using SQLServer are the tools built into VS.NET. Yes, to use the MySQL Managed Provider, or any others, you have to specify which one you wish to use. JDBC has this as well in that you have to specify which driver you want to use. The difference is that in JDBC the driver is a string: in .NET you have to actually code for the particular class. To get over this hurdle, I wrote an interface called IDBAccess. I then implemented a wrapper class for each Database type that implements the IDBAccess methods and properties. In each of these classes I handle whatever vagaries there might be: using Integrated Security in SqlServer, handling the different Exception properites that are reported by each type, etc. To cap it all off, I then wrote a DBAccessManager class that wraps all of these wrappers. Now when I want to create a database connection, it looks something like this: DBAccessManager db = new DBAccessManager( SWallTech.DB.DatabaseTypes.iSeriesDB2 , datasource , database , userID , password , securityType ); The first parameter is an Enumeration that lists all the database types supported by the wrapper. In the case of iHOC, the user confgiures his connections and all this data is stored. Then when they want to connect to a particular database, the just select that configuration. This way, I don't have to code for the particular classes, just the interface. Joel Cochran http://www.rpgnext.com
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.