Tim,
> It's just the typical JDBC get-the-driver-class-loaded snippet:
>
> Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance();
>
> At this point I'm just exploring how literal the translation from Java to
> Perl can be made - but Class.forName() is certainly a special case.
> I'm using study_classes() for now, but I could add a little Java method
> to do the Class.forName and call it from perl with the name of the class.
> No problem.
No need. study_classes() will work in that case, but after toying
around with it a bit I got the Class stuff to work. You just have to
use the fully quallified class name for Class, which is
java.lang.Class:
#!/usr/bin/perl
use strict ;
use Inline (
Java => 'STUDY',
STUDY => ['java.lang.Class'],
AUTOSTUDY => 1,
) ;
my $h = java::lang::Class->forName("java.util.HashMap")->newInstance() ;
$h->put('a', 1) ;
print $h->get('a') ;
Patrick
>
> Thanks.
>
You're welcome.
> Tim.
>
--
=====================
Patrick LeBoutillier
Laval, Québec, Canada