473,397 Members | 2,033 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,397 software developers and data experts.

How to connect to db2 database using perl or php

Hi,
I am trying to connect to db2 database and want to execute some basic
SQL commands like create or select.

I am on linux 7 redhat distribution and I have no rights to compile
perl or install some thing that is big in size as I am student.

I just want to experiment db2 and php or perl.

any link or suggestions ?

Thank you to all in advance.
Nov 12 '05 #1
5 4434
Excluded_Middle wrote:
Hi,
I am trying to connect to db2 database and want to execute some basic
SQL commands like create or select.

I am on linux 7 redhat distribution and I have no rights to compile
perl or install some thing that is big in size as I am student.
If you cannot get DB2 installed on the machine, then there's not much
anyone can do except suggest you get a Linux box at home. I've heard
you can get this all running on Windows, too, if that's what you have
at home, but I wouldn't personally want to go there.

Assuming that DB2 is already installed, you can simply get the DBI and
DBD::DB2 modules installed in a private, local directory, and you can
use it with the perl that is already installed with RH7. You don't
need root access to install a private module, nor do you need to
compile/install the entire perl privately. I presume you can do
similarly with php, but I'm not proficient with that language.
I just want to experiment db2 and php or perl.

any link or suggestions ?

Thank you to all in advance.

Nov 12 '05 #2
On Mon, 31 May 2004 23:54:34 GMT, Darin McBride
<dm******@naboo.to.org.no.spam.for.me> wrote:
Excluded_Middle wrote:
Hi,
I am trying to connect to db2 database and want to execute some basic
SQL commands like create or select.

I am on linux 7 redhat distribution and I have no rights to compile
perl or install some thing that is big in size as I am student.


If you cannot get DB2 installed on the machine, then there's not much
anyone can do except suggest you get a Linux box at home. I've heard
you can get this all running on Windows, too, if that's what you have
at home, but I wouldn't personally want to go there.

Assuming that DB2 is already installed, you can simply get the DBI and
DBD::DB2 modules installed in a private, local directory, and you can
use it with the perl that is already installed with RH7. You don't
need root access to install a private module, nor do you need to
compile/install the entire perl privately. I presume you can do
similarly with php, but I'm not proficient with that language.
I just want to experiment db2 and php or perl.

any link or suggestions ?

Thank you to all in advance.


Getting db2 working with php does require compilation of php. It can be
installed as a module. You will need the headers from the Workgroup or
developer edition in the include directory of your db2 install. You can
get the php source into your directory and then you compile just the odbc
module with the "--with-ibm-db2=shared,/opt/IBM/db2/V8.1" configuration
flag and put the resulting odbc.so in your local directory. You can then
load this in your php code with the dl() function. I believe this may
require php to be compiled with module support allthough I think that is
the default. I agree with Darin though, getting a linux box at home would
be the best bet. Nothing beats having full control of a machine for this
sort of testing.

--
Todd Huish
Nov 12 '05 #3
Thank you Mr Darin and Mr Todd. So there is a possibility using DB2
without root permmission.

I am interested in trying both of the methods and I am planning to buy
a machine that run linux OS as soon as I get money. I was so curious
about that I couldn't wait to try it on my university linux account.

The second restriction is that I have only 30 MB disk quota. So if you
guys think that the method you both describe don't need to much disk
space then please give me the detail or provide me a link where these
methods are described clearly.

One more time I will thank you guys for reply.
Nov 12 '05 #4
On 1 Jun 2004 22:17:58 -0700, Excluded_Middle <ib****@hotmail.com> wrote:
Thank you Mr Darin and Mr Todd. So there is a possibility using DB2
without root permmission.

I am interested in trying both of the methods and I am planning to buy
a machine that run linux OS as soon as I get money. I was so curious
about that I couldn't wait to try it on my university linux account.

The second restriction is that I have only 30 MB disk quota. So if you
guys think that the method you both describe don't need to much disk
space then please give me the detail or provide me a link where these
methods are described clearly.

One more time I will thank you guys for reply.

I started looking at the dynamic module thing and realized you are going
to have a problem with only 30MB home dir. I just compiled php and the
source dir alone is 31MB before anything's even compiled. I actualy hit
some weird problems trying to just compile the odbc module. I know I have
done similar things in the past but for some reason it just isn't working.
I did realize though that you should have no problem compiling a local
copy of php for your own usage. As an example you can use this script to
compile php. Just edit the DIR_PRE to point to your home directory and
where you want php to install. I tried this as a regular user on a machine
and it worked fine.

http://toddlee.org/php/cfg_php.sh

This is the script that I basicaly use on any machine that has db2 on it
because it lets me have quick and easy script access via a very stripped
down cli php. Good luck!

--
Todd Huish
Nov 12 '05 #5
Excluded_Middle wrote:
Thank you Mr Darin and Mr Todd. So there is a possibility using DB2
without root permmission.
Only if you have someone that does have root permission do the initial
installation.
I am interested in trying both of the methods and I am planning to buy
a machine that run linux OS as soon as I get money. I was so curious
about that I couldn't wait to try it on my university linux account.

The second restriction is that I have only 30 MB disk quota. So if you
guys think that the method you both describe don't need to much disk
space then please give me the detail or provide me a link where these
methods are described clearly.
You should be able to read the installation instructions for perl
modules in the perl documentation. Especially reading the
documentation for ExtUtils::MakeMaker which talks about the PREFIX and
LIB variables. This should apply to any module(s) you may need to
install, notably DBI and DBD::DB2. Also note that your administrator
may have already installed these globally, or you may be able to
convince them to do so.
One more time I will thank you guys for reply.

Nov 12 '05 #6

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

Similar topics

20
by: Mr Dygi | last post by:
Hi, PHP 4.3.4 installed manually from package *.zip and Apache 2. I have a problem with this simple code: <?php $link = mysql_connect("127.0.0.1","","") or die("Could not connect: " ....
0
by: Kate Perry | last post by:
I am trying to execute a query on a db2 database using the dbi module. I'm wondering if someone can take a look at my code and tell me what I'm doing wrong. I'm assuming it's a problem with my...
1
by: zelzel.zsu | last post by:
What is php's behavior when connect to a db? I've been told that php was once a dominant web programing language. I've read a few chapters of a php book. I was wonder what's php's performance....
4
by: banz | last post by:
Hello I have a problem to resolve: I wrote a Perlscript which caches data from a server (local on my machine) I would like to have a other connection to a remote server but I don't know how to...
5
by: maverickx | last post by:
Hi everyone, i am a totally rookie in perl. I have a project which needs to use perl to connect to mysql database. I already installed the perl mysql driver, MySQL, and use perl code which i found...
3
by: roxrox_1959 | last post by:
I'm attempting to connect to a DB2 database using DBD::DB2 running on a Linux device. I'm getting the following error: ** connect: Unable to get database handle: DBI...
2
by: idorjee | last post by:
hi, can anyone tell me what am i doing wrong here. i'm trying to connect remotely to the MySQL database on a server (SunOS multivac 5.9 sparc SUNW,Sun-Fire-V240). i know that the username and the...
2
by: fatimang | last post by:
hi......can you please help me to connect in database using perl...what is the appropriate database to use and what is the connection string..... thank you...
11
by: arty | last post by:
i've been trying to connect to a db using this code: #!"C:\xampp\perl\strawberry\perl\bin\perl.exe" use DBI; use strict; use warnings; print "Content-type: text/html \n\n"; #HTTP HEADER my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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...
0
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,...

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.