• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP & JDBC & MySQL & Apache Tomcat

 
Sasan torabkheslat
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can any body teach me hot to connect to mysql database in a jsp applications?

i'm a newbie!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64623
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As you indicate you will be using Tomcat, your best bet is to use container-managed connection pooling. Tomcat provides this using DBCP. The details are Tomcat-specific, so I've moved this post to the Tomcat forum.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17993
47
Android Eclipse IDE Linux
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html

But PLEASE don't put the database code itself on the JSPs, Microsoft-style!
 
Sasan torabkheslat
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for your guides !

I've another problem !
when deploy one of the example of "Wrox Beginning JavaServer Pages(2005)" (chapter 23) on one of pages:
tomcat return this error:


org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/fmt cannot be resolved in either web.xml or the jar files deployed with this application
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:53)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:116)
org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:310)
org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:152)
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:410)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:475)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1425)
org.apache.jasper.compiler.Parser.parse(Parser.java:138)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:239)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:102)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:197)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:372)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:352)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:339)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:594)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:344)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
com.wrox.begjsp.ch23.football.AbstractProcessingCommand.performRedirect(AbstractProcessingCommand.java:32)
com.wrox.begjsp.ch23.football.RosterProcessingCommand.execute(RosterProcessingCommand.java:69)
com.wrox.begjsp.ch23.football.AdminServlet.doPost(AdminServlet.java:68)
com.wrox.begjsp.ch23.football.AdminServlet.doGet(AdminServlet.java:40)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393




i don't know what is thsi!?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic