|
|||||||
New to SitePoint Forums? Register here for free!
|
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
SitePoint Enthusiast
![]() Join Date: Nov 2006
Location: Sydney, Australia
Posts: 30
|
JSP - Using a class and passing the SQL connection to it
Hello,
I am new to JSP so I am having trouble coding my project site. Please excuse my bad coding practices. Basically, I wanted to enclose all my methods related to an auction in one class which could then be accessed by all the other pages in the site by accessing the created object. I was wondering though, is it possible to pass a connection like: Java Code:
to the class to give access to the database? The way I was previously doing created too much redundant code. I keep getting an SQLException whenever I try and use the createStatement() inside the class which otherwise works fine anywhere not in a class. The code I am trying to use (it's inside my index.jsp file for now): Java Code:
Having trouble finding anything useful anywhere... ![]() Thanks in advanced for any help! |
|
|
|
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
|
All times are GMT -7. The time now is 08:59.










Threaded Mode