I just created simple jsp file which is show me the data from database but when i run that program it will show me the java.sql.SQLException: General error. I give the code in below
file name is showData.jsp
[code=java]
<%@ page contentType="text/html" pageEncoding="UTF-8"%>
Greetings hitendra and welcome to the ranch,
Can you please show us the stack trace of the complete excpetion ?
java.sql.SQLException: General error
This is very abstract and general. The root cause may be in the log files. Also kindly use code tags since it becomes quite difficult to read code in text format.
Muhammad Saif Asif Mirza
OCJA(5/6) OCJP(6) OCJWCD(6)
I see. Well there doesn't seem to be any fault with your code. Can you verify a couple of things on your end like the name of the driver ( is it present on the classpath and the lib folder ), also verify that you are using the correct Database name , also make sure that it has read/write privilages because I see that you have left the user name and password field as empty on the getConnection() method.
Muhammad Saif Asif Mirza
OCJA(5/6) OCJP(6) OCJWCD(6)
yes i verify all things this program is run on eclipse but when i try to run on using web-browser it will not work. is their any configuration on Apache tomcat
hitendra dongare wrote:yes i verify all things this program is run on eclipse but when i try to run on using web-browser it will not work. is their any configuration on Apache tomcat
How are you running it on eclipse and not on web-browser ? It is a JSP page, the only way to test it is to deploy it on tomcat and access it on web-browser .
Muhammad Saif Asif Mirza
OCJA(5/6) OCJP(6) OCJWCD(6)