Home > Back-end >  Unable to connect the Java connection mysql
Unable to connect the Java connection mysql

Time:01-06

Where is the problem in the

CodePudding user response:

A statement on the output connection fails, means the conn't you pick up to the value, he is still the first null

CodePudding user response:

The
refer to the original poster weixin_54229534 response:
where did the problem



See the sticky post code, learn to should connect statement was wrong.

Should (url, user, password)

Try the following to see
 
Conn=DriverManager. GetConnection (" JDBC: mysql://localhost: 3306/DB? ServerTimezone=Asia/Shanghai ", "root", "blue");

CodePudding user response:

Try the registration database Driver's code to the Class. The class.forname (". Com. Mysql. JDBC Driver ");
If not analysis according to the following steps:
Whether the database for the MySQL database;
Installing a database if the default listener port is 3306;
Whether to start the MySQL process;
Whether to import the jar package;
Database the destination address is correct, to link the existence of the database and the user name and password is correct;
If all is correct, can consider to restart the system,

CodePudding user response:

Connection error, connect the former catch, SqlExection with Throwable can see errors,
  • Related