472,792 Members | 2,222 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,792 software developers and data experts.

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

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

Connection to database failed.
Below is my script

Expand|Select|Wrap|Line Numbers
  1. <?php
  3. $database = 'mytest';
  4. $user = 'knellim';
  5. $password = 'xxxx';
  7. $conn = db2_connect($database, $user, $password);
  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...

Feb 22 '10 #1
2 7787
5,058 Expert 4TB

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
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

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...
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...
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...
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...
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:...
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...
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...
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...
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...
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...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.