To reference static methods, you could use:
$STATIC_REFERENCE = Java('package.ClassName');
$STATIC_REFERENCE->staticMetod(...);
To create an object (an instance of a class), you must use the "*new*"
keyword:
$object = new Java('package.ClassName');
So, you can create a static reference to the "Class" class and the same for
others.
$CLASS = Java('java.lang.Class');
$driver = $CLASS->forName("...")->newInstance();
I think that you don't need typecasting, remember, PHP is a dynamic
language.
Best regards from Cartagena / Colombia
Roger Padilla
On Tue, Aug 19, 2008 at 4:20 PM, <
php...@li...> wrote:
> Thank you for the quick reply.
>
> How would I do something like this with typecasting?
> Driver d =
>
> (Driver)Class.forName("com.ddtek.jdbc.sequelink.SequeLinkDriver").newInstance();
>
> Thank you,
> Micah Gersten
> onShore Networks
> Internal Developer
> http://www.onshore.com
>
>
>
> php...@li... wrote:
> > $dm = Java("java.sql.DriverManager");
> >
> > $con
> >
> =$dm->getConnection(\"jdbc:sequelink://fmServer:2399;serverDataSource=Clients\",
> > $username, $password");
> >
> >
> > On Tue, Aug 19, 2008 at 3:44 PM, <
> > php...@li...> wrote:
> >
> >
> >> I can now create the JDBC connection in PHP, but it doesn't do anything
> >> and just waits there.
> >> Here is the code:
> >>
> >> $con = new
> >>
> Java("DriverManager.getConnection(\"jdbc:sequelink://fmServer:2399;serverDataSource=Clients\",$username,$password);");
> >> --
> >>
> >>
> >> Thank you,
> >> Micah Gersten
> >> onShore Networks
> >> Internal Developer
> >> http://www.onshore.com
> >>
> >>
> >>
> -------------------------------------------------------------------------
> >> This SF.Net email is sponsored by the Moblin Your Move Developer's
> >> challenge
> >> Build the coolest Linux based applications with Moblin SDK & win great
> >> prizes
> >> Grand prize is a trip for two to an Open Source event anywhere in the
> world
> >> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> >> _______________________________________________
> >> php-java-bridge-users mailing list
> >> php...@li...
> >> https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
> >>
> >>
> >
> >
> >
> >
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> php-java-bridge-users mailing list
> php...@li...
> https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
>
--
Roger José Padilla Camacho
|