Skip to content
Advertisement

SQL query in Java with enum return error of Incorrect integer value:

I get this error massage: java.sql.SQLException: Incorrect integer value: ‘xACxEDx00x05~rx00…

the query is working, but if I put the category name (Category.Electricity) its return error. I call it with statement.setObject(…) meybe this is wrong..?

the main class:

the enum class:

the method:

so what is the way to call the enum?

thank you!

Advertisement

Answer

seems like your table is expecting CATEGORY_ID
so change

to

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement