在我的 web-inf 文件夹中,我创建了一个名为com.utilClass.java
. 在这个类中,我有一个连接字符串。它在 localhost 中工作,但是当我尝试将其上传到主机时,它给了我如下错误:
连接代码
static public final String driver = "com.mysql.jdbc.Driver";
static public final String connection = "jdbc:mysql://localhost:3307/dilipgodhani?";
static public final String user = "user";
static public final String password = "xxxxx";
Connection con = null;
Class.forName(driver);
con = DriverManager.getConnection(connection, user, password);
Statement st = con.createStatement();
System.out.println(q);
rs = st.executeQuery(q);