From: <php...@li...> - 2011-04-08 10:41:37
|
JM!! Thanks! It helped!! But I can't understand it This is the exception java.lang.ClassNotFoundException: com.mysql.jdbc.Driver Maybe it can't find the driver? If I execute the java class with java it works, so, I quite sure it should work... Thank you so much!! Saludos Rocío Gómez Escribano -----Mensaje original----- De: php...@li... [mailto:php...@li...] Enviado el: viernes, 08 de abril de 2011 11:55 Para: php...@li... Asunto: Re: [Php-java-bridge-users] help with php-java-bridge and mysql Hi Rocio, Instead of returning "no", you should display the exception message, that would help you to solve the problem for sure. Hope this helps, JM. On Fri, Apr 8, 2011 at 5:08 PM, <php...@li... > wrote: > Hello, Im trying to use php-java bridge, but I find it impossible! > > > > Basic examples work without problem, now, I want to connect php with mysql > using java. > > > > This is my code: > > > > Java : > > > > public class pruebaLog { > > > > public static String connectDB(){ > > Connection conn = null; > > String returned; > > try { > > Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance(); > > conn = DriverManager.getConnection("jdbc:mysql://localhost/spb", > "root", "Administrad0r"); > > returned= open; > > } catch (Exception e){ > > returned = "no"; > > } > > return returned; > > > > } > > } > > > > And the php: > > > > <?php > > > > require_once('./JavaBridge/java/Java.inc'); > > > > java_require('/var/www/bridge/java/pruebaLog.jar'); > > > > try{ > > $prueba = new Java('pruebaLog'); > > echo $prueba -> connectDB(); > > } catch (JavaException $e){ > > echo "ERROR". "<br>". $e; > > } > > > > ?> > > > > It shows no, I cant understand why! > > > > Thank you so much!! > > > > > > Saludos > > Rocío Gómez Escribano > > > > > ---------------------------------------------------------------------------- -- > Xperia(TM) PLAY > It's a major breakthrough. An authentic gaming > smartphone on the nation's most reliable network. > And it wants your games. > http://p.sf.net/sfu/verizon-sfdev > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > ---------------------------------------------------------------------------- -- Xperia(TM) PLAY It's a major breakthrough. An authentic gaming smartphone on the nation's most reliable network. And it wants your games. http://p.sf.net/sfu/verizon-sfdev _______________________________________________ php-java-bridge-users mailing list php...@li... https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users |