0

I am using JdbcTemplate and trying to create a table if not exist by checking MySQL error code 1146 But I am not able to check the error code.

Vikalp
  • 71
  • 1
  • 10
  • Don't use error to detect if table existed, i.e. don't use exception for flow control. *Check* if table exists before trying to use the table. See [Check if table exists without using “select from”](https://stackoverflow.com/q/8829102/5221149). – Andreas Dec 23 '18 at 16:17
  • @Andreas Thanks for answering but I need to run "SELECT" query every time before insert while I need to create table query once. Is there any alternate way to do the same. – Vikalp Dec 23 '18 at 16:25
  • So what's the problem in detecting the *first* time you run select query? – Andreas Dec 23 '18 at 16:29

0 Answers0