-
Hello, it's obviously a Chinese garbled problem. I'll ask. What is the name of your database table Chinese???
-
If your mysql is speechless to you.
-
Can the username and password in the connection string be blank? I haven't tried it and I don't know.,It looks like it's a problem with the connection string here.。
-
Hello, modify your database table. Don't use kanji. That's what I wrote when I was playing in programming.
-
If there is an abnormal message, there will be a lot less information;
-
Need to optimize the next **,1: Two tries should be combined into a block,2:Mainly the problem of Chinese characters,The problem of Chinese characters should be written to write a filter to process the encoding set as"gbk"
-
Write a self-written processor, or not that is the problem of your data table, and then it is not possible that you did not select Chinese when installing the database.
-
From the error it is clear that there is no package, and you go to the deployed server to confirm it. Try cleaning up your project, such as the clean feature of the Eclipse Project. If you don't have to copy the jar to the server completely (because it is not a network test), you can also copy it to the web-inf lib for testing.
-
First: conn ="url","root","root");
Instead: conn = ,"root","root");
Are you sure the class name is? You can go to the driver package jar to see if the specific package location of the driver class is.
If correct, you delete the cache files under %tomcat home%work, reboot, and try again.
-
This one of yours.
conn = "url","root","root");But it must have been written incorrectly, and I wrote an extra quotation mark.
conn = ,"root","root");You try it instead.
Yes, recompile, delete everything under Tomcat's work, and restart the server.
-
No suitable driver If you don't have the right driver, your driver version is definitely not right!
There is a problem hi me.
-
connection conn="jdbc:mysql://"+host+"/"+dbname,username,password);
statement stmt=;
resultset rs=;
This is the basic database manipulation method.
The general process is to load the driver class, create a connection, perform a database operation, and shut it down.
-
There's no difference. Just write jdbc**.
-
Do you want to connect in JSP or servlet?
-
You can look at it from these aspects:
1.Check whether the jar package of sqldriver is correctly added.
2.Check whether the connection parameters are written correctly.
Driver Name:
database connection url: jdbc:microsoft:sqlserver: localhost:1433; databasename=dbname
3.The port number of the database settings is determined to be 1433 (default)4Check whether the database service is started.
Note: When closing the connection in the finally block, you can judge whether it is empty or not, and then close if it is not empty.
if(conn !=null ){
Finally, it's a good idea to include a screenshot of the error or the wrong stack information.
-
There is no bag, how do you look at the ** treatment.
For general connection errors, think first of all, think about the port, the plug-in package you are connected to, and the username and password.
-
Take a screenshot of the error message and take a look...
-
context, rs, conn respectively; One look at the one that has a null pointer exception, and then look at the method that has this mull!
According to your above **, I can only say so much!
-
It is recommended that you go to the method of tracking to resolve null pointers.
Servlets are used for web development and as a control layer to process user requests. Servlet is the foundation of BS development, and understanding Servlet will be of great help to you in the future, JSP, and the later Struts2 framework. In normal operation, servlets are not used much, and all of them use struts2 instead of servlets to complete the functions. >>>More
1.Right-click the new floder in the new project
2.Create a package named lib. >>>More
Well, the left brain is responsible for the ability to analyze and deal with affairs. The right brain is responsible for the ability to emotionally, creatively, and so on. >>>More
The wall painting is generally painted with acrylic, because acrylic painting cannot be erased. If you paint with gouache, the gouache paint is unstable and the color changes when it volatilizes. Painting with acrylic should also be water-soluble, adding water is more or less the same as gouache, adding water and more colors are thin and transparent. >>>More
The anthropomorphic figure of speech to describe spring is as follows: >>>More