Spring getconnectionproperties method: get database connection properties
•
Java
getConnectionProperties()
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); Properties props = dmd.getConnectionProperties(); if(props!=null){ props.list(System.out); } }
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
二维码