Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using a jdbc connection to connect a vaadin application to a MySQL database. It works fine, but after a couple of uses it gets really slow, and even freezes the application to a point I have to restart the server.

Everything works fine in my local environment. It fails when I try to use it in an EC2 Linux server

This is the code I use to connect:

connectionProperties = new Properties();
    connectionProperties.put("user", "root");
    connectionProperties.put("password", dbPassword);
    try {   
        connectionPool = new SimpleJDBCConnectionPool(
                "jdbc:mysql://localhost:3306/" + dbName, "root", dbPassword, 2, 50);
        try {
        } catch (ClassNotFoundException e) {
            // TODO Auto-generated catch block

        connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/" + dbName, connectionProperties);
        statement = connection.createStatement();

    } catch (SQLException e1) {
    dbContainers = new DataBaseContainers();

Thanks in advance for any help you can give me!!!

share|improve this question

migrated from Jan 31 '14 at 19:24

This question came from our site for professional and enthusiast programmers.

Can you run SHOW FULL PROCESSLIST and see if any connections are sleeping, and how many connections are still open – h . Jan 31 '14 at 16:25
Thanks for your answer, but I'm still kinda lost here...Is there a Linux command to check the maximum Connections and change that number if needed? Is there a SQL command to clean up open connections that are not been used? – user3258041 Jan 31 '14 at 18:23
Sorry for the late reply. If you grab the process id, you can run KILL <processid> to kill/end it. To set the maximum connections see here. It may be worth while to clean your system and close connections after you're done with them - or set a persistent connection. – hd. Feb 3 '14 at 10:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.