我有一个奇怪的问题。我的 java 小程序在我的 IDE (Eclipse) 中工作正常,没有任何错误。当我在浏览器中运行小程序时,它仍然“工作”,但无法连接到我的远程 mysql 数据库。是否有任何原因导致它无法在浏览器中连接到远程 mysql 数据库,而在 Eclipse 中却可以?错误日志放在哪里?有什么好的小程序调试工具吗?
connect = DriverManager.getConnection("jdbc:mysql://178.0.0.0:3306/database","username", >"password" );
最佳答案
您的小程序未签名吗?小程序存在安全限制,阻止它们连接到下载它们的服务器以外的服务器。
http://download.oracle.com/javase/tutorial/deployment/applet/security.html
关于Java 小程序 : JDBC-mysql work in eclipse but not in the browser,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5858836/