|
From: <php...@li...> - 2008-01-08 23:34:37
|
I had the driver in the lib dir and it still wont work.
I ended up making a simple java wrapper class as follows to get it to work:
import java.sql.*;
import com.mysql.jdbc.Driver;
public class JavaBridgeJdbcConnector
{
public static Connection getConnection(String driver,String url)
{
Connection con = null;
try
{
Class.forName(driver);
con = DriverManager.getConnection(url);
}
catch(Exception e)
{
e.printStackTrace();
}
return con;
}
}
I can call that code in PHP to get the connection and it works fine from
there
Thanks for the help,
Phillip Savage
php...@li... wrote:
> Hi,
>
>
>> java_require("mysql-connector-java-5.1.5-bin.jar");
>> new java("com.mysql.jdbc.Driver");
>> java("java.sql.DriverManager")->getConnection("jdbc:mysql://xxx/xxx?user=xxx&password=xxx");
>>
>
> confirmed. The above code doesn't work with our dynamic java bridge class loader.
>
> As a workaround please copy mysql-connector-java-5.1.5-bin.jar to $HOME/lib (see the extra library
> dir from the java -jar JavaBridge.jar SERVLET:9090 3 "" output) or to WEB-INF/lib or deploy the
> connector into your J2EE server.
>
> We'll fix this problem asap.
>
> BTW: What about removing java_require() entirely? Although dynamic class loading may be convenient
> at first, it has certain problems I'd like to get rid of. This is really something that the J2EE
> server should handle.
>
>
> Regards,
> Jost Boekemeier
>
>
>
>
> Heute schon einen Blick in die Zukunft von E-Mails wagen? Versuchen Sie´s mit dem neuen Yahoo! Mail. www.yahoo.de/mail
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
> _______________________________________________
> php-java-bridge-users mailing list
> php...@li...
> https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
>
|