473,795 Members | 3,428 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DB2 version without connection

What would be the best way to obtain a DB2 UDB (major) version for
particular DB2 database, preferably by the C language style API.

I have to develop a client application that first has to figure out a
DB2 UDB version (can be 5, 6, 7, or 8) for the DB2 database passed
dynamically as run time parameter to the application.

So first function should take a database name as a parameter and
return an integer (5, 6, 7, or 8, depending what is, for that
database, the DB2 version used). This function should not connect to
the database. I would use DB2 API that does not require a connection
to the database, I guess. Any level of complexity of API without a DB2
connection would be fine. I can not use CLI/ODBC or JDBC in this
function, but I may use all them after in the rest of application.

I think when you catalog a database, the DB2 version for the database
is stored locally on the client side, and I need to retrieve that,
perhaps using sqledgne - Get Next Database Directory Entry and related
API-s. I have not tried that because when I executed the DB2 command
LIST DB DIRECTORY (which is basically same) I am getting Database
release level a.00 (where ‘a' in the ‘a.00' is an ASCII 228
character), but should be 8.00 or something like that, so I am not
confident that this is a way to do that.

Please ask me for more detail if I have not explained this properly.
Nov 12 '05 #1
8 2243

"DB2SQL" <db****@sympati co.ca> wrote in message
news:3d******** *************** **@posting.goog le.com...
What would be the best way to obtain a DB2 UDB (major) version for
particular DB2 database, preferably by the C language style API.

I have to develop a client application that first has to figure out a
DB2 UDB version (can be 5, 6, 7, or 8) for the DB2 database passed
dynamically as run time parameter to the application.

So first function should take a database name as a parameter and
return an integer (5, 6, 7, or 8, depending what is, for that
database, the DB2 version used). This function should not connect to
the database. I would use DB2 API that does not require a connection
to the database, I guess. Any level of complexity of API without a DB2
connection would be fine. I can not use CLI/ODBC or JDBC in this
function, but I may use all them after in the rest of application.

I think when you catalog a database, the DB2 version for the database
is stored locally on the client side, and I need to retrieve that,
perhaps using sqledgne - Get Next Database Directory Entry and related
API-s. I have not tried that because when I executed the DB2 command
LIST DB DIRECTORY (which is basically same) I am getting Database
release level a.00 (where 'a' in the 'a.00' is an ASCII 228
character), but should be 8.00 or something like that, so I am not
confident that this is a way to do that.

Please ask me for more detail if I have not explained this properly.


I don't know how to accomplish what you want with the C API; I don't really
program in C any more so I don't know if it is possible or not.

You can get exactly what you want very easily with JDBC. The
getDatabaseMajo rVersion() method in the DatabaseMetaDat a interface will
"retrieve the major version number of the underlying database", according to
the Java API. [You can also use getDatabaseMino rVersion() in the same
interface if you need to distinguish between V8.1 and V8.2 for example.]

However, this approach requires you to get a database connection first
though and I know you don't want that.

There *may* be a way to get the information without a database connection
but I don't know of any; all database accesses I've ever done has required a
connection first.

Rhino
Nov 12 '05 #2
DB2SQL wrote:
What would be the best way to obtain a DB2 UDB (major) version for
particular DB2 database, preferably by the C language style API.

I have to develop a client application that first has to figure out a
DB2 UDB version (can be 5, 6, 7, or 8) for the DB2 database passed
dynamically as run time parameter to the application.

So first function should take a database name as a parameter and
return an integer (5, 6, 7, or 8, depending what is, for that
database, the DB2 version used). This function should not connect to
the database. I would use DB2 API that does not require a connection
to the database, I guess. Any level of complexity of API without a DB2
connection would be fine. I can not use CLI/ODBC or JDBC in this
function, but I may use all them after in the rest of application.

I think when you catalog a database, the DB2 version for the database
is stored locally on the client side, and I need to retrieve that,
perhaps using sqledgne - Get Next Database Directory Entry and related
API-s. I have not tried that because when I executed the DB2 command
LIST DB DIRECTORY (which is basically same) I am getting Database
release level a.00 (where ‘a' in the ‘a.00' is an ASCII 228
character), but should be 8.00 or something like that, so I am not
confident that this is a way to do that.


How about using the "db2DbDirGetNex tEntry" API? It uses the version
information as declared at the beginning of "sqllib/include/db2ApiDf.h",
i.e. the macros "db2Version 6", "db2Version 810" and so on.

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Nov 12 '05 #3
Knut Stolze <st****@de.ibm. com> wrote in message news:<cj******* ***@fsuj29.rz.u ni-jena.de>...
DB2SQL wrote:
What would be the best way to obtain a DB2 UDB (major) version for
particular DB2 database, preferably by the C language style API.

I have to develop a client application that first has to figure out a
DB2 UDB version (can be 5, 6, 7, or 8) for the DB2 database passed
dynamically as run time parameter to the application.

