in reply to H2 database connect in perl
I installed the jdbc Postgres driver (postgresql-9.3-1102.jdbc4.jar) from http://jdbc.postgresql.org/download.html.
Modified the run BAT script to :
This brings up the h2 server, and apparently listens on some random port. I find the port using "netstat-an".SET H2DRIVERS= -pg -tool SET CLASSPATH=-cp "D:\Program Files (x86)\H2\bin\h2-1.3.175.jar SET CLASSPATH=%CLASSPATH%;D:\some_path\postgresql-9.3-1102.jdbc4.jar" SET H2FLAGS= -webAllowOthers -tcpAllowOthers -url jdbc:h2:file:AvCloud +LiteDB -driver org.postgresql.Driver java %CLASSPATH% org.h2.tools.Console %H2DRIVERS% %H2FLAGS%
Then try to run this perl - which now hangs.:
use strict; use warnings; use DBI; my $dbh = DBI->connect("dbi:Pg:dbname=AvCloudLiteDB;host=127.0.0.1;por +t=60077;", ,, #$username, $password, {AutoCommit => 0, RaiseError => 1, PrintError => + 1} ) or die "Cannot - db:$DBI::errstr"; print "Connected..\n"; my $sth = $dbh->prepare("SELECT * from GRIDS"); while (my $h = $sth->fetchrow_hashref){ print "$_=$h->{$_}; " for keys %$h; print "\n"; } close $dbh;
"You're only given one little spark of madness. You mustn't lose it." - Robin Williams
|
|---|