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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T23:01:20+00:00 2026-06-07T23:01:20+00:00

I am new and any help will be highly appreciated. I have a Webapp

  • 0

I am new and any help will be highly appreciated. I have a Webapp installed on Amazon EC2. I have installed Tomcat7 and MySQL 5.5 on Amazon EC2.

I am using following code in servlet for JDBC-MySQL connection

        Connection connection;
        Statement statement;
        ResultSet rs = null;
        try {
            // load Connector/J
            Class.forName("com.mysql.jdbc.Driver");
            connection = DriverManager.getConnection(JDBC_MYSQL_STRING);
            System.out.println(TAG + " Connection with MySQL established");
            statement = connection.createStatement();
            ....
            ....
            ....
            rs.close();
            statement.close();
            connection.close();
        } catch (ClassNotFoundException ex) {
            Log.log(Level.SEVERE, "ClassNotFoundException", ex);
        } catch (SQLException e) {
            for (Throwable t : e) {
                System.out.println(t.getMessage());
            }

I have included mysql-connector-java-5.1.13-bin.jar for Connector/J in the Library folder for Netabeans and deployed war files on tomcat7 in Amazon ec2.

My Question
I have learned that JDBC-MySQL connection is very time consuming operation and connection pools can be used to keep live connection which will reduce time consumed in connection. I am new to this and have read my blogs but unable to understand how to set up connection pool and how to use it in the servlets?

Thanks.

  • 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-07T23:01:21+00:00Added an answer on June 7, 2026 at 11:01 pm

    You need to setup the DB Connection in server.xml

    Follow this:
    http://www.mulesoft.com/tomcat-mysql

    The URL of your database would take this form:

    “jdbc:mysql://yourdatabasename.foo.us-east-1.rds.amazonaws.com:3306/”

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

Sidebar

Related Questions

Any help will be highly appreciated. I am using a ImageButton in each row
I am new to jQuery. Any help would be appreciated I have two radio
Alright, so I'm fairly new to PHP and SQL/MySQL so any help is appreciated.
I am new to C++. I am getting HEAP CORRUPTION ERROR. Any help will
I'm relatively new to Java and would appreciate any help on this! I have
I'm very new to this, so any help is appreciated. I'll use the Dinners/RSVPs
I am relatively new to db design, so any help here would be appreciated.
xml is not encoding proper - any help List<NameValuePair> formparams = new ArrayList<NameValuePair>(); formparams.add(new
i'm just new to iOS Programming, so appreciate for any help. I'm trying to
Can any one help in transforming my xml though XSLT. I am new to

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.