Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Users

DB2 Connection string problem

 

 

Catalyst users RSS feed   Index | Next | Previous | View Threaded


ksmclane at us

Mar 27, 2012, 9:15 AM

Post #1 of 10 (1464 views)
Permalink
DB2 Connection string problem

./script/myapp_create.pl model DB2 DBIC::Schema MyApp::Schema
create=static dbi:DB2:dbname:server.com:port 'user' 'pass'

I have tried various permutations of this connection string and the error
I get most often is "[IBM][CLI Driver] CLI0124E Invalid argument value.
SQLSTATE=HY009".

this tells me I have a problem with the string, unfortunately I cannot
find any evidence that this has been accomplished before. This db resides
on a remote server with a non-default port. I have tried escaping the ":"
before the port number and get the same result. Any suggestions are
welcome.

Regards


dakkar at thenautilus

Mar 27, 2012, 9:43 AM

Post #2 of 10 (1445 views)
Permalink
Re: DB2 Connection string problem [In reply to]

https://metacpan.org/source/IBMTORDB2/DBD-DB2-1.84/DB2.pod#L187

you may want:

dbi:DB2:DATABASE=${your_db_name};HOSTNAME=${server_name};PORT=${port}

--
Dakkar - <Mobilis in mobile>
GPG public key fingerprint = A071 E618 DD2C 5901 9574
6FE2 40EA 9883 7519 3F88
key id = 0x75193F88

The use of anthropomorphic terminology when dealing with computing
systems is a symptom of professional immaturity.
-- Edsger Dijkstra
Attachments: signature.asc (0.19 KB)


ksmclane at us

Mar 27, 2012, 10:50 AM

Post #3 of 10 (1458 views)
Permalink
Re: DB2 Connection string problem [In reply to]

[IBM][CLI Driver] SQL1031N The database directory cannot be found on the
indicated file system. SQLSTATE=58031

This is the result I get from that change.

Regards




































From:
Gianni Ceccarelli <dakkar [at] thenautilus>
To:
catalyst [at] lists
Date:
03/27/2012 11:45 AM
Subject:
Re: [Catalyst] DB2 Connection string problem



https://metacpan.org/source/IBMTORDB2/DBD-DB2-1.84/DB2.pod#L187

you may want:

dbi:DB2:DATABASE=${your_db_name};HOSTNAME=${server_name};PORT=${port}

--
Dakkar - <Mobilis in mobile>
GPG public key fingerprint = A071 E618 DD2C 5901 9574
6FE2 40EA 9883 7519 3F88
key id = 0x75193F88

The use of anthropomorphic terminology when dealing with computing
systems is a symptom of professional immaturity.
-- Edsger Dijkstra
[attachment "signature.asc" deleted by Kenneth S Mclane/Dubuque/IBM]
_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive:
http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/


dakkar at thenautilus

Mar 27, 2012, 11:49 AM

Post #4 of 10 (1441 views)
Permalink
Re: DB2 Connection string problem [In reply to]

On 2012-03-27 Kenneth S Mclane <ksmclane [at] us> wrote:
> [IBM][CLI Driver] SQL1031N The database directory cannot be found on
> the indicated file system. SQLSTATE=58031
>
> This is the result I get from that change.

I can't really help you more than this, I was just reading the
documentation… I've never worked with DB2, and those error messages
(in perfect IBM style) are quite hard to understand.

Hope someone else has some experience in DB2. Or you may try asking to
some different crowds, though (no, I don't know where to find people
that know DB2).

--
Dakkar - <Mobilis in mobile>
GPG public key fingerprint = A071 E618 DD2C 5901 9574
6FE2 40EA 9883 7519 3F88
key id = 0x75193F88

MESSAGE ACKNOWLEDGED -- The Pershing II missiles have been launched.
Attachments: signature.asc (0.19 KB)


cosimo at streppone

Mar 27, 2012, 12:17 PM

Post #5 of 10 (1456 views)
Permalink
Re: DB2 Connection string problem [In reply to]

On Tue, 27 Mar 2012 20:49:41 +0200, Gianni Ceccarelli
<dakkar [at] thenautilus> wrote:

> On 2012-03-27 Kenneth S Mclane <ksmclane [at] us> wrote:
>> [IBM][CLI Driver] SQL1031N The database directory cannot be found on
>> the indicated file system. SQLSTATE=58031
>>
>> This is the result I get from that change.
>
> I can't really help you more than this, I was just reading the
> documentation… I've never worked with DB2, and those error messages
> (in perfect IBM style) are quite hard to understand.
>
> Hope someone else has some experience in DB2. Or you may try asking to
> some different crowds, though (no, I don't know where to find people
> that know DB2).

