current position:Home>When the database connection is normal, it is impossible to add, delete, modify and query the data in the database

When the database connection is normal, it is impossible to add, delete, modify and query the data in the database

2022-02-02 23:03:54 CSDN Q & A

The phenomenon and background of the problem

img


img


img


img

Operation results and error reporting contents

Exception in thread "main" java.lang.NullPointerException
at com.example.demo.Service.StudentService.getStudentInfo(StudentService.java:15)
at com.example.demo.DemoApplication.main(DemoApplication.java:24)

img

My solution ideas and tried methods

modify mapper Method , modify xml file

What I want to achieve

Can add, delete, modify and query the data in the database




Refer to the answer 1:

debugger Look at this 15 OK, data ,




Refer to the answer 2:



Refer to the answer 3:

getStudentInfo(StudentService.java:15)
Look at this null pointer exception .




Refer to the answer 4:



Refer to the answer 5:

This is big NPE




Refer to the answer 6:

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.primo.wiki/2022/02/202202022303524634.html

Random recommended