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:
Help getting DBI to play nice with JDBC

 



keeferbs
New User

Aug 15, 2011, 11:11 AM

Post #1 of 1 (5763 views)
Help getting DBI to play nice with JDBC Can't Post

Greetings, everyone.

I saw a post in the Beginner section that I thought might help me with an issue I'm experiencing with the DBD::JDBC module, but it did not appear to address it. My apologies if I mis-read, and am posting the same thing twice.

Here is my problem. We are migrating from one server to a VM in another datacenter, and we want to make sure that our current perl scripts run correctly on the new platform. Both platforms are running the same OS (RHEL 5), but our current platform is 32-bit, and the target is 64-bit. After installing various modules from CPAN to address the modules that we use, I get the following error when running one of the scripts:

/path/to/script/name.pl
DBD::JDBC initialisation failed: Can't locate object method "driver" via package "DBD::JDBC" at /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/DBI.pm line 815, <GEN7> line 4.

Perhaps the capitalisation of DBD 'JDBC' isn't right. at /path/to/script/name.pl line 103

and below are the pertinent bits of code that relate to the use of JDBC...

modules:

Code
#!/usr/bin/perl 

use CGI;
use DBI;
use DBD::Pg;
use DBD::JDBC;
use strict;
use LWP::UserAgent;
use HTTP::Request::Common qw(POST);
use XML::Simple;
use URI::Escape;


JDBC connection:

Code
my $dsn="dbi:JDBC:hostname=10.1.10.35:1523;url=jdbc:sqlserver://flurble.fnord.com:1488;instanceName=Foo;databasename=BAR;ssl=require"; 
my $dbh_sde = DBI->connect("$dsn", "$db_user_sde", "$db_pass_sde", {PrintError => 1});
die "Unable for connect to server $DBI::errstr"
unless $dbh_sde;


So, what do I need to do to the DBI module to have itrecognize the JDBC drivers?

Any advice you can give would be greatly apreciated.

Thanks in advance.

 
 


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

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