好吧,所以,我从使用XAMPP转移到现在通过网络主机托管我的hiscore,我如何编辑这一行,使它与它一起工作,当我运行服务器时,它抛出了一个错误。
public static void createConnection() {
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
con = DriverManager.getConnection(
"jdbc:mysql://fdb4.awardspace.com/", "1191306_hiscores", "passremoved");
stmt = con.createStatement();
Misc.println("Connected");
} catch (Exception e) {
Misc.println("Connection Problem");
}]以前是localhost/hiscore,显然这不再起作用了。
发布于 2012-11-14 08:25:18
没有堆栈跟踪很难,但我注意到您的url中缺少数据库名称,它应该是这样的:
con = DriverManager.getConnection(
"jdbc:mysql://fdb4.awardspace.com/hiscores", "1191306_hiscores", "passremoved");请注意jdbc:mysql://fdb4.awardspace.com/hiscores与jdbc:mysql://fdb4.awardspace.com/的对比
发布于 2013-01-23 04:34:35
Awardspace不允许远程连接到免费帐户上的mysql数据库。
您可以使用http://www.freesqldatabase.com/
但是非常有限,只有5mb。这是我找到的唯一一项提供mysql数据库远程连接的免费服务。
https://stackoverflow.com/questions/13371049
复制相似问题