📜  java.sql.sqlexception: 用户拒绝访问 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:30.081000             🧑  作者: Mango

代码示例3
As you are creating a database from scratch, you could use:

Connection connection = DriverManager.getConnection("jdbc:mysql://localhost/?user=root&password=rootpassword"); 
PreparedStatement ps = connection.prepareStatement("CREATE DATABASE databasename");
int result = ps.executeUpdate();