Get the App
SLTechnology News&Howtos  ›  Development  › 

How does java connect database executeUpdate () and executeQuery ()

Shulou Source: shulou.com Published: 2022-06-01 04:03:30 09月22日 Update

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.

Tags: Data method database quotation marks content employee character string knowledge no parameter object article type result role statement department order query Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information macOS Docker MariaDB Apple