java.util.concurrent.ExecutionException

com.alibaba.otter.node.etl.load.exception.LoadException: org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [insert into aa-test.tb_aa_test(`username` , `phone` , `mail` , `id`) values (? , ? , ? , ?) on duplicate key update `username`=values(`username`) , `phone`=values(`phone`) , `mail`=values(`mail`) , `id`=values(`id`)]; SQL state [3D000]; error code [1046]; No database selected; nested exception is java.sql.BatchUpdateException: No database selected

Samebug tips1

MySQL doesn't support some types of characters (such as emojis) with the utf8 encoding. You need to be on MySQL 5.5+ and force utf8mb4 (everywhere, client and server). You can do this sending the query "SET NAMES utf8mb4". Check this https://goo.gl/3E2qzg

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Solutions on the web1259

  • (? , ? , ? , ?) on duplicate key update `username`=values(`username`) , `phone`=values(`phone`) , `mail`=values(`mail`) , `id`=values(`id`)]; SQL state [3D000]; error code [1046]; No database selected; nested exception is java.sql.BatchUpdateException: No database selected
  • org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [insert into GDSIGNAL. FLOW_INPUT(PATH , FLOW_EXEC_ID , INPUTINDEX , INPUTSIZE , NAME , CDO_NAME , RECORDS , CHANNEL_KEY , ID) values (? , ? , ? , ? , ? , ? , ? , ? , ?)]; SQL state [null]; error code [0]; Error; nested exception is java.sql.SQLException: Error
  • via GitHub by liyongcun
    , 3 months ago
    com.alibaba.otter.node.etl.load.exception.LoadException: org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [delete from `world`.`plat_user` where ]; nested exception is java.sql.BatchUpdateException: You
  • Stack trace

    • java.util.concurrent.ExecutionException: com.alibaba.otter.node.etl.load.exception.LoadException: org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [insert into aa-test.tb_aa_test(`username` , `phone` , `mail` , `id`) values (? , ? , ? , ?) on duplicate key update `username`=values(`username`) , `phone`=values(`phone`) , `mail`=values(`mail`) , `id`=values(`id`)]; SQL state [3D000]; error code [1046]; No database selected; nested exception is java.sql.BatchUpdateException: No database selected at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:603) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:615) at org.springframework.jdbc.core.JdbcTemplate.batchUpdate(JdbcTemplate.java:884) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$DbLoadWorker$1.doInTransaction(DbLoadAction.java:587) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$DbLoadWorker.doCall(DbLoadAction.java:578) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$DbLoadWorker.call(DbLoadAction.java:541) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$DbLoadWorker.call(DbLoadAction.java:513) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.sql.BatchUpdateException: No database selected at com.mysql.jdbc.PreparedStatement.executeBatchedInserts(PreparedStatement.java:1607) at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1272) at org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297) at org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297) at org.springframework.jdbc.core.JdbcTemplate$4.doInPreparedStatement(JdbcTemplate.java:899) at org.springframework.jdbc.core.JdbcTemplate$4.doInPreparedStatement(JdbcTemplate.java:1) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:587) ... 11 more Caused by: java.sql.SQLException: No database selected at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:998) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3835) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3771) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2435) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2582) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2535) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1911) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2145) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2081) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2066) at com.mysql.jdbc.PreparedStatement.executeBatchedInserts(PreparedStatement.java:1568) ... 17 more

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    4 times, 2 hours ago
    3 times, 21 hours ago
    6 times, 2 days ago
    693 times, 2 days ago
    5 times, 2 weeks ago
    149 more bugmates