Skip to Content.
Sympa Menu

freetds - Re: [freetds] jdbc connectivity issue in perl

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: praveen <praveen AT unlserve.unl.edu>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] jdbc connectivity issue in perl
  • Date: Tue, 18 Nov 2003 16:39:23 -0600

On Tue, 18 Nov 2003 16:21:17 -0600, praveen <pkallaku AT cse.unl.edu> wrote:

i read through loads of archives before asking this. but still can't figure out where i am going wrong

i have a small perl prog trying to connect to an oracle 9i db through DBD::JDBC. here's the code snippet:


my $url="jdbc:oracle:thin:\@somehost.com:1790:TEST";
my $hostname="somehost.com";
my $port=1790;
my $dsn="dbi:JDBC:hostname=$hostname;port=$port;url=$url;jdbc_character_set=ASCII";
my $user=some_user;
my $password=some_pwd;
print "DEBUG: connecting to JDBC using this conn string -- $dsn\n";
my $dbh=DBI->connect($dsn, $user, $password) or die $DBI::errstr;


and here's the error i get



DEBUG: these are the drivers: ExampleP JDBC Proxy Sponge
DBI 1.38-nothread dispatch trace level set to 2
DEBUG: connecting to JDBC using this conn string -- dbi:JDBC:hostname=somehost.com;port=1790;url=jdbc:oracle:thin:@somehost.com:1790:TEST;jdbc_character_set=ASCII
-> DBI->connect(dbi:JDBC:hostname=somehost.com;port=1790;url=jdbc:oracle:thin:@somehost.com:1790:TEST;jdbc_character_set=ASCII, some_user, ****)
-> DBI->install_driver(JDBC) for linux perl=5.006001 pid=11683 ruid=1000 euid=1000
install_driver: DBD::JDBC version 0.64 loaded from /usr/local/share/perl/5.6.1/DBD/JDBC.pm
<- install_driver= DBI::dr=HASH(0x81d35bc)
-> connect for DBD::JDBC::dr (DBI::dr=HASH(0x81d35bc)~0x838c664 'hostname=somehost.com;port=1790;url=jdbc:oracle:thin:@somehost.com:1790:TEST;jdbc_character_set=ASCII' 'some_user' **** HASH(0x822baa4))
1 -> trace in DBD::_::common for DBD::JDBC::dr (DBI::dr=HASH(0x838c664)~INNER)
1 <- trace= 2 at JDBC.pm line 88
!! ERROR: 101 'I/O Error '
<- connect= undef at DBI.pm line 585
-> errstr in DBD::_::common for DBD::JDBC::dr (DBI::dr=HASH(0x81d35bc)~0x838c664)
error: 101 'I/O Error '
<- errstr= 'I/O Error ' at DBI.pm line 588
DBI connect('hostname=somehost.com;port=1790;url=jdbc:oracle:thin:@somehost.com:1790:TEST;jdbc_character_set=ASCII','guo_user',...) failed: I/O Error
DBI connect(hostname=somehost.com;port=1790;url=jdbc:oracle:thin:@somehost.com:1790:TEST;jdbc_character_set=ASCII','guo_user',...) failed: I/O Error at ./db.pl line 25
-> $DBI::errstr (&) FETCH from lasth=HASH
>> DBD::JDBC::dr::errstr
<- $DBI::errstr= 'I/O Error '
-> $DBI::errstr (&) FETCH from lasth=HASH
>> DBD::JDBC::dr::errstr
<- $DBI::errstr= 'I/O Error '
I/O Error at ./db.pl line 25.
-- DBI::END
-> disconnect_all for DBD::JDBC::dr (DBI::dr=HASH(0x81d35bc)~0x838c664)
1 -> FETCH for DBD::JDBC::dr (DBI::dr=HASH(0x838c664)~INNER 'jdbc_connections')
1 <- FETCH= ( undef ) [1 items] at JDBC.pm line 316
<- disconnect_all= undef at DBI.pm line 653
! -> DESTROY for DBD::JDBC::dr (DBI::dr=HASH(0x838c664)~INNER)
! <- DESTROY= (not implemented) during global destruction

can someone tell me whats happening?

on the same note, if i set the dsn to
my $dsn="dbi:JDBC;hostname=$hostname;port=$port;url=$url;jdbc_character_set=ASCII";
(notice that after JDBC, i substituted the colon with a semi-colon. i tried this too because there seem to be several variants to this). the error changes to no database driver defined. which one of the two is taking me closer to a workable notation?

DEBUG: these are the drivers: ExampleP JDBC Proxy Sponge
DBI 1.38-nothread dispatch trace level set to 2
DEBUG: connecting to JDBC using this conn string -- dbi:JDBC;hostname=somehost.com;port=1790;url=jdbc:oracle:thin:@somehost.com:1790:TEST;jdbc_character_set=ASCII
-> DBI->connect(dbi:JDBC;hostname=somehost.com;port=1790;url=jdbc:oracle:thin:@somehost.com:1790:TEST;jdbc_character_set=ASCII, some_user, ****)
Can't connect(dbi:JDBC;hostname=somehost.com;port=1790;url=jdbc:oracle:thin:@somehost.com:1790:TEST;jdbc_character_set=ASCII guo_user some_user), no database driver specified and DBI_DSN env var not set at ./db.pl line 25
-- DBI::END






--
k.p.




Archive powered by MHonArc 2.6.24.

Top of Page