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

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

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

 



amy1000
New User

Jan 11, 2009, 7:13 PM

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

Hi,
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 127.0.0.1] [Sun Jan 11 21:42:27 2009] trydb4proxy.cgi: DBI connect('hostname=128.213.xx.xxx;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/Comm.pm 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 Comm.pm file

My code is as follows:

Code
 
#!C:\Perl\bin\perl.exe

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



require "cgi-lib.pl";


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

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

use strict;
use DBI;



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

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

$dbh->disconnect;


Thanks,
Amy


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


FishMonger
Veteran / Moderator

Jan 12, 2009, 9:42 AM

Post #2 of 4 (4429 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?
http://search.cpan.org/author/PYTHIAN/DBD-Oracle-1.22/Oracle.pm

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 "cgi-lib.pl"; is depreciated, instead you should be using the methods in CGI module.

4) The font tag is also depreciated, instead use css
http://www.w3schools.com/CSS/css_howto.asp

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


Code
print header(); 
warningsToBrowser(1);

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



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


FishMonger
Veteran / Moderator

Jan 12, 2009, 10:20 AM

Post #3 of 4 (4425 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.


amy1000
New User

Jan 12, 2009, 7:17 PM

Post #4 of 4 (4412 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.
Amy

 
 


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

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