Results 1 to 2 of 2

Thread: Servlet maintaining a JDBC connection?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2001
    Location
    Yewston, Texis
    Posts
    240

    Servlet maintaining a JDBC connection?

    Hi,

    I think I can probably figure out to do this, but wanted some implementation opinions. I need to set up a 'secure' system that maintains a temporary connection to a database via a servlet. I think it would be a neat design where when a user succesfully logs on, a JDBC connection is created with a specified inactivity time-out. In this way several users could be logged on and can interact with the database independently.

    How do I implement this?
    I suppose one way to go would be to set up a session variable that has a connection, then when other classes, servlets and jsp's need to use the connection, they could consult the session variable based on the users "sessionid" or whatever they call it in the Servlet realm. I kind of like that because each session has a built in inactivity time-out.

    Opinions?

    Many Thanks,

    cudabean

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Nov 2001
    Location
    Yewston, Texis
    Posts
    240
    This approach is working well. The one thing I like about JSP and Servlets as opposed to ASP and others is the ability to 1, define an object and 2, make it a session variable.

    cudabean

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width