Date: 01/31/00
- Next message: Brian Leyton: "[PHP4BETA] Compile errors with latest CVS"
- Previous message: Andrei Zmievski: "Re: [PHP4BETA] Session Cookie Lifetime"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I'm trying to use the php Java stuff to compare a jsp and php page, but get
errors all over. These 2 files are trying to use a JDBC driver on a db to
extract the data. I know I could use the direct access, but I want a code
comparison for the most part.
this is what my php code looks like, any suggestions?
$driver = new Java("java.lang.Class.forName", "org.gjt.mm.mysql.Driver");
$inst = new Java($driver->newInstance);
$conn = new Java("java.sql.DriverManager.getConnection",
"jdbc:mysql://localhost/php?user=phpuser&password=php");
$stat = new Java($conn->createStatement);
$res = new Java($stat->executeQuery, "select * from auth_user");
$metaData = new Java("java.sql.ResultSetMetaData");
$metaData = $res->getMetaData() ;
jsp looks like this and works:
<%@ page import="java.sql.*" %>
<% Class.forName ("org.gjt.mm.mysql.Driver").newInstance();
Connection connection =
DriverManager.getConnection("jdbc:mysql://localhost/php?user=phpuser&pas
sword=php");
Statement statement = connection.createStatement();
ResultSet resultSet = statement.executeQuery("select * from auth_user");
ResultSetMetaData metaData = null ;
%>
ini Java lines:
[Java]
java.library=/usr/lib//kaffe/libkaffevm.so
java.library.path=/usr/lib/kaffe:/tmp/al/php4/modules
java.class.path=/usr/share/kaffe/Klasses.jar:/tmp/al/php4/ext/java/php_j
ava.jar:/home/httpd/classes/mysql_uncomp.jar
extension_dir=/usr/lib/php/modules
extension=libphp_java.so
it gives error or blowing-up and error_log says:
Internal error.
Please check your CLASSPATH and your installation.
Exception thrown was of type `Java/lang/NullPointerException'
NULL message
php error:
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `'{'' or
`'$'' in /home/httpd/html/php/dbDemo.php on line 20
***********************************
AL Lewis
Systems Engineer
Evolutionary Systems Inc.
http://www.es-inc.com
(831)392.1092
(831)392.1192 fax
-- PHP 4.0 Beta Mailing List <http://www.php.net/version4/> To unsubscribe, e-mail: php4beta-unsubscribe <email protected> For additional commands, e-mail: php4beta-help <email protected> To contact the list administrators, e-mail: php4beta-admin <email protected>
- Next message: Brian Leyton: "[PHP4BETA] Compile errors with latest CVS"
- Previous message: Andrei Zmievski: "Re: [PHP4BETA] Session Cookie Lifetime"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

