All,
I have been trying to run a CGI script on the tomcat app server by enabling CGI support through the configuration files in tomcat (on windows xp). I have been able to set up this configuration successfully and a sample "hello world" program works ok.
However, now I am trying to run my actual code, which connects to a DB using DBI, but it fails and gives me the following error:
Error ORA-12545: Connect failed because target host or object does not
+ exist (DBD ERROR: OCIServerAttach) connecting to DBI:Oracle:host=<ho
+stname>;sid=<sid>;port=1521
As per WW's suggestion, here is the "connect" code that I am using:
# DBI Initializations
my $driver = 'Oracle';
my $hostname = 'host=oradev;sid=oradev;port=1521';
my $user = 'user';
my $password = 'password';
my $dsn = "DBI:$driver:$hostname";
my $dbh = DBI->connect($dsn,$user,$password) or croak "Error $DBI::err
+str connecting to $dsn\n";
I checked the TNSNAMES file and I am able to successfully ping and tnsping to the <hostname>. I wonder what might still be missing! Can anyone point me in the right direction?
Cheers,
Sarang D.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|