Let's see. Last time I managed to connect to DB2 from perl
was around 2002, with ancient versions of DBD::DB2... :)

IBM messages might be cryptic, but the guys are smart
enough to include error number and SQLSTATE, so you need
to look those up.

Try this:

https://encrypted.google.com/search?client=opera&rls=nb&q=%22%5BIBM%5D%5BCLI+Driver%5D+SQL1031N+The+database+directory+cannot+be+found+on+the+indicated+file+system.+SQLSTATE=58031%22&sourceid=opera&ie=utf-8&oe=utf-8&channel=suggest#client=opera&rls=nb&q=%22%5BIBM%5D%5BCLI+Driver%5D+SQL1031N+The+database+directory+cannot+be+found+on+the+indicated+file+system.+SQLSTATE%3D58031%22&sourceid=opera&ie=utf-8&oe=utf-8&channel=suggest&fp=1&bav=on.2,or.r_gc.r_pw.,cf.osb&cad=b

or search term:

"[IBM][CLI Driver] SQL1031N The database directory cannot be
found on the indicated file system. SQLSTATE=58031"

in your preferred search engine.

IBM documentation usually gives you a hint about any type of error.
AFAIK, most DB2 connectivity problems come from:

* misconfigured DB2 client (see web search above)
* DB2 database on the server host (mine was running on OS/400, YMMV)
needs to be "exported" for clients to connect via TCP/IP directly.

(Oh, /me just realized now I'm writing to a IBM email address)

Sorry... you clearly know better than me ... :)

--
Cosimo

_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/


cosimo at streppone

Mar 28, 2012, 1:57 AM

Post #6 of 10 (1430 views)
Permalink
Re: DB2 Connection string problem [In reply to]

On Tue, 27 Mar 2012 21:32:12 +0200, Kenneth S Mclane <ksmclane [at] us>
wrote:

> am able to connect from Perl directly with a quick test file I wrote.

Ok, then you're 99% done.

> I just cannot figure out how Catalyst passes/parses the arguments.

Maybe you could start by posting your working perl code
and then people on the list can help you transpose
that to the relevant Catalyst parts/plugins?

Just an idea.

--
Cosimo

_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/


ksmclane at us

Mar 28, 2012, 6:20 AM

Post #7 of 10 (1434 views)
Permalink
Re: DB2 Connection string problem [In reply to]

From:
"Cosimo Streppone" <cosimo [at] streppone>
To:
Kenneth S Mclane/Dubuque/IBM [at] IBMU
Cc:
"The elegant MVC web framework" <catalyst [at] lists>
Date:
03/28/2012 03:59 AM
Subject:
Re: [Catalyst] DB2 Connection string problem



On Tue, 27 Mar 2012 21:32:12 +0200, Kenneth S Mclane <ksmclane [at] us>

wrote:

> am able to connect from Perl directly with a quick test file I wrote.

Ok, then you're 99% done.

> I just cannot figure out how Catalyst passes/parses the arguments.

Maybe you could start by posting your working perl code
and then people on the list can help you transpose
that to the relevant Catalyst parts/plugins?

Just an idea.

--
Cosimo

Here is my perl script that connects:

#!/usr/bin/perl
use DBI;
use DBD::DB2::Constants;
use DBD::DB2;

$db="dbname";
$hostname="server.fqdn";
$port="55555";
$user="user";
$pass="password";
$string = "dbi:DB2:DATABASE=$db; HOSTNAME=$hostname; PORT=$port;
PROTOCOL=TCPIP;";

if ($dbh = DBI->connect($string, $user, $pass)) {
print "Success!";
}
else {
print "Connection failed with error: $DBI::errstr";
}

I am trying to use the MyApp_create.pl script to create the db model and
pull in the entire existing schema, but cannot get the script to function
correctly, it either will not connect or gives an error about not finding
the db on the "filesystem". Yet the above script indicates success when
run from the same VM I am using for Catalyst.


ksmclane at us

Mar 28, 2012, 8:33 AM

Post #8 of 10 (1434 views)
Permalink
Re: DB2 Connection string problem [In reply to]

From:
Kenneth S Mclane/Dubuque/IBM [at] IBMU
To:
"The elegant MVC web framework" <catalyst [at] lists>
Date:
03/28/2012 08:27 AM
Subject:
Re: [Catalyst] DB2 Connection string problem




From:
"Cosimo Streppone" <cosimo [at] streppone>
To:
Kenneth S Mclane/Dubuque/IBM [at] IBMU
Cc:
"The elegant MVC web framework" <catalyst [at] lists>
Date:
03/28/2012 03:59 AM
Subject:
Re: [Catalyst] DB2 Connection string problem




