• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

JSP --> Servlet --> JDBC

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello,
i'm having a problem figuring out how to tie together an JSP page that calls a servlet, with a JDBC java class i have. the jdbc class makes a connection with the database. separatly, i have a working JSP page that calls a servlet. i'm trying to tie together the variables i'd enter into my jsp page with the stored procedure call in my JDBC class that connects to the database.
please help, i'm stumped.
 
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
How are you calling the servlet from the JSP? Are you using the request dispatcher, sending a redirect or doing something in a jsp scriptlet? Or is your user submitting a page to the servlet that was produced by the jsp?
If you could give a general description of your architecture, how things work and what classes you have that would be good.
Generally, if the user submits a form then the servlet would process the request (retrieving any parameters it needs), possibly with helper classes. The parameters can then be used raw or encapsulated in value objects. Any calls to the database could be made from the servlet or helper/DAO classes.
Cheers,
Steve
[ April 16, 2002: Message edited by: Steve Granton ]
 
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also, try to use JDBC 2 Datasources -- that way you'll take advantage of any Connection Pooling your Application Server Provides.
Check out Chapter 7, "Connecting to Resources" in the HP-AS Developer's Guide:
[ April 16, 2002: Message edited by: Jessica Sant ]
 
Why is the word "abbreviation" so long? And this ad is so short?
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic