Thanks, I have seen the guiding info. However I am not sure how to come up with a full code that actually implements the connection pooling. I would be ALL SMILES if you could give a running jsp code or should I paste the code that I already have even though its not working?
Nina Savannah wrote: I would be ALL SMILES if you could give a running jsp code
I think this post on this forum is your code for connection pooling, am I right ?
Then I suggest, why you are using JSP for defining classes , accessing connection object, its not what recommended i.e java code in JSP. So make class or a servlet which contain all the logic to deal with database ( a pure java code) and forward the result to JSP page to show/display ..
Nina Savannah wrote:or should I paste the code that I already have even though its not working?
Not that JSP code again
I want you to follow this basic setup I provided with that tomcat link. If you faced any problem, post that here..
Nina Savannah
Ranch Hand
Joined: Oct 15, 2008
Posts: 35
posted
0
lol...thanks. I'll work on the info that you have provided and then get back to you with my attempt.
Nina Savannah
Ranch Hand
Joined: Oct 15, 2008
Posts: 35
posted
0
I have done the configurations but I am now stuck at the end.
My system is located at $CATALINA_HOME/webapps/ROOT/publications
I have saved test.jsp in $CATALINA_HOME/webapps/ROOT/publications
I have saved publications.war in $CATALINA_HOME/webapps/
and I have edit the code as follows:
I wasnt so sure of how to save a war file so I opened a new jsp page in macromedia then pasted the code gave at a .war extension when I was saving it.
public String getFoo() { return foo; }
public int getBar() { return bar;}
}
This class should be inside WEB-INF\classes\
Nina Savannah wrote:
I wasnt so sure of how to save a war file so I opened a new jsp page in macromedia then pasted the code gave at a .war extension when I was saving it.
NO, that's not how .war file is build, its like zip file and unzipped by servlet container.
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 7 in the jsp file: /publications/test.jsp
Generated servlet error:
foo.publications cannot be resolved or is not a type
An error occurred at line: 7 in the jsp file: /publications/test.jsp
Generated servlet error:
foo.publications cannot be resolved or is not a type
Now I dont know how to correct this.... :roll:
import package into a JSP page.
After all this clarification I think you need a simple JSP/Servlet tutorial which taught a step by step procedure to build and run web app. http://www.roseindia.net/jsp/ OR look at JSP/Servlet FAQ on this site.
Please make sure you use code tags while posting your code.Unformatted code is difficult to read and results in less response for your post. Read this for more information. You can edit your current post to add code tags by clicking button.
Sagar Rohankar wrote:
After all this clarification I think you need a simple JSP/Servlet tutorial which taught a step by step procedure to build and run web app. http://www.roseindia.net/jsp/ OR look at JSP/Servlet FAQ on this site.
Sagar Rohankar wrote:
After all this clarification I think you need a simple JSP/Servlet tutorial which taught a step by step procedure to build and run web app. http://www.roseindia.net/jsp/ OR look at JSP/Servlet FAQ on this site.
Ooch, that's hell . I think the best resource is to start with is Sun's tutorial..
Nina Savannah
Ranch Hand
Joined: Oct 15, 2008
Posts: 35
posted
0
Thanks so much guys. Looks like I am getting some where. I have started on the JSP tutorials, thanks.
Before I proceed I would like to clarify one thing. Once I have done the settings in web.xml and server.xml, is that all there is for Connection Pooling or am I supposed to write a jsp code that implements the Connection Pooling?
Also, what is the right way to save a war file? Do I need special software for this?
Nina Savannah wrote:
Before I proceed I would like to clarify one thing. Once I have done the settings in web.xml and server.xml, is that all there is for Connection Pooling or am I supposed to write a jsp code that implements the Connection Pooling?
Why you stuck to JSP for your database connection , why don't you, at least, define a simple Servlet and do whatever database coding you want there..
Nina Savannah wrote:
Also, what is the right way to save a war file? Do I need special software for this?
Yes and No, both, If you are well aware about How the basic folder and file configuration are there in .war file, no problem but I don't suppose you should messed up with those folder structure right now, . About s/w , Yes you can have Eclipse/Netbeans, which take care of all that difficulties, like setting CLASSPATH, tomcat server, and of course building a valid .war file..
Nina Savannah
Ranch Hand
Joined: Oct 15, 2008
Posts: 35
posted
0
I have this code here for database connection and its working well. I am not very familiar with servlets so for now i am coding in jsp. My concern then is how can I make the actual connection pooling work? As long as I am connecting to my database well, does that mean that my connection pooling is also working?
I got the impression that I need a code that implements the actual Connection Pooling from here:
Connection Pooling
Here is my Database Connection File:
Nina Savannah
Ranch Hand
Joined: Oct 15, 2008
Posts: 35
posted
0
:roll: Just wondering on the above...i'm confused.
I think you should first learn the basic things of servlet like the life cycle method, how to configure url-mappings in web.xml to invoke servlets etc.