I have made what I'd like to call some progress, but the connection still hangs.

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 :

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%
This brings up the h2 server, and apparently listens on some random port. I find the port using "netstat-an".

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


In reply to Re: H2 database connect in perl by NetWallah
in thread H2 database connect in perl by NetWallah

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.