So first function should take a database name as a parameter and
return an integer (5, 6, 7, or 8, depending what is, for that
database, the DB2 version used). This function should not connect to
the database. I would use DB2 API that does not require a connection
to the database, I guess. Any level of complexity of API without a DB2
connection would be fine. I can not use CLI/ODBC or JDBC in this
function, but I may use all them after in the rest of application.

I think when you catalog a database, the DB2 version for the database
is stored locally on the client side, and I need to retrieve that,
perhaps using sqledgne - Get Next Database Directory Entry and related
API-s. I have not tried that because when I executed the DB2 command
LIST DB DIRECTORY (which is basically same) I am getting Database
release level a.00 (where ?a' in the ?a.00' is an ASCII 228
character), but should be 8.00 or something like that, so I am not
confident that this is a way to do that.


How about using the "db2DbDirGetNex tEntry" API? It uses the version
information as declared at the beginning of "sqllib/include/db2ApiDf.h",
i.e. the macros "db2Version 6", "db2Version 810" and so on.


Could you tell me where the db2DbDirGetNext Entry API is defined and
described (include file name would be appreciated). I can not find it
in the db2ApiDf.h or any other that I know. It is not in any book
(Administrative API Reference or similar).

Thank you very much.
Nov 12 '05 #4
DB2SQL wrote:
Knut Stolze <st****@de.ibm. com> wrote in message
news:<cj******* ***@fsuj29.rz.u ni-jena.de>...
DB2SQL wrote:
> What would be the best way to obtain a DB2 UDB (major) version for
> particular DB2 database, preferably by the C language style API.
>
> I have to develop a client application that first has to figure out a
> DB2 UDB version (can be 5, 6, 7, or 8) for the DB2 database passed
> dynamically as run time parameter to the application.
>
> So first function should take a database name as a parameter and
> return an integer (5, 6, 7, or 8, depending what is, for that
> database, the DB2 version used). This function should not connect to
> the database. I would use DB2 API that does not require a connection
> to the database, I guess. Any level of complexity of API without a DB2
> connection would be fine. I can not use CLI/ODBC or JDBC in this
> function, but I may use all them after in the rest of application.
>
> I think when you catalog a database, the DB2 version for the database
> is stored locally on the client side, and I need to retrieve that,
> perhaps using sqledgne - Get Next Database Directory Entry and related
> API-s. I have not tried that because when I executed the DB2 command
> LIST DB DIRECTORY (which is basically same) I am getting Database
> release level a.00 (where ?a' in the ?a.00' is an ASCII 228
> character), but should be 8.00 or something like that, so I am not
> confident that this is a way to do that.


How about using the "db2DbDirGetNex tEntry" API? It uses the version
information as declared at the beginning of "sqllib/include/db2ApiDf.h",
i.e. the macros "db2Version 6", "db2Version 810" and so on.


Could you tell me where the db2DbDirGetNext Entry API is defined and
described (include file name would be appreciated). I can not find it
in the db2ApiDf.h or any other that I know. It is not in any book
(Administrative API Reference or similar).


The include file in question is "db2ApiDf.h " in the sqllib/include/
directory. I don't know which piece you would have to install, though.
I'd guess it is the Application Development Client.

The documentation for the API can be found here in the DB2 manual:
http://publib.boulder.ibm.com/infoce...n/r0001492.htm

p.s: Given that this API is new in V8.2 (aka FP7), it might not necessary be
what you need if you want to detect a pre-V8 instance.

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Nov 12 '05 #5
You are right, I need an API that works with any version of DB2 UDB
client (version 5, 6, 7, or 8). The application does not know in the
advance what DB2 UDB client or server version is used and can not be
restricted in the advance.

I have a DB2 8.1.6 and the db2ApiDf.h is here but this API is not in
the db2ApiDf.h. Anyway, seems that this is just a new version of the
sqledgne - Get Next Database Directory Entry API, so it would,
perhaps, return same value of the dbtype (same name as dbtype in the
sqledinfo used in the sqledgne).

The bigger problem with this API (db2DbDirGetNex tEntry - Get Next
Database Directory Entry) is that you have to provide a versionNumber
(Input Specifies the version and release level of the structure passed
in as the second parameter pParmStruct) as first parameter. Imagine
that, in order to obtain a dbtype (Database manager release
information) you have to provide a versionNumber (Input Specifies the
version and release level of the structure passed in as the second
parameter pParmStruct). Congratulation to DB2 API designers. You are
great. Please give me a value and I will design an API that is going
to return that value. And I will assign a smart advisor that is going
a help people in the public newsgroup to use that API. Seems that
there is still somebody enough smart in the DB2 team who hides that
API, so we can not find it yet.
Nov 12 '05 #6
DB2SQL wrote:
....
I have to develop a client application that first has to figure out a
DB2 UDB version (can be 5, 6, 7, or 8) for the DB2 database passed
dynamically as run time parameter to the application.

....

Please excuse my question here - but did you weighted pro's and cons of doing that?

