尝试弄清楚如何将 EasyPHP (MySQL) 与 Java EE 6 结合使用
我正在尝试弄清楚如何将 MySQL 与 Java EE 6 结合使用。我想在我的计算机上本地使用它,这样我可以获得一些经验。可以这样做吗?我见过这个MySQL Connector,我希望它是就像一个类或其他东西,但它远不止于此,我不确定如何实现它。任何人都可以提供有关从哪里开始的建议吗?我确实发现一篇文章没有我希望的那么详细,但无论如何它都是 2004 年的,所以它不再相关了。
I'm trying to figure out how to use MySQL with Java EE 6. I'd like to work with it locally on my machine so I can get some experience. Is it possible to do this? I've seen this MySQL Connector and I expected it to be like a class or something, but it's a lot more than that and I'm not sure about how to implement it. Can anyone offer any advice on where to get started? I did find one article that wasn't as detailed as I'd hoped, but it was from 2004 anyways, so it's no longer relevant.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
官方 Java 文档中的 JDBC 数据库访问 描述了如何访问数据库来自爪哇。 JDBC 基础入门页面 表示该教程已经过测试与MySQL。
您需要安装 MySQL JDBC 驱动程序(我想这就是您上面链接到的驱动程序)并将其放在您的类路径中,以便数据库连接正常工作。但除了将其放在类路径中之外,您不需要与代码中任何特定于 MySQL 的类进行交互。
The JDBC Database Access trail in the official Java documentation describes how you access databases from Java. The JDBC Basics Getting Started page says that the tutorial has been tested with MySQL.
You will need to install the MySQL JDBC driver (I presume that's what you've linked to above) and have it on your classpath in order for the database connection to work. But other than having it on your classpath, you shouldn't need to interact with any MySQL-specific classes from your code.
那么基本上您是使用 EasyPHP 在 Windows 上建立 MySQL 实例吗?看起来有点矫枉过正,但无论如何,您可以执行以下操作:
现在就可以设置服务器环境了。您可以在您最喜欢的 IDE 中发挥 JEE6 的全部优点,并将代码部署到您的 Jboss 服务器,或者您可以跳过所有这些,并使用 NetBeans 中的内置功能。 netbeans.org/kb/docs/javaee/ecommerce/intro.html" rel="nofollow">此处。
So basically you are using EasyPHP to stand up a MySQL instance on Windows? Seems like a little bit of overkill but in any case here is what you can do:
Thats it for setting up a server environment. Now you can do all your JEE6 goodness in your favorite IDE and deploy the code to your Jboss server. Or you can skip all that and use the baked in goodies in NetBeans. A good tutorial can be followed here.