File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes JSP & JDBC & MySQL & Apache Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "JSP & JDBC & MySQL & Apache Tomcat" Watch "JSP & JDBC & MySQL & Apache Tomcat" New topic
Author

JSP & JDBC & MySQL & Apache Tomcat

Sasan torabkheslat
Greenhorn

Joined: Jul 24, 2011
Posts: 6
can any body teach me hot to connect to mysql database in a jsp applications?

i'm a newbie!


Be Orginal!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61760
    
  67

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16303
    
  21

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!


Customer surveys are for companies who didn't pay proper attention to begin with.
Sasan torabkheslat
Greenhorn

Joined: Jul 24, 2011
Posts: 6
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!?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP & JDBC & MySQL & Apache Tomcat