Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 10-23-2008, 03:24 AM   #1
LQ Newbie
Registered: Oct 2008
Posts: 1

Rep: Reputation: 0
Connection to DB2 Database through Linux script.


Iam using the following Linux version:
OpenSSL 0.9.7d 17 Mar 2004. i am new to linux and i write a sample code.In my system DB2 client was installed in "C:\Program Files\IBM\SQLLIB\BIN\".



function connDB
db2 connect to $DATABASE_NAME user $USER_NAME using $USEER_PWD
exit 0

please give valuable suggestions.

Old 10-23-2008, 08:59 AM   #2
LQ Newbie
Registered: Sep 2004
Location: Georgia
Distribution: RHEL *
Posts: 1

Rep: Reputation: 0
Connection to DB2 on Linux...try Perl

I'll preface this by saying I am an Informix DB bigot, and do not have a LOT of experience with DB2.

Having said that connecting to relational database engines is fairly consistent at a high level.

While it is possible to use shell scripts it may be easier to maintain in the long run to use something like Perl.

You can install the Perl DBI module and the DBD:: DB2 driver and then you use normal connect, prepare, execute, fetch, close logic. IBM and CPAN have this documented fairly well.

Try googling with "Perl DB2 DBI".

IBM Database Magazine also has some articles on Perl and DB2.

I did see a similar question at another forum

Good luck!


Last edited by gentsch; 10-23-2008 at 10:27 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Database connection using Shell Script sumitarun Linux - Newbie 2 05-09-2010 01:18 PM
Connecting to IBM AS400 db2 database from perl keysorsoze Programming 2 10-12-2008 12:01 PM
Database on Linux...connection refused zen Red Hat 1 02-04-2007 05:35 AM
LXer: DB2 Express: Another nail in the free database coffin? LXer Syndicated Linux News 0 02-10-2006 10:46 PM
LXer: DB2- the secret database LXer Syndicated Linux News 0 01-18-2006 10:31 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:49 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration