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


New User

Aug 15, 2011, 11:11 AM

Post #1 of 1 (9700 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:

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/ line 815, <GEN7> line 4.

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

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



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:

my $dsn="dbi:JDBC:hostname=;url=jdbc:sqlserver://;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