Spring GetPassword method: get the password of the database
                                        
                    •
                    Java                                    
                getpassword()
Example
public static void main(String[] args){
  String driver = "com.MysqL.jdbc.Driver";
  String url = "jdbc:MysqL:  //lzw:3306/testDatabase";//创建一个表示数据库路径的字符串
  String username = "root";  //创建一个表示数据库用户名的字符串
  String password = "111";  //创建一个表示数据库密码的字符串
  DriverManagerDataSource dmd = new DriverManagerDataSource(driver,url,username,password);
  String psw = dmd.getpassword();
  System.out.println("访问数据库的密码是:"+psw);
}
                
                            The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
                        
                                            
                        THE END
                    
                    
                    
                                                        二维码
                        
                        
                                                
                        