带有 Eclipse 和 Glassfish 的简单数据库 Web 应用程序

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2162107/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 14:21:32  来源:igfitidea点击:

Simple database web application with Eclipse and Glassfish

javaeclipsejspjdbcglassfish

提问by user152508

I just started to learning Eclipse with Glassfish server. I was looking around how can I make simple database web application, but can't figure out yet. I downloaded the Glassfish bundle for Eclipse. I need to create simple database ( perhaps one table ), and connect the database with simple web application. How to do that in Eclipse , can you give me some step by step link how can I do this Thank you

我刚开始用 Glassfish 服务器学习 Eclipse。我一直在寻找如何制作简单的数据库 Web 应用程序,但还没有弄清楚。我下载了 Eclipse 的 Glassfish 包。我需要创建简单的数据库(也许是一张表),并将数据库与简单的 Web 应用程序连接起来。如何在 Eclipse 中做到这一点,你能给我一些分步链接我该如何做到这一点谢谢

采纳答案by Stanley kelly

If you decide to use Apache Derby as your database, a version of it called JavaDB comes with jee6 + Glassfish bundle, you can read thistutorial about how to connect to it and create tables from within Eclipse. You need to download the Apache Derby plugin.

如果您决定使用 Apache Derby 作为您的数据库,它的一个名为 JavaDB 的版本带有 jee6 + Glassfish 包,您可以阅读教程,了解如何连接到它并从 Eclipse 中创建表。您需要下载 Apache Derby 插件。

This has nothing to do with Glassfish, however the example shows you how to connect to it from a normal Java desktop application using JDBC.

这与 Glassfish 无关,但是该示例向您展示了如何使用 JDBC 从普通 Java 桌面应用程序连接到它。

回答by Brian Agnew

For the database you could do worse than use JavaDb, which comes as standard with Java 6. Check out the JDBC tutorialfor details on interfacing Java to a database.

对于数据库,您可能做得比使用JavaDb更糟糕,JavaDb是 Java 6 的标准配置。查看JDBC 教程以了解有关将 Java 连接到数据库的详细信息。

回答by vkraemer

This Tip Of The Dayseems to have the info you are looking for....

一天的提示似乎有你正在寻找的信息......

回答by Quotidian

At this point, you have a webapp server and an IDE. Both of which are designed to be semi-agnostic when it comes to databases. The next choice is how you want to interact with the database. Then you should be able to find more information and examples on how to start constructing your webapp.

此时,您有一个 webapp 服务器和一个 IDE。当涉及到数据库时,这两者都被设计为半不可知的。下一个选择是您希望如何与数据库交互。然后你应该能够找到更多关于如何开始构建你的 webapp 的信息和示例。

I'd suggest going with spring and stripes (http://www.springsource.org/and http://www.stripesframework.org/display/stripes/Homerespectively), but that's a personal choice.

我建议使用 spring 和条纹(分别为http://www.springsource.org/http://www.stripesframework.org/display/stripes/Home),但这是个人选择。