How does java connect database executeUpdate () and executeQuery ()
It will be executed normally, and if it is not added, an error will be reported because the field is not a string.
The result set is empty
two。 In the Bean class, the default constructor is also related to the order of parameters
That means public Employee (String user,int id, String pwd) {}
It is different from public Employee (int id,String user,String pwd) {}.
In the test main method, the type order of the inserted data determines which constructor is called.
3. The method name of the constructor is the class name.
The difference between printing with or without toString in 4.system.out.println
There seems to be no difference (I'm not sure about this)
In the 5.sql statement, the double quotation marks are enclosed in double quotation marks, and there will be ambiguity.
Will report an error.
You should put quotation marks in it.
This is the end of the article on "how java connects databases executeUpdate () and executeQuery ()". Thank you for reading! I believe that everyone has a certain understanding of the knowledge of "how java connects database executeUpdate () and executeQuery ()". If you want to learn more, you are welcome to follow the industry information channel.