I need your help, I just really don't know how to connect my jsp into mysql.., I tried this code:
I get this code from my connection when using java alone. Also I saw this code in net and I just revise it. I dont know if it connects to the mysql.. when I try to run it theres nothing on the screen like Successfully connected or error message.
One more sir, is JSP similar to HTML but it is run under JVM?
No, JSP produces HTML. To understand what JSP is, please read this article.
chure abcede wrote:Now im confused again, so what should I code in JSP?
Nothing. Putting Java code into a JSP has been obsolete for 12 years. Please see this JspFaq entry.
and where should my code like db connection and methods be placed ?
In the model classes. Please see this article for information on properly structuring web applications.
I sounds as if you need to read some books or tutorials to understand the basics of programming web applications. Be sure that the JSP resource focuses on JSTL and EL, and not on obsolete Java scriptlets.
chure abcede wrote:I don't yet have over view in website development, i just started in web application from desktop application. Do you have any recommended books or pdf file that should I read that is best suited for beginners because some of the tutorials are advance?
Head First Servlets and JSP is often recommended. (Disclaimer: I was a tech reviewer of this book.)
I tried to use the servlet but i'm having an error. java.lang.NullPointerException
Of course you can't just plop a method into servlet -- or any other class -- and call it from a JSP expecting it to magically have a response. That's not how servlets work.
This is the sort of dangerous thinking that putting Java code into a JSP results in.
Again, I think you are in a deep hole and digging yourself deeper. You need to back up a bit and understand some of the fundamentals of how the web works before diving off into whatever it is you are doing.