mardi 17 juin 2014

Perl DB2 database connection issue


Vote count:

0




I'm newbie to Perl.


My requirement is to get inputs from user through HTML pages and insert or update the same data into DB2 database using Perl script.


But here i'm not able to connect to DB2 database.I'm getting following errors in apache tomcat log :


Jun 18, 2014 11:59:14 AM org.apache.catalina.core.ApplicationContext log INFO: cgi: runCGI (stderr):install_driver(DB2) failed: Can't load 'C:/strawberry/perl/site/lib/auto/DBD/DB2/DB2.dll' for module DBD::DB2: load_file:The specified module could not be found at C:/strawberry/perl/lib/DynaLoader.pm line 190.


Jun 18, 2014 11:59:14 AM org.apache.catalina.core.ApplicationContext log INFO: cgi: runCGI (stderr): at (eval 7) line 3.


Jun 18, 2014 11:59:14 AM org.apache.catalina.core.ApplicationContext log INFO: cgi: runCGI (stderr):Compilation failed in require at (eval 7) line 3.


Jun 18, 2014 11:59:14 AM org.apache.catalina.core.ApplicationContext log INFO: cgi: runCGI (stderr):Perhaps a required shared library or dll isn't installed where expected


Jun 18, 2014 11:59:14 AM org.apache.catalina.core.ApplicationContext log INFO: cgi: runCGI (stderr): at D:\apache-tomcat-7.0.54-windows-x64\apache-tomcat-7.0.54\webapps\ROOT\WEB-INF\cgi\SamplePerl.cgi line 10.


This is the Perl Script used : SamplePerl.pl



#!C:\strawberry\perl\bin\perl.exe

use CGI;
use DBI;
use DBI;
use DBD::DB2::Constants;
use DBD::DB2;

$dbh = DBI->connect("dbi:DB2:reporter", "db2inst1", "Zaq12wsx");


print "Content-type: text/html\n\n"; print "Hello, world!\n"


Please need help to configure connection settings to DB2 through Perl Script and to perform update, insert, fetch operations.



asked 20 secs ago






Aucun commentaire:

Enregistrer un commentaire