473,383 Members | 1,978 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

IBM DB2 Connector throws exception with .Connect() in .net


I am using the IBM DB2 Connector class of the Redistributable DB2
Run-Time Client Lite in a c# .net application using Visual Studio.

Running the code:

string myConnString = "DATABASE=192.168.1.43;UID=XXXX;PWD=XXXX";
DB2Connection myConnection = new DB2Connection(myConnString);
myConnection.Open();

Throws this error on the .Open() method:

IBM.Data.DB2.DB2Exception: ERROR [HY009] [IBM] CLI0124E Invalid
argument value. SQLSTATE=HY009
at IBM.Data.DB2.d.a(String A_0, Int32 A_1, IsolationLevel A_2,
DB2Connection A_3)
at IBM.Data.DB2.DB2ConnPool.a(DB2Connection A_0, String A_1, a& A_2,
Object& A_3)
at IBM.Data.DB2.DB2Connection.Open()
at dot400.Form1.processSqlRequest(String qs, Int32 q) in
c:\documents and settings\jbailo\my documents\visual studio
projects\dot400\form1.cs:line 205
How can I diagnose this?

Does my connection string look right?

The machine name on our network is AS400. If I use that as the
DATABASE name, it throws another error:

IBM.Data.DB2.DB2Exception: ERROR [58031] [IBM] SQL1031N The database
directory cannot be found on the indicated file system. SQLSTATE=58031

at IBM.Data.DB2.d.a(String A_0, Int32 A_1, IsolationLevel A_2,
DB2Connection A_3)
at IBM.Data.DB2.DB2ConnPool.a(DB2Connection A_0, String A_1, a& A_2,
Object& A_3)
at IBM.Data.DB2.DB2Connection.Open()
at dot400.Form1.processSqlRequest(String qs, Int32 q) in
c:\documents and settings\jbailo\my documents\visual studio
projects\dot400\form1.cs:line 205
I can access this as400 using OleDb ( the SQLDA400 data provider that is
part of the CAE ), but I want to deploy my application using the
Here is the connector class api doc:

http://publib.boulder.ibm.com/infoce...ClassTopic.htm
--

incognito () Updated Almost Daily
http://kentpsychedelic.blogspot.com
Nov 16 '05 #1
6 4356
C.E.O. Gargantua wrote:

I am using the IBM DB2 Connector class of the Redistributable DB2
Run-Time Client Lite in a c# .net application using Visual Studio.

Running the code:

string myConnString = "DATABASE=192.168.1.43;UID=XXXX;PWD=XXXX";


this isn't correct.
Use something like:
"Database=SAMPLE;Server=192.168.1.43;UID=XXXX;PWD= YYYY;"
or with portnumber:
"Database=SAMPLE;Server=192.168.1.43:1533;UID=XXXX ;PWD=YYYY;"

At least that's how I construct the connection strings, which do work.
I had similar issues like the ones you describe. Also if usernames
apparently don't match you get this kind of error.

Frans.
--
------------------------------------------------------------------------
Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
Nov 16 '05 #2

I now see a new class of error. Are there additonal parameters I should
use in my Connection String? I am still not sure what a Database
is...MARDRPALL is a File in the $HAWLIB. Should I use the Library name?

Using the connection string:

try {

string myConnString =
"Database=MARDRPALL;Server=192.168.1.43;UID=JBAILO ;PWD=TOOTHPICK1;";

DB2Connection myConnection =
new DB2Connection(myConnString);

myConnection.Open();

} catch (Exception e) {Debug.WriteLine(e.ToString());}
The error is:

IBM.Data.DB2.DB2Exception: ERROR [HY009] [IBM] CLI0124E Invalid
argument value. SQLSTATE=HY009
at IBM.Data.DB2.d.a(String A_0, Int32 A_1, IsolationLevel A_2,
DB2Connection A_3)
at IBM.Data.DB2.DB2ConnPool.a(DB2Connection A_0, String A_1, a& A_2,
Object& A_3)
at IBM.Data.DB2.DB2Connection.Open()
at dot400.Form1.processSqlRequest(String qs, Int32 q) in
c:\documents and settings\jbailo\my documents\visual studio
projects\dot400\form1.cs:line 205

If I use Database=Sample, or Database=$HAWLIB, the error is:

IBM.Data.DB2.DB2Exception: ERROR [08001] [IBM] SQL30081N A
communication error has been detected. Communication protocol being
used: "TCP/IP". Communication API being used: "SOCKETS". Location
where the error was detected: "192.168.1.43". Communication function
detecting the error: "connect". Protocol specific error code(s):
"10061", "*", "*". SQLSTATE=08001

