I am learning to struts frame work. Can any body post simple struts with jdbc example. Like where i have to define the database connection and which class i have to mention for data base related things.If possible pls send me the step wise code .
JCE: The link above is out of date. Start with the Struts FAQ: How To Access A Database. There are links at the bottom of the page to numerous newsgroup discussions on this topic. Also try searching this forum, as this topic seems to come up often.
subhash rao
Greenhorn
Joined: Feb 17, 2005
Posts: 3
posted
0
Hi
I am getting following exception when i execute the struts with jdbc .
<Apr 27, 2003 3:58:28 PM IST> <Error> <HTTP> <101018> <[ServletContext(id=821981 0,name=SimpleStruts,context-path=/SimpleStruts)] Servlet failed with ServletExce ption javax.servlet.UnavailableException: Initializing application data source org.apa che.struts.action.DATA_SOURCE at org.apache.struts.action.ActionServlet.initModuleDataSources(ActionSe rvlet.java:1089) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:471) at javax.servlet.GenericServlet.init(GenericServlet.java:258) at weblogic.servlet.internal.ServletStubImpl$ServletInitAction.run(Servl etStubImpl.java:1075) at weblogic.security.service.SecurityServiceManager.runAs(SecurityServic eManager.java:744) at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubIm pl.java:899) at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStub Impl.java:833) at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI mpl.java:773) at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppS ervletContext.java:2763) at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebApp ServletContext.java:2708) at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAp pServletContext.java:2681) at weblogic.servlet.internal.HttpServer.preloadResources(HttpServer.java :552) at weblogic.servlet.internal.WebService.preloadResources(WebService.java :476) at weblogic.t3.srvr.ServletInitRunner$1.run(ServletInitRunner.java:50) at weblogic.security.service.SecurityServiceManager.runAs(SecurityServic eManager.java:744) at weblogic.t3.srvr.ServletInitRunner.run(ServletInitRunner.java:46) at java.lang.Thread.run(Thread.java:479) >
Remove the extra 'r' from the end of your driver name. The oracle.jdbc.driver.OracleDriver class will work.
James Carman, President<br />Carman Consulting, Inc.
ashwin bala
Ranch Hand
Joined: Dec 07, 2009
Posts: 30
posted
0
hey guys i ve done all connections in public Actionforward execute() in action class.. i can retrieve the one set of values from database and display it the jsp page
public Actionforward execute(Http...........)
{
HttpSession session;
in jsp i use getAttribute("customername"); to get the one value from action class.. but i can use it only fr single value please give me a solutions for set of 25 records.. coz i cannot use set and getattrbutes 25 times..
ashwin bala
Ranch Hand
Joined: Dec 07, 2009
Posts: 30
posted
0
ashwin bala wrote:hey guys i ve done all connections in public Actionforward execute() in action class.. i can retrieve the one set of values from database and display it the jsp page
public Actionforward execute(Http...........)
{
HttpSession session;
in jsp i use getAttribute("customername"); to get the one value from action class.. but i can use it only fr single value please give me a solutions for set of 25 records for example around 25 customernames.. coz i cannot use set and getattrbutes 25 times..
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.