I'm using : org.gjt.mm.mysql.Driver it work fine for me, very fast.

but I have a problem :
when I do ;
Context env = (Context) new InitialContext().lookup("java:comp/env");
DataSource source = (DataSource) env.lookup("jdbc/db");
Connection conn = source.getConnection();


   Statement stmt = conn.createStatement ();



  StringBuffer sql = new StringBuffer("");
  sql.append("SELECT *");
  sql.append(" FROM table");
  sql.append(" ...");
  ResultSet rs = stmt.executeQuery (sql.toString());

in a .jsp page it work fine but when I put that in a business bean who
do the same thing and return a ResultSet I have :

500 Servlet Exception
java.lang.NullPointerException
 at com.artprice.web.DBbean.artistSearch(DBbean.java:55)
 at _jsp._artprice._recArti__jsp._jspService(/artprice/recArti.jsp:39)
 at com.caucho.jsp.JavaPage.service(JavaPage.java:87)
 at com.caucho.jsp.JavaPage.subservice(JavaPage.java:81)
 at com.caucho.jsp.Page.service(Page.java:407)
 at
com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:136)

 at com.caucho.server.http.Invocation.service(Invocation.java:259)
 at
com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:146)

 at
com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:238)
 at
com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:157)

 at com.caucho.server.TcpConnection.run(TcpConnection.java:140)
 at java.lang.Thread.run(Thread.java:484)

it happen on then line :
ResultSet rs = stmt.executeQuery (sql.toString());

I'am using resin.
I don't understand, some help please.

James Bell a écrit :

> Hi everyone I want to use MySQL with Struts.  Although not a Struts
> specific question, what jdbc driver is the best to use.  I downloaded
> the driver from caucho and noticed that it was marked as
> experimental.  I know that may mean that it is still a good driver.
> But I would like an independent opionion. Thanks in AdvanceJames Bell

Reply via email to