at IBM.Data.DB2.d.a(String A_0, Int32 A_1, IsolationLevel A_2,
DB2Connection A_3)
at IBM.Data.DB2.DB2ConnPool.a(DB2Connection A_0, String A_1, a& A_2,
Object& A_3)
at IBM.Data.DB2.DB2Connection.Open()
at dot400.Form1.processSqlRequest(String qs, Int32 q) in
c:\documents and settings\jbailo\my documents\visual studio
projects\dot400\form1.cs:line 205

So it seems like MARDRPALL is a database...
Frans Bouma [C# MVP] wrote:
C.E.O. Gargantua wrote:

I am using the IBM DB2 Connector class of the Redistributable DB2
Run-Time Client Lite in a c# .net application using Visual Studio.

Running the code:

string myConnString = "DATABASE=192.168.1.43;UID=XXXX;PWD=XXXX";

this isn't correct.
Use something like:
"Database=SAMPLE;Server=192.168.1.43;UID=XXXX;PWD= YYYY;"
or with portnumber:
"Database=SAMPLE;Server=192.168.1.43:1533;UID=XXXX ;PWD=YYYY;"

At least that's how I construct the connection strings, which do
work. I had similar issues like the ones you describe. Also if usernames
apparently don't match you get this kind of error.

Frans.

--
incognito...updated almost daily
http://kentpsychedelic.blogspot.com

Texeme Textcasting Technology
http://texeme.com

Nov 16 '05 #3
The God's Awful Truth wrote:
I now see a new class of error. Are there additonal parameters I should
use in my Connection String? I am still not sure what a Database
is...MARDRPALL is a File in the $HAWLIB. Should I use the Library name?
I'm not sure, but what I do know is that with an AS/400 you get DB2
client software, with which you can administrate the DB2 instance on the
AS/400. With that one you could browse teh DB2 instance and see which
catalogs there are..
Using the connection string:

try {

string myConnString =
"Database=MARDRPALL;Server=192.168.1.43;UID=JBAILO ;PWD=TOOTHPICK1;";


Your AS/400 is on TCP/IP or does it use IBM net? Also, did you try the
local dns name for 192.168.1.43?

Frans.

--
------------------------------------------------------------------------
Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
Nov 16 '05 #4

Ok, so someone told me that the whole machine is a database, so I used
this connection string:

string myConnString =
"Database=as400;Server=192.168.1.43;UID=JBAILO;PWD =TOOTHPICK1;";

That generated a new error which seems to indicate a problem with the
protocol specification...

IBM.Data.DB2.DB2Exception: ERROR [08001] [IBM] SQL30081N A
communication error has been detected. Communication protocol being
used: "TCP/IP". Communication API being used: "SOCKETS". Location
where the error was detected: "192.168.1.43". Communication function
detecting the error: "connect". Protocol specific error code(s):
"10061", "*", "*". SQLSTATE=08001

I wonder if I need to specify tcp/ip. I tried using the Net
Library=TCPIP but it threw an Invalid argument.

Frans Bouma [C# MVP] wrote:
The God's Awful Truth wrote:
I now see a new class of error. Are there additonal parameters I
should use in my Connection String? I am still not sure what a
Database is...MARDRPALL is a File in the $HAWLIB. Should I use the
Library name?

I'm not sure, but what I do know is that with an AS/400 you get DB2
client software, with which you can administrate the DB2 instance on the
AS/400. With that one you could browse teh DB2 instance and see which
catalogs there are..
Using the connection string:

try {

string myConnString =
"Database=MARDRPALL;Server=192.168.1.43;UID=JBAILO ;PWD=TOOTHPICK1;";

Your AS/400 is on TCP/IP or does it use IBM net? Also, did you try
the local dns name for 192.168.1.43?

Frans.

--

incognito () Updated Almost Daily
http://kentpsychedelic.blogspot.com
Nov 16 '05 #5
C.E.O. Gargantua wrote:

Ok, so someone told me that the whole machine is a database, so I used
this connection string:
yes, because on an AS/400 you work inside the DB2 instance (not
entirely true, but lets say you do for simplicity).

However, what you did is not correct. Btw, The DB2 UDB .net provider
works with AS/400 if DB Connect is installed on the AS/400. Is that the
case?

Frans.

string myConnString =
"Database=as400;Server=192.168.1.43;UID=JBAILO;PWD =TOOTHPICK1;";

That generated a new error which seems to indicate a problem with the
protocol specification...

IBM.Data.DB2.DB2Exception: ERROR [08001] [IBM] SQL30081N A
communication error has been detected. Communication protocol being
used: "TCP/IP". Communication API being used: "SOCKETS". Location
where the error was detected: "192.168.1.43". Communication function
detecting the error: "connect". Protocol specific error code(s):
"10061", "*", "*". SQLSTATE=08001

I wonder if I need to specify tcp/ip. I tried using the Net
Library=TCPIP but it threw an Invalid argument.

Frans Bouma [C# MVP] wrote:
The God's Awful Truth wrote:
I now see a new class of error. Are there additonal parameters I
should use in my Connection String? I am still not sure what a
Database is...MARDRPALL is a File in the $HAWLIB. Should I use the
Library name?


I'm not sure, but what I do know is that with an AS/400 you get
DB2 client software, with which you can administrate the DB2 instance
on the AS/400. With that one you could browse teh DB2 instance and see
which catalogs there are..
Using the connection string:

try {

string myConnString =
"Database=MARDRPALL;Server=192.168.1.43;UID=JBAILO ;PWD=TOOTHPICK1;";


Your AS/400 is on TCP/IP or does it use IBM net? Also, did you try
the local dns name for 192.168.1.43?

Frans.


--
------------------------------------------------------------------------
Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
Nov 16 '05 #6
Frans Bouma [C# MVP] wrote:
However, what you did is not correct. Btw, The DB2 UDB .net provider
works with AS/400 if DB Connect is installed on the AS/400. Is that the
case?
How can I confirm whether it's installed or not? What command?

I have been able to use OleDb to connect...does this imply that DB
Connect is installed ?




Frans.

string myConnString =
"Database=as400;Server=192.168.1.43;UID=JBAILO;PWD =TOOTHPICK1;";
That generated a new error which seems to indicate a
problem with the protocol specification...

IBM.Data.DB2.DB2Exception: ERROR [08001] [IBM] SQL30081N A
communication error has been detected. Communication protocol being
used: "TCP/IP". Communication API being used: "SOCKETS". Location
where the error was detected: "192.168.1.43". Communication function
detecting the error: "connect". Protocol specific error code(s):
"10061", "*", "*". SQLSTATE=08001

I wonder if I need to specify tcp/ip. I tried using the Net
Library=TCPIP but it threw an Invalid argument.

Frans Bouma [C# MVP] wrote:
The God's Awful Truth wrote:

I now see a new class of error. Are there additonal parameters I
should use in my Connection String? I am still not sure what a
Database is...MARDRPALL is a File in the $HAWLIB. Should I use the
Library name?


I'm not sure, but what I do know is that with an AS/400 you get
DB2 client software, with which you can administrate the DB2 instance
on the AS/400. With that one you could browse teh DB2 instance and
see which catalogs there are..

Using the connection string:

try {

string myConnString =
"Database=MARDRPALL;Server=192.168.1.43;UID=JBAILO ;PWD=TOOTHPICK1;";


Your AS/400 is on TCP/IP or does it use IBM net? Also, did you
try the local dns name for 192.168.1.43?

Frans.



--
Texeme
http://texeme.com

incognito () Updated Almost Daily
http://kentpsychedelic.blogspot.com
Nov 16 '05 #7

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

Similar topics

1
by: Raj | last post by:
Hi! Every time my applicaiton call "System.Diagnosis.Process.GetProcesses() and some other related APIs in dotnet framework, it throws the following exception: "An unhandled exception of type...
0
by: Mark Vuksani | last post by:
Hi, I have a trigger like this (simplified to illustrate the problem): -------- CREATE TRIGGER Test ON . FOR INSERT, UPDATE, DELETE AS RAISERROR( 'test trigger error !', 16, 1)
7
by: C.E.O. Gargantua | last post by:
I am using the IBM DB2 Connector class of the Redistributable DB2 Run-Time Client Lite in a c# .net application using Visual Studio. Running the code: string myConnString =...
0
by: Mike Schilling | last post by:
I have some code that calls methods reflectively (the method called and its parameters are determined by text received in a SOAP message, and I construct a map from strings to MethodInfos). The...
4
by: frog | last post by:
Hi, all: I tried to call Server.Execute in Application_Start and got exception. Any help is appreciated You might ask why I want to do that in the first place. Well, I need to start a...
1
by: Richard | last post by:
Hi. I subclassed a ListView to give it the capability to sort by a column when the column header is clicked and it works fine. The problem is when the listview gets refreshed, all items are cleared...
0
by: Chris Reuter | last post by:
I've been trying to start a particular external program from Python using os.spawnv(). This works perfectly under Linux but under Windows, it first runs the program, then throws an OSError...
3
by: Sebastian M. Rouaiha | last post by:
Hi. I have a problem. When drawing into a graphics context I sometimes get access violation exceptions and I can't figure out why. It seems to have to do with the use of custom dashes. If I...
6
by: Samuel | last post by:
Hi, I am trying to get the files from this tutorial to work: http://www.grisby.org/presentations/py10code.html Direct link to the files: http://www.grisby.org/presentations/py10code/adder.idl...
2
by: bevis | last post by:
I'm new to sql server and mysql but this seems like it should be a pretty straight forward jdbc connection. But I have spent almost 2 days just trying to get a jdbc connection. Please help if you...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.