带有000webhost的Java mySQL [英] Java mySQL with 000webhost
本文介绍了带有000webhost的Java mySQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在000webhost上创建了一个mySQL数据库,我想将它连接到我的Java程序,但不知何故驱动程序没有接收套接字。这是我的代码:
I created a mySQL database on 000webhost and I wanted to connect it into my Java program but somehow driver aren't receiving sockets. Here is my code:
Class.forName("com.mysql.jdbc.Driver");
Connection conn = DriverManager.getConnection("jdbc:mysql://mysql2.000webhost.com/a4931569_users/Users", username, pass);
其中a4931569_users是数据库,用户是表。请帮助我。
where a4931569_users is database, Users is table. Please help me.
推荐答案
来自000webhost的MySQL不允许您从外部应用程序连接,只能从其中托管的页面内部进行连接域名。
MySQL from 000webhost doesn't allow you to connect from external applications, just from within pages hosted in their domain.
请检查:如何连接到MySQL从我的电脑?
这篇关于带有000webhost的Java mySQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文