CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: DBI:
DBI::Proxy for remote Oracle Database -error


New User

Jan 11, 2009, 7:13 PM

Post #1 of 4 (10007 views)
DBI::Proxy for remote Oracle Database -error Can't Post

Im trying to connect to a remote Oracle database using DBI::ProxyServer. I have started the server on port 3333 on the machine.
However i encounter the following error (from the apache logs)

[Sun Jan 11 21:42:27 2009] [error] [client] [Sun Jan 11 21:42:27 2009] trydb4proxy.cgi: DBI connect(';port=3333;dsn=dbi:Oracle:XE','xxxx',...) failed: Cannot log in to DBI::ProxyServer: Error while reading socket: Bad file descriptor at C:/Perl/site/lib/RPC/PlServer/ line 144.

Is there a specific confiuration that I have to set at the server side. What is going wrong?
I think i should also mention that I had trouble while installing the DBI::Proxy modules. Could that be the cause of error.
I have attached the file

My code is as follows:


use CGI qw(:standard);
use File::Temp qw/ tempfile /;
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
use strict;
use Spreadsheet::WriteExcel;

require "";

print "Content-type: text/html\n\n";

print <<EndHTML;
<h3><font color=#D02090>Model:</font></h3><h4> Rules for CDC Families</h4>

use strict;
use DBI;

use Oracle::SQLLoader qw/$CHAR $INT $DECIMAL $DATE/;

my $dsn = "dbi:Oracle:XE";
my $proxy = ";port=3333";
my $dbh = DBI->connect( "dbi:Proxy:$proxy;dsn=$dsn", "uname", "passwd" );



(This post was edited by amy1000 on Jan 12, 2009, 6:51 PM)
Attachments: (5.95 KB)

Veteran / Moderator

Jan 12, 2009, 9:42 AM

Post #2 of 4 (9993 views)
Re: [amy1000] DBI::Proxy for remote Oracle Database -error [In reply to] Can't Post

What were the problems while installing the DBI::Proxy modules? They very well could be the cause of your error.

Do you really need to use the proxy?
Have you tried using DBD::Oracle?

Some side notes on your code:
1) Group all of your use statements together at the beginning of the script and you should add the warnings pragma.

2) Using a here doc for a single line of output is odd.

3) require ""; is depreciated, instead you should be using the methods in CGI module.

4) The font tag is also depreciated, instead use css

5) Since you're loading warningsToBrowser in the use statement, you also need to enable it after outputting the header.

print header(); 

print h3({-style=>'Color: #D02090;'}, 'Model:'),
h4('Rules for CDC Families');

(This post was edited by FishMonger on Jan 12, 2009, 9:42 AM)

Veteran / Moderator

Jan 12, 2009, 10:20 AM

Post #3 of 4 (9989 views)
Re: [amy1000] DBI::Proxy for remote Oracle Database -error [In reply to] Can't Post

BTW, I hope for your sake that you really didn't post your real user username and password for your database which is on a public server.

You really should remove that info from your post and adjust your firewall settings. Port 3333 is open, it should be filtered. You have the same problem with a few other ports.

New User

Jan 12, 2009, 7:17 PM

Post #4 of 4 (9976 views)
Re: [FishMonger] DBI::Proxy for remote Oracle Database -error [In reply to] Can't Post

The reason I needed the DBD::Proxy module was that the main server from which I am redirecting my request is a freeBSD machine, and the sys. admin told me that freeBSD is not one of the supported client platforms {w/o enabling linux compatibility mode} for Oracle. So since we could not install the Oracle client on the webserver. I needed a work around to make a connection to my database.
the problem is now sorted though because the sys admin has suggested using another web server on which the Oracle client can be installed and I can make a direct connection.

Thanks for your help.


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives