• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Use System Naming Convention and Library List with .NET Managed Provider

    October 13, 2004 Michael Sansoterra

    The iSeries .NET managed provider, first released in iSeries Access V5R3, lacked the ability to specify a library list and the SQL naming convention in connection strings. We were stuck with the defaults. However, with the introduction of service pack SI15176, in early September, IBM has enhanced the provider to set the library list and naming convention in the connection string.

    For those unfamiliar with the concept of a managed data provider, it is .NET’s plug-in equivalent to an ODBC driver in the Windows world or a JDBC driver in the Java world. Each database manufacturer creates a .NET provider to let .NET programs access data from their respective database. While .NET programs can use ODBC and OLE DB data sources, a database provider written specifically for .NET will perform better because special calls don’t need to be made to execute code written outside of the .NET framework (which is the case when using ODBC and OLE DB data access.)

    Below is a C# example of establishing a connection using the two new properties:

    
    private void ReadData()
    { 
          //
          // Naming Convention Values:  System 
          //                            SQL
          //
          iDB2Connection connDB2=new iDB2Connection( 
                  "DataSource=your400.yourcompany.com;" + 
                  "userid=MIKE;password=MYPASSWORD;" +
                  "LibraryList=*USRLIBL;Naming=System");
    
          iDB2Command cmdDB2=new iDB2Command(
                  "Select * From DataFile",
                   CommandType.Text, connDB2);
    
          iDB2DataReader drDB2;
    
          connDB2.Open();
          drDB2=cmdDB2.ExecuteReader();
    	  while(drDB2.Read())
          {
                       // Do something here
          }
          drDB2.Close();
          connDB2.Close();
    }
    

    The two new property names in the connection string are LibraryList and Naming. Unfortunately, the Programmer’s Toolkit help file was not updated with these new properties, so here is a brief explanation of each.

    LibraryList accepts a comma delimited list of libraries. Additionally, the *USRLIBL keyword can be specified to indicate the user library list should be used (the user library list will be inherited from the job description of the user ID used to establish the connection). Further, *USRLIBL can be used as a place holder for adding additional libraries. For example, LibraryList=*USRLIBL,TESTDATA will add the library TESTDATA after the user library list. Likewise, specifying LibraryList=TESTDATA,*USRLIBL will place TESTDATA first in the library list. As far as I can tell, this functionality is identical to the iSeries Access ODBC driver’s ability to set the library list.


    Naming accepts a value of System to indicate the system naming convention should be used, and SQL to indicate that the SQL naming convention should be used (SQL is the default). The basic difference between the two is the separator character and the system convention’s ability to use the library list for unqualified table names.

    For those of us getting to speed on .NET, IBM has made life easier because we don’t have to worry about some of the complexities of SQL programming using the SQL naming convention.

    For more information on these new properties, see the “ReadMeSP.txt” file that comes with SI15176.

    Michael Sansoterra is a programmer/analyst for i3 Business Solutions, an IT services firm based in Grand Rapids, Michigan. Click here to contact Michael Sansoterra by e-mail.

    Editor’s Note: Lorie DuBois, the developer responsible for the DB2 UDB .NET Data provider for iSeries, at IBM Rochester, had a clarification of the following sentence: “As far as I can tell, this functionality is identical to the iSeries Access ODBC driver’s ability to set the library list.” According to DuBois: “Our functionality is almost the same as the ODBC driver’s. The difference is with how we handle the Default Collection property. With ODBC, they add the Default Collection property to the library list. The .NET provider chose not to do this. With the .NET provider, if you want the Default Collection library in the library list, you must specifically include it.”

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    Sponsored by
    DRV Tech

    Get More Out of Your IBM i

    With soaring costs, operational data is more critical than ever. IBM shops need faster, easier ways to distribute IBM applications-based data to users more efficiently, no matter where they are.

    The Problem:

    For Users, IBM Data Can Be Difficult to Get To

    IBM Applications generate reports as spooled files, originally designed to be printed. Often those reports are packed together with so much data it makes them difficult to read. Add to that hardcopy is a pain to distribute. User-friendly formats like Excel and PDF are better, offering sorting, searching, and easy portability but getting IBM reports into these formats can be tricky without the right tools.

    The Solution:

    IBM i Reports can easily be converted to easy to read and share formats like Excel and PDF and Delivered by Email

    Converting IBM i, iSeries, and AS400 reports into Excel and PDF is now a lot easier with SpoolFlex software by DRV Tech.  If you or your users are still doing this manually, think how much time is wasted dragging and reformatting to make a report readable. How much time would be saved if they were automatically formatted correctly and delivered to one or multiple recipients.

    SpoolFlex converts spooled files to Excel and PDF, automatically emailing them, and saving copies to network shared folders. SpoolFlex converts complex reports to Excel, removing unwanted headers, splitting large reports out for individual recipients, and delivering to users whether they are at the office or working from home.

    Watch our 2-minute video and see DRV’s powerful SpoolFlex software can solve your file conversion challenges.

    Watch Video

    DRV Tech

    www.drvtech.com

    866.378.3366

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    BOSaNOVA and Wyse Look to the High End of Thin Clients IBM Completes i5 Squadrons with 64-Way Model 595

    Leave a Reply Cancel reply

Volume 4, Number 34 -- October 13, 2004
THIS ISSUE
SPONSORED BY:

T.L. Ashford
ProData Computer Svcs
WorksRight Software

Table of Contents

  • Anatomy of a P-Field
  • Use System Naming Convention and Library List with .NET Managed Provider
  • Handling Oversized Numbers Gracefully

Content archive

  • The Four Hundred
  • Four Hundred Stuff
  • Four Hundred Guru

Recent Posts

  • Meet The Next Gen Of IBMers Helping To Build IBM i
  • Looks Like IBM Is Building A Linux-Like PASE For IBM i After All
  • Will Independent IBM i Clouds Survive PowerVS?
  • Now, IBM Is Jacking Up Hardware Maintenance Prices
  • IBM i PTF Guide, Volume 27, Number 24
  • Big Blue Raises IBM i License Transfer Fees, Other Prices
  • Keep The IBM i Youth Movement Going With More Training, Better Tools
  • Remain Begins Migrating DevOps Tools To VS Code
  • IBM Readies LTO-10 Tape Drives And Libraries
  • IBM i PTF Guide, Volume 27, Number 23

Subscribe

To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

Pages

  • About Us
  • Contact
  • Contributors
  • Four Hundred Monitor
  • IBM i PTF Guide
  • Media Kit
  • Subscribe

Search

Copyright © 2025 IT Jungle