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 8115199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:23:20+00:00 2026-06-06T03:23:20+00:00

i m making a rmi based client server application. At Server side, it consists

  • 0

i m making a rmi based client server application.

At Server side, it consists of an java file running rmi(for binding registries) and all the required interfaces implemeneted invoking other classes meant for various server based operation (which includes a connection with the database).

Now the doubt is

“Where Shall I place the code for configuring ComboPoolDataSource Instance and the getConnection() method so that the configuration can be done when i run the java rmi file and i can invoke .getConnection() from any other java file.

  • 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-06-06T03:23:22+00:00Added an answer on June 6, 2026 at 3:23 am

    At First…Create the code to initiate the connection in a class containing static methods or variables like this the following..

            private static ComboPooledDataSource cpds = new ComboPooledDataSource();
            public static void MakePool()
            {
                   try 
                   {
                     cpds=new ComboPooledDataSource();
                     cpds.setDriverClass("com.mysql.jdbc.Driver");
                     cpds.setJdbcUrl("jdbc:mysql://localhost:3306/att_db");
                     cpds.setUser("root");
                     cpds.setPassword("dragon");
                     cpds.setMaxPoolSize(MaxPoolSize);
                     cpds.setMinPoolSize(MinPoolSize);
                     cpds.setAcquireIncrement(Accomodation);
                 } 
                 catch (PropertyVetoException ex) 
                 {
                     //handle exception...not important.....
                  }
    
    }
    public static Connection getConnection()
    {
               return cpds.getConnection();
    }
    

    Once u r done Create another class meant for server operations….

    and get the Connections from the Pool…

             try{
    
                   con=DatabasePool.getConnection();
                   // DatabasePool is the name of the Class made earlier....
                   .
                   .
                   .
                   .  // Server operations as u wanted.....
                   .
                   .
                 }
                 catch(SQL EXCEPTION HERE)
                 {
                      .....
                 }
                 finally
                 {     
                   if(con!=null)
                   {
                          con.close();      
                   }
                 }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I m making an rmi client server based program which is suppose to pass
im making an application where i have to load my database from html file
Long story short, I have an RMI Server and Client. The Server and Client
I'm coding an application that requires remote binding, i.e., bind a remote object to
I am participating in the development of a distributed solution, based on RMI, and
Making a piano/keyboard application and trying to figure out the best way to set
Making a small WCF test program which is based on a Store that has
Making the transition from Vim to gVim, I would like to disable all toolbars
Making a left hand side menu for my website. Should I create a Unordered
I have a project where I am using Java RMI to make objects remotely

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.