答:可(ke)以在Java代码中(zhong)使用java.util.Properties类来配置MySQL连接参数,然后将其(qi)传递给DriverManager.getConnection()方法。