By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,352 Members | 1,593 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,352 IT Pros & Developers. It's quick & easy.

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

P: n/a

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 12 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
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 12 '05 #2

P: n/a

I will try that!

However, what is DATABASE?

I am new to the iSeries and I am familiar with the $Library.File.Member
syntax but not "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.


--

http://texeme.com
Textcasting Technology

Nov 12 '05 #3

P: n/a

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 12 '05 #4

P: n/a
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 12 '05 #5

P: n/a

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 12 '05 #6

P: n/a
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 12 '05 #7

P: n/a
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 12 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.