Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7512323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T23:49:48+00:00 2026-05-29T23:49:48+00:00

In my application I am using c3p0 for connection pooling. I provide the username

  • 0

In my application I am using c3p0 for connection pooling. I provide the username and password in the context file.Configuration is below:

<bean id="datasource"
            class="com.mchange.v2.c3p0.ComboPooledDataSource" lazy-init="true" destroy-method="close">
            <property name="driverClass" value="com.ibm.as400.access.AS400JDBCDriver" />
            <property name="jdbcUrl" value="${url}" />
            <property name="user" value="${username}" />
            <property name="password" value="${password}" />    </bean>

when my application loads then Spring made a connection using this username and password.
Now the problem is if any other user come and login with his profile using directly my login page then i want to replace the Springs connection with the new user’s connection.So the data fetching is done with the new user’s profile my client doesn’t want to change in the properties file.
Pls assist me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T23:49:51+00:00Added an answer on May 29, 2026 at 11:49 pm

    In your scenario, it doesn’t make any sense to have a connection pool since every session will need to open it’s own connection.

    You’d be better off opening a connection when a user logs in and then maintaining the same connection in the session scope. Or opening a new connection each time you need it, but that’s an extra overhead you might want to avoid. Just be careful about resource leakage. Since each user that logs in needs their own connection, you’ll need to set session timeouts pretty low to avoid having masses of open connections in abandoned sessions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I build j2ee application using spring, hibernage-JPA and c3p0 for connection pool. I have
I'm writing a red5 application using Java and I'm using the c3p0 for the
I have an application that is using Hibernate 3, c3p0, and spring 2.5.6. We
I'm running a Spring/Hibernate connecting to MySQL setup using c3p0 as my connection pool.
Application configuration: Web application using java first method of creating JAX-WS 2.0 Web Services
I have a web application using ASP.NET 2.0 and I want to know if
I am developing an application using MVC Preview 5. I have used typed views.
An older application using System.Web.Mail is throwing an exception on emails coming from hr@domain.com
In my ASP.NET application using InProc sessions, Session_End calls a static method in another
I developing ASP.NET application using a Swedish version of Windows XP and Visual studio

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.