| | |
How to Connect MySQL from JSP Page
Please support our JSP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
•
•
This class is the JSP. JSP is an extension of Servlet. Simply told. If you see a few pages up on this article you see how to create a connection in JSP. But as i already had sead. Don't use connection or other business related code inside JSP. It makes it more difficult to read Tags and Java code. Move the Connection and Query code down in a DAO layer and use Servlet class as controler. Put the data you want into a JavaBean and put it into Request or session. Get it back in the JSP page and view it. If you need help in how to implement it give me a reply
Yes, I want to know how to implement it.
Please...
NEVER NEVER NEVER GIVE UP
•
•
Join Date: May 2008
Posts: 3
Reputation:
Solved Threads: 0
•
•
•
•
Here is an example of how I have done it so far. It is build in Netbeans 5.5
The exception it keeps relaying to me is this:
"org.apache.jasper.JasperException: File "/WEB-INF/tld/c.tld" not found"
And I've no idea why, I can see the file myself, it is 2 directories deeper (ie. /WEB-INF/tld) than the current directory index.jsp is in.
I realise that to many this may seem like a very stupid question, but I have been trying in vein for quite a while at this!
Thanks in advance.
If it is at all useful, I'm hosting my MySQL database using Apache2Triad, and I'm using Tomcat.
•
•
Join Date: Jan 2008
Posts: 36
Reputation:
Solved Threads: 4
•
•
•
•
Hi electron33, thank you for taking the time out to guide us newbies, but could you possibly explain to me how to run this?
The exception it keeps relaying to me is this:
"org.apache.jasper.JasperException: File "/WEB-INF/tld/c.tld" not found"
And I've no idea why, I can see the file myself, it is 2 directories deeper (ie. /WEB-INF/tld) than the current directory index.jsp is in.
I realise that to many this may seem like a very stupid question, but I have been trying in vein for quite a while at this!
Thanks in advance.
If it is at all useful, I'm hosting my MySQL database using Apache2Triad, and I'm using Tomcat.
I understand that you are not familiar with Java and Jsp. If you are using Netbeans to develop your application, you have the possibility to add libraries to the Web application class path. What you need is a Jar library named JSTL (java standard tag library). Inside the Jar file you will find a folder named META-INF. Inside this folder you will find a file named core.tld. copy this file from the jar file and put it inside the tld folder under WEB-INF. If there is no folder create one and call it tld.
Start the application and it sould work fine.
By the way. If you are newbie I will recommend starting with some simpler examples and work your way up. I will recommend this site for all. http://www.java2s.com.
I like that website and use it sometimes, however there are some problems
- 80% examples are just copy and paste cases from various books missing any explanation
- because of that simply useless to beginner that have to understand code to know what it does
- there are many cases of not working examples and admin is lazy to sort them (I actualy reported problem but no change)
- some code examples are out of date
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
![]() |
Similar Threads
- How to connect Oracle database from JSP page (Java)
- Very Very Urgent...Need Code for Calculating Execution Time For Jsp Page (JSP)
- Inserting uft8 strings into MySQL from jsp page (JSP)
- how to connect oracle 8i database with jsp page (JSP)
- Dynamic links in JSP page-need help (JSP)
- how to call javabean from jsp page upon onChange event (JSP)
- setting up MyODBC to connect to MySQL, need help.... (MySQL)
- I think I'm going to cry... (JSP)
Other Threads in the JSP Forum
- Previous Thread: Unable to connect to tomcat through browser
- Next Thread: MVC help
| Thread Tools | Search this Thread |
apache backbutton combobox connection database development directorystructure dynamicpagetitles eclipse frames glassfish ie8 imagetodatabse imageupload integer internet java javaee javascript jsf jsp jsppagetitles levels mvc2 mvcmodel2 network parameters passing ping printinserverinsteadofclient redirect request.getparameter response servlet servletdopost()readxml sessions software ssl state_saving_method stocks sun tomcat tutorial update video web






