简体   繁体   English

用于基于 Web 的数据库表访问的简单 Java 框架/工具?

[英]Simple Java framework/tool for web-based DB table access?

I'm looking for a web-based Java tool (preferably one that will run in both Weblogic and JBoss) that will allow controlled access to a particular database.我正在寻找一种基于 Web 的 Java 工具(最好是在 Weblogic 和 JBoss 中运行的工具),它允许对特定数据库进行受控访问。 I need to allow non-technical users to insert, update, and delete rows in a particular Oracle DB table.我需要允许非技术用户在特定的 Oracle 数据库表中插入、更新和删除行。 The rows will be of varying data type (some dates, some numbers).这些行将具有不同的数据类型(一些日期,一些数字)。 Ability to add dropdowns with specific values would be nice.能够添加具有特定值的下拉列表会很好。

Also nice, but not necessary (since we can always use a reverse proxy) would be the ability to control read/write access using LDAP/AD groups.也不错,但不是必需的(因为我们总是可以使用反向代理)将能够使用 LDAP/AD 组控制读/写访问。

Another developer on my team suggested Spring/Roo, but that may be too heavyweight for what we're looking to do.我团队中的另一位开发人员建议使用 Spring/Roo,但这对于我们想要做的事情来说可能太重了。 There's got to be something simpler out there... Oracle Apex is another option, if we get desperate.那里一定有更简单的东西...... Oracle 如果我们绝望的话,Apex 是另一种选择。

Grails is a great cheap way to build a CRUD app like you're describing, and it integrates cleanly with Java applications. Grails 是构建您所描述的 CRUD 应用程序的一种非常便宜的方法,它与 Java 应用程序完美集成。 You can probably build your first prototype app in an hour or two to get a feel for it.您可能可以在一两个小时内构建您的第一个原型应用程序来感受它。 Here's a decent starter tutorial: https://www.ibm.com/developerworks/java/library/j-grails01158/这是一个不错的入门教程: https://www.ibm.com/developerworks/java/library/j-grails01158/

Spring Roo is absolutely not an overkill for this task in my opinion.在我看来,Spring Roo 对于这项任务绝对不是矫枉过正。 It actually supports database reverse engineering, so you can explicitly specify which tables you want to have a CRUD view for.它实际上支持数据库逆向工程,因此您可以明确指定您希望哪些表具有 CRUD 视图。

You will need a really simple script, something like this:您将需要一个非常简单的脚本,如下所示:

project --topLevelPackage org.whatever --projectName crud --java 6
persistence setup --provider HIBERNATE --database ORACLE

--> you will need to acquire ojdbc*.jar because it's not available from Maven --> 你需要获取ojdbc*.jar因为它不能从 Maven 获得

--> also you will need to adjust database.properties to suit your needs --> 您还需要调整database.properties以满足您的需要

database reverse engineer --schema my --includeTables "Table1 .." --package ~.domain 
controller all --package ~.web
logging setup --level DEBUG --> OPTIONAL
security setup --> OPTIONAL
exit

That's it, you can run your application.就是这样,您可以运行您的应用程序。

Just write a simple web application with a few JSP files if that is all that you need to do.只需编写一个简单的 web 应用程序和几个 JSP 文件,如果这就是您需要做的全部。 You can package them into a WAR file and deploy them easily to either JBoss or Weblogic.您可以将它们 package 放入 WAR 文件中,然后轻松地将它们部署到 JBoss 或 Weblogic。

What you want is a java-based Web Framework that gives you automatic Create/Retrieve/Update/Delete (CRUD) screens.您想要的是一个基于 java 的 Web 框架,它为您提供自动创建/检索/更新/删除 (CRUD) 屏幕。 There are a huge number of frameworks available, each with different strengths and weaknesses.有大量可用的框架,每个都有不同的优点和缺点。 You don't give enough information to make a reasonable suggestion of which would be best, so I would recommend that you play around with different frameworks until you find the one best suited to your needs.您没有提供足够的信息来给出一个最佳的合理建议,因此我建议您尝试使用不同的框架,直到找到最适合您需求的框架。

Spring Roo is one way to try out different frameworks, but I find that it has a lot of typing overhead to build the model you want. Spring Roo 是尝试不同框架的一种方法,但我发现构建您想要的 model 需要大量输入开销。 If you recorded a script you could perhaps replay it with different frameworks selected for generation, but that may be too complicated.如果您录制了一个脚本,您也许可以使用为生成选择的不同框架来重放它,但这可能太复杂了。

I would recommend you check out AppFuse, which is a meta-framework that allows you to play with different frameworks easily.我建议您查看 AppFuse,这是一个元框架,可让您轻松使用不同的框架。 See AppFuse QuickStart for information on getting started.有关入门的信息,请参阅AppFuse 快速入门

As for controlling access to the tables using LDAP, there are many possibilities available.至于使用 LDAP 控制对表的访问,有很多可能性。 Java provides direct control as shown here . Java 提供直接控制,如此处所示 Another option that many use is Spring Security .许多人使用的另一个选项是Spring Security

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM