What could be the cause of Forbidden command : SHOW WARNINGS to MySql from SpringJDBC

Splash

Recently, I created a java app on an appengine Paas (name jd-app.com). But a very general SpringJDBC application wouldn't run because it shows exception for a simple query like "select * from user" for MySql. The files are from http://www.beingjavaguys.com

Very frustrated after a few days of trying so I am putting some code and configuration here hoping someone with knowledge or similar experience can help.

Code:

UserDaoImpl.java

public List<User> getUserList() {
    List<User> userList = new ArrayList<User>();
    String sql = "select * from user";
    userList = jdbcTemplate.query(sql, new UserRowMapper());

spring-servlet.xml

<bean id="dataSource"
    class="org.springframework.jdbc.datasource.DriverManagerDataSource">
    <property name="driverClassName" value="com.mysql.jdbc.Driver" />
    <property name="url" value="jdbc:mysql://10.0.16.16:4066/databasenamehidden" />
    <property name="username" value="xxxxx" />
    <property name="password" value="yyyyyy" />
</bean>

Exception:

HTTP Status 500 - Request processing failed; nested exception is org.springframework.jdbc.UncategorizedSQLException: StatementCallback; uncategorized SQLException for SQL [select * from wp_users]; SQL state [HY000]; error code [3013]; Forbidden command : SHOW WARNINGS; nested exception is java.sql.SQLException: Forbidden command : SHOW WARNINGS

Root cause

... org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:84) org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81) org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81) org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:413) org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:437) com.beingjavaguys.dao.UserDaoImpl.getUserList(UserDaoImpl.java:63)

Discussion

On the same Paas, I uploaded a Wordpress app which can access MySql and runs perfectly. But if I config that database in the spring-servlet.xml and select * from wp_users, then I will also see this exception from the SpringJDBC app.

I tried to change that sql query to other statement and I always get same exceptions. So what could be a reason for that? I can upload more code upon request.

Hai Bi

As mentioned by Nikhil, the error is from a forbidden command, and that is SHOW WARNINGS.

Maybe your Paas doesn't allow SHOW WARNINGS?

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

What could be the cause of Forbidden command : SHOW WARNINGS to MySql from SpringJDBC

From Dev

What could cause this error?

From Dev

What could cause a MySQL time stamp to equal December 31, 1969

From Dev

What could cause an object's attribute to not be read from the database?

From Dev

What could be the cause of this NullPointer Exception?

From Dev

What could cause the file command in Linux to report a text file as binary data?

From Dev

What could cause a Safari extension (toolbar button) to not trigger when Safari sends the "command" event?

From Dev

how can I detect deadlocks in MySQL? What could cause my application to hang when making a connection?

From Dev

What does this command actually cause?

From Dev

What could cause this difference in output in joda time?

From Dev

What could cause a Java TCP socket to close?

From Dev

Joblib crashes with an unexplainable error, what could cause it?

From Dev

What could cause Redis RDB Snapshoting to Stall?

From Dev

What could cause timers to flash in RecyclerView?

From Dev

What could cause a Java ScheduleService to not run?

From Dev

What could cause Intel RST to not recognise a drive?

From Dev

What could cause strange characters in Vim?

From Dev

What could be the cause of short flickering of screens

From Dev

What could cause a desktop power supply to "hiss"?

From Dev

What could be the cause of the smearing and ghosting displayed below?

From Dev

What could cause Retrofit to ignore method invocation?

From Dev

What could cause a Java TCP socket to close?

From Dev

hMatrix breaks in a file, what could be the cause?

From Dev

What could cause Vista machines to degrade in performance?

From Dev

What is the server side issue that could cause the MethodNotAllowedHttpException

From Dev

What could cause `UserManager` to return the wrong user?

From Dev

What could cause my SQL Server permissions to change from one execution of a stored procedure to the next?

From Dev

What could cause an MVC app to not display current information in IE after it's pulled from the DB?

From Dev

How to find the cause of "task queue depth" warnings from waitress?

Related Related

  1. 1

    What could be the cause of Forbidden command : SHOW WARNINGS to MySql from SpringJDBC

  2. 2

    What could cause this error?

  3. 3

    What could cause a MySQL time stamp to equal December 31, 1969

  4. 4

    What could cause an object's attribute to not be read from the database?

  5. 5

    What could be the cause of this NullPointer Exception?

  6. 6

    What could cause the file command in Linux to report a text file as binary data?

  7. 7

    What could cause a Safari extension (toolbar button) to not trigger when Safari sends the "command" event?

  8. 8

    how can I detect deadlocks in MySQL? What could cause my application to hang when making a connection?

  9. 9

    What does this command actually cause?

  10. 10

    What could cause this difference in output in joda time?

  11. 11

    What could cause a Java TCP socket to close?

  12. 12

    Joblib crashes with an unexplainable error, what could cause it?

  13. 13

    What could cause Redis RDB Snapshoting to Stall?

  14. 14

    What could cause timers to flash in RecyclerView?

  15. 15

    What could cause a Java ScheduleService to not run?

  16. 16

    What could cause Intel RST to not recognise a drive?

  17. 17

    What could cause strange characters in Vim?

  18. 18

    What could be the cause of short flickering of screens

  19. 19

    What could cause a desktop power supply to "hiss"?

  20. 20

    What could be the cause of the smearing and ghosting displayed below?

  21. 21

    What could cause Retrofit to ignore method invocation?

  22. 22

    What could cause a Java TCP socket to close?

  23. 23

    hMatrix breaks in a file, what could be the cause?

  24. 24

    What could cause Vista machines to degrade in performance?

  25. 25

    What is the server side issue that could cause the MethodNotAllowedHttpException

  26. 26

    What could cause `UserManager` to return the wrong user?

  27. 27

    What could cause my SQL Server permissions to change from one execution of a stored procedure to the next?

  28. 28

    What could cause an MVC app to not display current information in IE after it's pulled from the DB?

  29. 29

    How to find the cause of "task queue depth" warnings from waitress?

HotTag

Archive