Front page | perl.dbi2.dev |
Postings from October 2005
JDBC, again, mostly
Thread Previous
From:
Tim Bunce
Date:
October 19, 2005 08:08
Subject:
JDBC, again, mostly
Message ID:
20051019094752.GA5819@timac.local
I bit off more than I could chew with that last post, given the circumstances[1],
but in reflecting on it and starting to write responses over the last
few days I've decided we need to change the approach slightly to stay
more focused on the practical.
So I'm assigning some homework to you all while I'm busy[1] :)
Given that we're basing the driver API on JDBC, what are the minimum set
of changes you'd make to JDBC to make it more perl-like? (Ideally the
changes need to be implementable as a layer over JDBC since that's how
we can best implement and play with them in the short term.)
So, for example, the rs.next method could return a row object so
instead of the (in Perl5):
while ($rs->next) {
my $foo = $rs->getInt(1);
my $bar = $rs->getString(2);
print "row: foo=$foo, bar=$bar\n";
}
you could write (again, still in Perl5 syntax):
while ($row = $rs->next) {
print "row: foo=$row->{foo}, bar=$row->{bar}\n";
}
For Perl6 $row would be an object that can be accessed as an array or a hash.
Anyway, take a good look at the JDBC API and get thinking...
http://java.sun.com/products/jdbc/
http://java.sun.com/developer/onlineTraining/Database/JDBCShortCourse/index.html
Tim.
[1] All being well we should have a new addition to the family 'any day now',
or perhaps even 'any hour'.
Thread Previous