About changing the database using JDBC database connection java failure

Recently encountered such a problem when the project version update:

   After the database is to use JDBC to connect the form (that is written in the java class ip dead database connection information, etc.), I change the database needs to address, but I'm changing for the better after the new address and other information summer incremental part in class but it did not take effect, the old library or database connection.

 
    //public static final String url = "jdbc:mysql://133.96.93.100/student";  //旧地址
  public static final String url = "jdbc:mysql://133.96.93.111/student2";  //新地址
public static final String name = "com.mysql.jdbc.Driver"; public static final String user = "root"; public static final String password = "root";

        problem causes:

    While these updates, but other projects cited in this class java class does not update the old information of other classes or references, resulting in changes to the database invalid.

  Solution:

    1. If you want an incremental update, then all references to class java classes to be recompiled and then update deployment.

    2. If you want to update the whole amount, it would be much simpler, the whole project will recompile and deploy them into the constitution.


Published 118 original articles · won praise 59 · views 490 000 +

Guess you like

Origin blog.csdn.net/u012255097/article/details/79721793