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

php to derby database connection fails..urgent ..pls help!

23
I can connect to DB2 on the command line on the server.

db2=>connect to mytest user knellim using xxxx

Database Connection Information

Database server = Apache Derby CSS10050
SQL authorization ID = KNELLIM
Local database alias = MYTEST

When I connect to the same DB in PHP as cataloged or uncataloged, I get
this:

Connection to database failed.
SQLSTATE:
Message:
Below is my script

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. $database = 'mytest';
  4. $user = 'knellim';
  5. $password = 'xxxx';
  6.  
  7. $conn = db2_connect($database, $user, $password);
  8.  
  9. if ($conn) {
  10.    echo "Connection succeeded.";
  11.    db2_close($conn);
  12. }
  13. else {
  14.    echo "Connection failed.<p>";
  15.    echo 'SQLSTATE: ' . db2_conn_error() . '<br />';
  16.    echo 'Message: ' . db2_conn_errormsg(). '<br />';
  17. }
  18. ?>
I followed this link http://www.db2ude.com/?q=node/81 to install ibm_db2 driver
I installed Apache using yum install httpd -y

Please suggest what can be the problem...

Thanks
Feb 22 '10 #1
2 7992
Atli
5,058 Expert 4TB
Hey.

It's odd that the db2_conn_error and db2_conn_errormsg functions don't return anything. If the connection fails, they should.

Do you have the error messages turned on? Could be that there is an underlying problem that is being suppressed.
Feb 22 '10 #2
knellim
23
I tried the method to unsuppress the messages by adding these to php code
# error_reporting(E_ALL);
# ini_set('display_errors', true);

But still i get same error
Connection failed.SQLSTATE value:
Segmentation fault


Why m I getting a segmentation error.. Is this the reason..
Pls help..!
Feb 23 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Wiseguy | last post by:
apache-derby is the opensource release of the IBM Cloudscape JDBC/SQL embedded database engine for java. Unfortunately the derby website doesn't provide any downloadable documentation. When can I...
3
by: IOANNIS MANOLOUDIS | last post by:
Hello I downloaded cloudscape 10.0 from sourceforge. There is also the database derby available for download from the Apache incubator. Is there a difference between these two products? Are there...
0
by: yom | last post by:
Hi all. I am having some troubles with an application that has to open a dialup up connection. I am using the Ras API RasDial to call the remote modem an all works properly. I am also able to...
1
by: bennett | last post by:
I'm trying to write an ASPX page that uses an OleDbDataAdapter to get data from a SQL Server database. When I test the connection, it returns success, and when I preview the data using the...
0
by: gm | last post by:
Immediately after generating the Access application from the Source Safe project I get: "-2147467259 Could not use ''; file already in use." If Access database closed and then reopened I get:...
2
by: bob_jeffcoat | last post by:
Hi, I'm trying to: 1) create an SQL database in C# 2) open a connection to it 3) close the connection 4) drop the database If I don't do parts 2) and 3) it works, I can create and...
5
by: igotyourdotnet | last post by:
I'm trying to add a web part to my page and when I run my page with the web part I get this error: An error has occurred while establishing a connection to the server. When connecting to SQL...
3
by: collinsd | last post by:
I am trying to connect to a database in SQL Server Express on my PC. The SQLConnection open() method appears to work without generating any exceptions however as soon as I try to do anything to the...
14
by: drsmooth | last post by:
I hope you are all ok with the frequency of this question following my last, im struggling alot with this database stuff. and i really appreciate all the help from this forum, many a time you have...
7
by: =?Utf-8?B?TWF4R3J1dmVu?= | last post by:
I have a DLL that implements the Business and Data Layers for a number of different websites. That DLL uses a Strongly Typed DataSet to interface to the Data Source which is SQL Server. There...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.