Hi,
I'm an ASP programmer who is making the change to JSP and I'm starting to get pressed for time on a project. I've worked through several tutorials and I've used Pure JSP to connect to my databases and work with them, it is suggested in all the reading that the database connection, etc...be established in a Java class instead of directly in the JSP page, but I can't find any pertinent or even simple examples and I'm starting to get rushed in my learning.
Here is what I'd like an example of if anyone knows how or where to find it:
Java Class
establish connection to a database and throw an error if it doesnt connect.
JSP Page
Extract data, write data to the database created by the class.
I've written a Java Class that connects to the database sucessfully, but I cant figure out how to use it in JSP. I've tried to write code to instantiate the class, but then can't seem to access the connection inside it or anything?
The JSP page has similar code to this:
%
NameofJavaClass GetData; (where getdata is my object variable)
GetData = new NameofJavaClass();
%>
PLEASE help give me some direction, I'm just looking for a simple example on JSP accessing connection info from a JAva Class.
Thanx
I'm an ASP programmer who is making the change to JSP and I'm starting to get pressed for time on a project. I've worked through several tutorials and I've used Pure JSP to connect to my databases and work with them, it is suggested in all the reading that the database connection, etc...be established in a Java class instead of directly in the JSP page, but I can't find any pertinent or even simple examples and I'm starting to get rushed in my learning.
Here is what I'd like an example of if anyone knows how or where to find it:
Java Class
establish connection to a database and throw an error if it doesnt connect.
JSP Page
Extract data, write data to the database created by the class.
I've written a Java Class that connects to the database sucessfully, but I cant figure out how to use it in JSP. I've tried to write code to instantiate the class, but then can't seem to access the connection inside it or anything?
The JSP page has similar code to this:
%
NameofJavaClass GetData; (where getdata is my object variable)
GetData = new NameofJavaClass();
%>
PLEASE help give me some direction, I'm just looking for a simple example on JSP accessing connection info from a JAva Class.
Thanx