Just having the driver specified on the classpath doesn't register it.
You have to do a Class.forName("drivernamehere") to register it with
the DriverManager. I'd do that as a ServletContextListener or
something.
On 2/29/08, Nino Saturnino Martinez Vazquez Wael
<[EMAIL PROTECTED]> wrote:
> you need to have which ever driver you specified on classpath..
>
>
> wicketUser wrote:
> > Hi,
> >
> > I am new to Wicket and I don't wish to use hibernate as persistence
> > framework. I am trying to do CRUD operations through JDBC connection to a
> > mysql database.
> >
> > I have added mysql dependency in my project's pom.xml file
> >
> > <dependency>
> > <groupId>mysql</groupId>
> > <artifactId>mysql-connector-java</artifactId>
> > <version>5.0.5</version>
> > </dependency>
> >
> > and I can see the connector in the war file.
> >
> > However, when I try to save an object, I get the following error:
> >
> > java.sql.SQLException: No suitable driver
> > at java.sql.DriverManager.getConnection(DriverManager.java:545)
> > at java.sql.DriverManager.getConnection(DriverManager.java:171)
> > at com.mycompany.DBConnection.save(DBConnection.java:20)
> > at
> > com.mycompany.CategoryPage$CategoryForm.onSubmit(CategoryPage.java:35)
> > at
> > org.apache.wicket.markup.html.form.Form.delegateSubmit(Form.java:1328
> > )
> > at
> > org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:776
> > )
> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > at
> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> > java:39)
> > at
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> > sorImpl.java:25)
> > at java.lang.reflect.Method.invoke(Method.java:585)
> > at
> > org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInte
> > rface.java:183)
> > at
> > org.apache.wicket.request.target.component.listener.ListenerInterface
> > RequestTarget.processEvents(ListenerInterfaceRequestTarget.java:73)
> > at
> > org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents
> > (AbstractRequestCycleProcessor.java:90)
> > at
> > org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.j
> > ava:1166)
> > at org.apache.wicket.RequestCycle.step(RequestCycle.java:1241)
> > at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1316)
> > at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
> > at
> > org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:
> > 354)
> > at
> > org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.ja
> > va:194)
> > at
> > org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(Servlet
> > Handler.java:1084)
> > at
> > org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:3
> > 60)
> > at
> > org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.jav
> > a:216)
> > at
> > org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:1
> > 81)
> > at
> > org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:7
> > 26)
> > at
> > org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
> >
> > at
> > org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHand
> > lerCollection.java:206)
> > at
> > org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.
> > java:114)
> > at
> > org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:1
> > 39)
> > at org.mortbay.jetty.Server.handle(Server.java:324)
> > at
> > org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:50
> > 5)
> > at
> > org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnectio
> > n.java:842)
> > at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:648)
> > at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
> > at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
> > at
> > org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.ja
> > va:395)
> > at
> > org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool
> > .java:450)
> >
> >
> > Can anyone please help me with this?
> >
> > Thanks.
> >
> >
>
> --
>
> -Wicket for love
> -Jme for fun
>
> Nino Martinez Wael
> Java Specialist @ Jayway DK
> http://www.jayway.dk
> +45 2936 7684
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]