当前位置:网站首页>写在eclipse里面,与数据库连接查询之后的问题
写在eclipse里面,与数据库连接查询之后的问题
2022-06-27 16:00:00 【CSDN问答】
大佬们,帮帮孩子吧,好人有好报,好人长命百岁!!!!刚刚开始学java和数据库,写了一点关于这方面的东西,结果我的这个eclipse连接数据库之后,刚开始进行查询,老是报错,说是查询失败,还有显示java.lang.NullPointerException, 代码报错在下面代码中的( if (rs.next()) ),这个怎么办啊?下面是部分代码:
if (account.length()!=0&&password.length()!=0) {
try { //密码账号都有效
//userDao判断密码是否正确
rs = userDao.selectByAccountAndPassword(account, password) //账号密码正确,返回结果集不为null
if (rs.next()) {
user = userDao.saveUser(rs);
if (user.getRole() == BaseDao.userRoLeStudent) {
System.out.println("是学生");
边栏推荐
- Impressive questions
- Annual comprehensive analysis of China's audio market in 2022
- 2022年中国音频市场年度综合分析
- leetcode 142. Circular linked list II
- JS event binding and common events
- 【多线程】线程通信调度、等待集 wait() 、notify()
- [qt learning notes]qt uses MFC compilation to generate DLL libraries. The problem that DLL cannot be loaded occurs on computers without programming environment
- Autodesk Navisworks 2022软件安装包下载及安装教程
- Special function calculator
- 软件测试学习-黑马程序员,软件测试学习大纲
猜你喜欢
leetcode 142. Circular linked list II
Oracle concept II
d3dx9_ How to repair 38.dll? d3dx9_ 38. How to download a missing DLL?
Leetcode daily practice (sum of two numbers)
[fxcg] today's market analysis
Anfulai embedded weekly report (issue 252): February 7, 2022 to February 13, 2022
d3dx9_ How to repair 25.dll? d3dx9_ 25.dll where to download
09 route guard authenticates URL
leetcode 69. Square root of X
A robot is located in the upper left corner of an M x n grid. The robot can only move down or right one step at a time. The robot attempts to reach the lower right corner of the grid. How many differe
随机推荐
leetcode 142. Circular linked list II
Leetcode 33. Search rotation sort array
Generate zip package command
(POJ - 1847) tram (shortest circuit)
All you want to know about large screen visualization is here
D use in
The two trump brand products of Langjiu are resonating in Chengdu, continuously driving the consumption wave of bottled liquor
当发布/订阅模式遇上.NET
Offline disk group
医院预约挂号系统-系统结构
After the mobile phone, it was reported that Samsung also cut the output of TV and other home appliance product lines
07. Express routing
Explain the distributed computing of Apache skywalking OAP in detail
d3dx9_ How to repair 38.dll? d3dx9_ 38. How to download a missing DLL?
About how vs2019c # establishes the login interface, the user name and password entered must match the records in the access database
Annual comprehensive analysis of China's audio market in 2022
Use pyinstaller to package py files into exe. Precautions and error typeerror:_ get_ sysconfigdata_ name() missing 1...‘ check_ Solutions to exists'
Handling method of occasional error reporting on overseas equipment
Alibaba cloud server is invaded
Handwritten promise series - all