On Tue, 27 Mar 2012 21:32:12 +0200, Kenneth S Mclane <ksmclane [at] us>

wrote:

> am able to connect from Perl directly with a quick test file I wrote.

Ok, then you're 99% done.

> I just cannot figure out how Catalyst passes/parses the arguments.

Maybe you could start by posting your working perl code
and then people on the list can help you transpose
that to the relevant Catalyst parts/plugins?

Just an idea.

--
Cosimo

Here is my perl script that connects:

#!/usr/bin/perl
use DBI;
use DBD::DB2::Constants;
use DBD::DB2;

$db="dbname";
$hostname="server.fqdn";
$port="55555";
$user="user";
$pass="password";
$string = "dbi:DB2:DATABASE=$db; HOSTNAME=$hostname; PORT=$port;
PROTOCOL=TCPIP;";

if ($dbh = DBI->connect($string, $user, $pass)) {
print "Success!";
}
else {
print "Connection failed with error: $DBI::errstr";
}

I am trying to use the MyApp_create.pl script to create the db model and
pull in the entire existing schema, but cannot get the script to function
correctly, it either will not connect or gives an error about not finding
the db on the "filesystem". Yet the above script indicates success when
run from the same VM I am using for Catalyst.
_______________________________________________


Update, I was successful in creating a connection. For future reference if
anyone else is trying to accomplish this:

http://www-01.ibm.com/support/docview.wss?uid=swg21182248

This page has instructions for cataloging db's on a remote system. Once
this is done and an alias created, I was able to get the create script to
connect using the alias. Note, if you are on a *nix system, db2 should not
be typed in all caps as the example, this was done on a Win box.

I now have a different problem as the schema still isn't being created.

Unable to load schema - chosen moniker/class naming style results in
moniker clashes. Change the naming style, or supply an explicit
moniker_map: tables "db1"."ASSIGNMENT", "db2"."ASSIGNMENTS" reduced to the
same source moniker 'Assignment'

Off to research this one. Thanks for the help.


bobtfish at bobtfish

Mar 28, 2012, 1:08 PM

Post #9 of 10 (1423 views)
Permalink
Re: DB2 Connection string problem [In reply to]

On 28 Mar 2012, at 16:33, Kenneth S Mclane wrote:
> Update, I was successful in creating a connection. For future reference if anyone else is trying to accomplish this:

Can we fix some docs here, rather than leaving something in a vague mailing list thread?

> http://www-01.ibm.com/support/docview.wss?uid=swg21182248
>
> This page has instructions for cataloging db's on a remote system. Once this is done and an alias created, I was able to get the create script to connect using the alias. Note, if you are on a *nix system, db2 should not be typed in all caps as the example, this was done on a Win box.


Awesome - can we make the relevant docs include the missing step, and note the Win32/Unix difference?

> I now have a different problem as the schema still isn't being created.
>
> Unable to load schema - chosen moniker/class naming style results in moniker clashes. Change the naming style, or supply an explicit moniker_map: tables "db1"."ASSIGNMENT", "db2"."ASSIGNMENTS" reduced to the same source moniker 'Assignment'
>
> Off to research this one. Thanks for the help.

Ok, the DBIC guys will be able to help you out here :D

Cheers
t0m



_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/


ksmclane at us

Mar 28, 2012, 1:44 PM

Post #10 of 10 (1427 views)
Permalink
Re: DB2 Connection string problem [In reply to]

On 28 Mar 2012, at 16:33, Kenneth S Mclane wrote:
> Update, I was successful in creating a connection. For future reference
if anyone else is trying to accomplish this:

Can we fix some docs here, rather than leaving something in a vague
mailing list thread?

> http://www-01.ibm.com/support/docview.wss?uid=swg21182248
>
> This page has instructions for cataloging db's on a remote system. Once
this is done and an alias created, I was able to get the create script to
connect using the alias. Note, if you are on a *nix system, db2 should not
be typed in all caps as the example, this was done on a Win box.


Awesome - can we make the relevant docs include the missing step, and note
the Win32/Unix difference?

> I now have a different problem as the schema still isn't being created.
>
> Unable to load schema - chosen moniker/class naming style results in
moniker clashes. Change the naming style, or supply an explicit
moniker_map: tables "db1"."ASSIGNMENT", "db2"."ASSIGNMENTS" reduced to the
same source moniker 'Assignment'
>
> Off to research this one. Thanks for the help.

Ok, the DBIC guys will be able to help you out here :D

Cheers
t0m

I'm not sure what docs you are referring to. I could not find any. I
solved to Moniker problem by adding "naming-v4" right after
"create=static".


_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive:
http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/

Catalyst users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.