current position:Home>Preparestatement of javajdbc

Preparestatement of javajdbc

2022-02-02 23:30:54 CSDN Q & A

I am using java Of JDBC On database connection , Used PrepareStatement To connect , There is a problem with placeholders :

img

img


The question I want to ask is in the second picture , Why do I only use a single quotation mark in the middle when I set the contents of the placeholder , Why are there two single quotation marks in the middle after output ?




Refer to the answer 1:

May have been escaped ( because The database enclosed in single quotation marks represents the string ), It is not recommended to use special characters or keywords ! Otherwise sql It's likely to go wrong !




Refer to the answer 2:

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.primo.wiki/2022/02/202202022330529732.html

Random recommended