Since V5, V6, and V7 are out of support - and should not be used in production
(unless customer signed and paid for a service extension; such extentions are
not very common; I don't believe that there is anybody using V5 and V6 service
extensions) - is it cost effective to develop new application which covers for
those version?

Curious person wants to know,

Jan M. Nelken
Nov 12 '05 #7
DB2SQL wrote:
The bigger problem with this API (db2DbDirGetNex tEntry - Get Next
Database Directory Entry) is that you have to provide a versionNumber
(Input Specifies the version and release level of the structure passed
in as the second parameter pParmStruct) as first parameter. Imagine
that, in order to obtain a dbtype (Database manager release
information) you have to provide a versionNumber (Input Specifies the
version and release level of the structure passed in as the second
parameter pParmStruct). Congratulation to DB2 API designers. You are
great.
I think you have a big misunderstandin g here. The manual reads very
specific: the "versionNum ber" attribute is the "version and release level
of _the structure passed_ in as the second parameter pParmStruct".

I would also congratulate the API designers because they took into account
that the structure itself might change or might need to be enhanced in
future releases. With the requirement that you provide the version
information about the structure (not the database manager or databases),
DB2 will know what kind of information you did provide and will know what
to do.
Please give me a value and I will design an API that is going
to return that value.


No, the API says: Please give me a structure and tell me how this structure
looks like. If it is the structure we defined for V82, then I (DB2) know
how to handle it. If it is a structure of V10, then I know it is different
than V82 and I know how to handle that. In both cases, I can give you the
directory entries you want and we both know the "protocol" we are using.

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Nov 12 '05 #8
The High Majesty The Client paid for the product, it works, and they
do not want to fix or upgrade. That's 'Merica, not Europe.
Nov 12 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
297
by: ajaykrishna | last post by:
Hi Could any one tell me what is the latest version of System.Data.OracleClient? Currently I'm using version 1.0.1012.0 in my project which is giving problem of not closing connection eventough I'm issuing connection Close() statement.I am trying to connect Oracle 8i from ASP.NET framwork 1.1 in my application. Initially I tried to put Connection Lifetime property to 60 seconds, when the application using Pooling concept. But this did not...
1
2144
by: Alan Taylor | last post by:
How is it possible to tell which version of ADO is installed on an XP workstation? Thanks
3
2763
by: rjaw | last post by:
Hi there, using the udb-type2-driver on z/OS DB version 7, we have a problem getting the connection to the database. The small program we use looks like this: Class.forName("com.ibm.db2.jcc.DB2Driver"); Connection connection = DriverManager.getConnection( "jdbc:db2:<database-name>", "<user>", "<password>" );
19
10305
by: Ken | last post by:
Hi, I need to modify an existing application that's written in C, C++ and Visual C++ so the application can be released as a time limited trial version, also the modifications must prevent the application from being reinstalled on the same computer after the trial period has timed out. Does anyone know of any C/C++ code that I could use directly or modified to do this?
2
1804
by: ad | last post by:
The user of my asp.net program use Sql2005 or Sql2005 express as database, both are possible. I have try both version of data base, I found: If I use Sql2005 express, the Data Source in connection string will be ..\SQLEXPRESS, like: Data Source=.\SQLEXPRESS;Initial Catalog=myDB;Integrated Security=True But I use Sql2005 , the Data Source in connection string can be use (local), like:
76
4100
by: kwilder | last post by:
This works, but it doesn't load the latest version of the xml if it was just modified without closing and reopening the browser. Here's the scenario: I have an xml doc called results.xml. It can contain lots of data. <Results> <Data>Stuff</Data> <Data>More stuff</Data>
5
2917
by: B1ackwater | last post by:
We've fooled around with Access a bit, but only using the single-user store-bought version. It seems to be a good database - versatile and infinitely programmable - and can apparently be used as a front end to SQL server if we ever needed to go that route. But - is there a client/server version of Access ? Looking on the CDW site there is a bewildering variety of packages and licences and such, but we can't figure out just which do...
8
9581
by: Brian Tkatch | last post by:
Server: DB2/SUN 8.1.6 Client: DB2 Connect Personal Edition (No 11) <URL:ftp://ftp.software.ibm.com/ps/products/db2/fixes2/english-us/db2winIA32v8/fixpak/FP11_WR21365/FP11_WR21365_CONPE.exe> Uninstalled old version, installed new version, and am now trying to use the CLP. <<<<<<<<<<<< For more detailed help, refer to the Online Reference Manual.
10
1352
by: Jim Richards | last post by:
Hello all. I have finally bitten the bullet and seriously started to learn VB.NET. I have the developement enviromnent installed and integrated my latest MSDN dated July 2005. If someone is thru with a later version ( say Oct 2006, Jan 2007 or so ) and would let me have it, I will gladly pay shipping and handling cost for it. Thanks in advance, Jim Richards
0
10437
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10214
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10164
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10001
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9042
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5437
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.