当前位置:网站首页>Written in eclipse, problems after querying the database connection
Written in eclipse, problems after querying the database connection
2022-06-27 17:50:00 【CSDN Q & A】
bosses , Help the kids , One good turn deserves another , A good man lives a long life !!!! Just started learning java And the database , I wrote something about this , As a result, my eclipse After connecting to the database , Just started to query , Always report mistakes , The query failed , And the display java.lang.NullPointerException, The code reports an error in the following code ( if (rs.next()) ), What about this one ? Here is part of the code :
if (account.length()!=0&&password.length()!=0) {
try { // Both passwords and accounts are valid
//userDao Determine if the password is correct
rs = userDao.selectByAccountAndPassword(account, password) // Correct account password , The returned result set is not null
if (rs.next()) {
user = userDao.saveUser(rs);
if (user.getRole() == BaseDao.userRoLeStudent) {
System.out.println(" It's the students ");
边栏推荐
- Part 31 supplement (31) ECMAScript conversion to string and number
- d3dx9_ How to repair 25.dll? d3dx9_ 25.dll where to download
- Introduction to photoswape
- 当发布/订阅模式遇上.NET
- 2/14 preliminary calculation geometry
- Part 32 supplement (32) string of ECMAScript
- Software testing Basics - software testing history, process, classification, benefits, limitations
- 1. introduction to MariaDB
- Oracle概念二
- leetcode 82. Delete duplicate Element II in the sorting linked list
猜你喜欢

Uploading multiple attachments from canvas apps to SharePoint

建立自己的网站(10)

d3dx9_ 39.dll how to repair -d3dx9_ 39.dll missing file download

How to improve it electronic equipment performance management

Part 32 supplement (32) string of ECMAScript

Advanced learning of MySQL -- Application -- view, stored procedure, trigger

Byte + Google super full kotlin learning King fried notes! Kotlin introductory tutorial + Advanced kotlin enhanced actual combat (with demo)

Handling method of occasional error reporting on overseas equipment

Simulated process scheduling

leetcode 82. Delete duplicate Element II in the sorting linked list
随机推荐
Oracle概念三
Software testing Basics - software testing history, process, classification, benefits, limitations
Adaoracle supports multi chain distributed Oracle with wide area node quotation
Huawei cloud devcloud launched four new capabilities, setting two domestic firsts
Leetcode daily practice (sum of two numbers)
Etcd visualization tool: kstone deployment (I), rapid deployment based on Helm
Part 32 supplement (32) string of ECMAScript
【多线程】线程通信调度、等待集 wait() 、notify()
写在eclipse里面,与数据库连接查询之后的问题
Wanzhou gold industry: what knowledge points do you need to master to invest in precious metals?
软件测试-测试的概念,单元测试的详细介绍,如何设计测试用例
Explain the distributed computing of Apache skywalking OAP in detail
Detailed explanation of various GPIO input and output modes (push-pull, open drain, quasi bidirectional port)
(POJ - 1847) tram (shortest circuit)
P. Simple application of a.r.a method in Siyuan (friendly testing)
leetcode 82. Delete duplicate Element II in the sorting linked list
建立自己的网站(10)
Electronic smart package tutorial
Under the influence of external factors, how to manage internal resources and reduce costs is the key
Halcon: discrete digital OCR recognition