Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

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

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report