Skip to content
Advertisement

Query problem – insert in JDBC (double quotes, single quote)

I’ve a stupid problem that I cannot resolve. I’m learning Java and I’m new with this. My case is:

// ad a person into db

I know that the problem is in quotes or double quotes, but where?

Advertisement

Answer

You should be using a prepared statement here which handles the proper escaping of your literal value:

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