Category Archives: Databases

jdbc4.MySQLSyntaxErrorException and max_user_connections

Possible causes for javax.servlet.ServletException: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: User dbuser already has more than ‘max_user_connections’ active connections 1. Mismatch between MySQL max_user_connections and JDBC pool limits The most simple and obvious reason is that your connection pool limits are set above max_user_connections. This … Continue reading

Posted in Databases, Java | Leave a comment

Using MongoDB with Java, JSP and Mongo Java API

MongoDB is leader amongst NoSQL databases and all our Java hosting packages support it. Here is MongoDB Java primer that you can find useful before reaching for comprehensive MongoDB Java API docs. MongoDB terminology As the NoSQL term suggests – … Continue reading

Posted in Databases, Java | Leave a comment

Dump and restore MySQL and PostgreSQL from Java and JSP code

Making MySQL or PostgreSQL dumps and restores from Java and JSP is not very different than usual use of dump/restore tools. See how to perform these tasks in our Java hosting environment and what to be warned about. The command … Continue reading

Posted in Databases, Java | Leave a comment

noAccessToProcedureBodies with JDBC, MySQL stored procedure and Java/JSP

For cases when a procedure is created by another user (DEFINER) than the calling user the noAccessToProcedureBodies JDBC parameter can help. It has been introduced in MySQL Connector version 5.0.3.  If it is set to ‘true’ and user cannot access … Continue reading

Posted in Databases, Java, Tomcat | Leave a comment

How to create and drop databases dynamically from Java/JSP code

JDBC drivers allow developers to perform DDL SQL commands in their Java/JSP code including CREATE and DROP of databases. In this example we present a simple JSP page that will allow you to test these functionality. In cPanel environment the … Continue reading

Posted in Databases, Java | Leave a comment

How to connect with PgAdminIII to PostgreSQL with SSH tunnel

On a cPanel server remote connections to PostgreSQL server are disabled by default. See how to leverage SSH tunnel and connect with PgAdminIII and Putty. 1. SSH tunnel with Windows and Putty If your key-based connection works fine (refer ‘Steps … Continue reading

Posted in Control Panels, Databases, Non-Java | Leave a comment

Web application (WAR) deployment on shared hosting server

3 simple steps (prepare DB, update DB credentials, upload WAR) explained in detail to have your web application (WAR) deployed and made accessible on our shared hosting servers. For our guide we will use database based, WAR packaged application. It … Continue reading

Posted in Control Panels, Databases, Java, Tomcat | 1 Comment

MySQL case-sensitivity and java.sql.SQLException: Can’t create table

MySQL case-sensitivity can cause create temporary table error for an application developed on Windows and run on Linux. Tomcat log: java.sql.SQLException: Can’t create table ‘xxxxx_1.#sql-5dc6_2dd2f85′ (errno: 121) MySQL server log: 120727 10:19:54 [Warning] Invalid (old?) table or database name ‘#sql-5dc6_2dd2f85′ … Continue reading

Posted in Databases, Java | Leave a comment

What JDBC string and driver should I use to connect to your database servers?

By default we offer MySQL and PostgreSQL and we recommend the following drivers: MySQL Connector/J driver connection string looks like “jdbc:mysql://[hostname]:[port]/[db_name]” You can find the driver on MySQL website at http://www.mysql.com/products/connector/j/ Example driver archive name: mysql-connector-java-5.1.5-bin.jar PostgreSQL driver connection string … Continue reading

Posted in Databases, Java | Leave a comment

How to use Unicode (UTF-8) with Tomcat, Java, PostgreSQL and JDBC?

I will show you on a real example where we will create a simple page with form to enter Unicode strings and display them. The strings will be saved to PostgreSQL database. Note that in our previous article we showed … Continue reading

Posted in Databases, Java, Tomcat | Leave a comment