0
我新的Perl和有數據庫連接`IO ::插座:: INET:連接:連接到數據庫的JDBC連接時refused`
sub db_connect {
my ($database, $user, $password) = @_;
my $driver = "JDBC";
my $port = 14000;
my $dsn = "dbi:JDBC:hostname=localhost:14000; url=jdbc:hsqldb:hsql://localhost:1111/$database;jdbc_character_set=ASCII";
my $db_handler = DBI->connect($dsn, $user, $password) or die $DBI::errstr;
print "DB connected\n";
return $db_handler;
}
和下面的腳本是錯誤: -
process name:- com.vizdom.dbd.jdbc.ServerDBI connect('hostname=localhost:14000;url=jdbc:hsqldb:hsql://localhost:1111/EciToolDB;jdbc_character_set=ASCII','SA',...) failed: Failed to open socket to server: IO::Socket::INET: connect: Connection refused at ../lib/utils.pl line 66
Failed to open socket to server: IO::Socket::INET: connect: Connection refused at ../lib/utils.pl line 66.
你可以發佈你的完整代碼,並告訴我們關於第66行嗎? – serenesat
只是要清楚,它不是* db_handler *,它是* db_handle *。有一個巨大的差異 – Borodin
my $ db_handler = DBI-> connect($ dsn,$ user,$ password)或者死於$ DBI :: errstr;這是行號。 66 –