如何从 XPage 访问 SQL

发布于 2024-12-29 00:01:25 字数 121 浏览 2 评论 0原文

从 SQL 数据源访问数据并将其填充到列表框控件以便用户可以选择其中一个值的过程是什么?

我已获得数据库和服务器的名称、登录 ID 和密码。

代码示例真的很感激,因为我从未做过任何 SQL 编码。

What is the process to access data from a SQL data source and have it fill in a list box control so that the user may select one of the values?

I have been given the name of the database and server, the login ID and password.

Code samples would really be appreciated as I have never done any SQL coding.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

孤凫 2025-01-05 00:01:25

OpenNTF 上的最新扩展库 (extlib.openntf.org) 有一大堆关系数据库扩展。

您需要获取要访问的任何 SQL 服务器的 JDBC 驱动程序,然后查看 ExtLib 演示应用程序,了解如何从应用程序创建 JDBC 连接器。一旦连接器就位,您就可以使用 ExtLib 中的新控件轻松创建视图窗格等。

您还需要 SQL 服务器、用户名和密码之外的更多信息,您需要找出您需要的不同表。您将进行访问,以便您可以从 Xpages 应用程序中引用它们。

The latest Extension Library on OpenNTF ( extlib.openntf.org ) has a whole bunch of Relational Database extensions.

You'll need to get the JDBC drivers for whatever SQL server your going to be accessing and then take a look at the ExtLib demo application on how to create the JDBC connector from your application. Once the connector is in place you can then just the new controls in ExtLib to easily create a view pane etc.

You will also need more then the SQL server, username and password, you'll need to find out the different tables that you'll be accessing so that you can reference them from your Xpages application.

夜吻♂芭芘 2025-01-05 00:01:25

我创建了一个视频,展示从 XPage 进行 JDBC 访问:http://www.youtube.com/watch ?v=p6oRCsTsVqc

I've created a video showing JDBC access from XPages: http://www.youtube.com/watch?v=p6oRCsTsVqc

哽咽笑 2025-01-05 00:01:25

等待即将发布的有关 extlib 的书。我知道杰里米·霍奇写了这一章,所以你也许可以从他那里得到一些信息。

Wait for the book that will e released soon about the extlib. I know Jeremy hodge wrote the chapter so you might be able to get some info from him.

离笑几人歌 2025-01-05 00:01:25

来自答案我之前给出的:您可能想查看宣布 JDBC 支持的博客文章 。它有一个很好的视频解释和幻灯片链接。

另外,请查看Xpages101 第 61 课。它是付费内容,但如果您认真对待 Xpages 开发,那么这是非常值得的。

From an answer I gave earlier: you might want to check out the blog post announcing the JDBC support . It has an excellent video explanation and a link to a slide deck.

Also, take a look at Xpages101 lesson 61. It's paid-for content, but well worth it if you're serious about Xpages development.

昇り龍 2025-01-05 00:01:25

如果您想要将升级包 1 (UP1) 与扩展库 JDBC 部件结合使用,请确保使用与 UP1 版本完全匹配的扩展库。这是扩展库的版本 853-20111215。然后,您可以使用更新站点方法仅部署扩展库的实验部分 (com.ibm.xsp.extlibx.feature_8.5.3.20111215-0914.jar)。

对于较新版本的扩展库,情况可能(将会)发生变化,因此 UP1 和扩展库无法一起工作。

当UP2发布时,您需要删除扩展库包并部署UP2。那时 UP2 可能包含 JDBC 支持。

If you want to combine Upgrade Pack 1 (UP1) with the Extension Library JDBC parts, then make sure to use the Extension Library that matches exactly the UP1 version. This is version 853-20111215 of the Extension Library. Then you can use the update site method to only deploy the experimental parts of the Extension Library (com.ibm.xsp.extlibx.feature_8.5.3.20111215-0914.jar).

For newer releases of Extension Library things might (will) have changed so that UP1 and Extension Library can not work together.

When UP2 is released, you need to remove the Extension Library package and deploy UP2. At that point in time UP2 might contain the JDBC support.

我喜欢麦丽素 2025-01-05 00:01:25

罗伊,
正如之前的发帖人所说,ext 库的东西会使其更加“拖放”,但是您可以使用常规 JDBC 连接来获取您想要的数据,它非常简单,但比使用 Domino 作为后端需要更多代码。您可能想看看约翰·麦基(John Mackey)关于做类似事情的博客文章...http://www.jmackey.net/groupwareinc/johnblog/johnblog.nsf/d6plinks/GROC-7G9GT4

Roy,
As the previous posters put the ext library stuff will make it a little more "Drag and Drop", but you can use regular JDBC connection to get the data you want, Its pretty simple, but a lot more code than using Domino as a backend. You might want to look at this John Mackey blog post about doing a very similar thing...http://www.jmackey.net/groupwareinc/johnblog/johnblog.nsf/d6plinks/GROC-7G9GT4

嘿哥们儿 2025-01-05 00:01:25

请记住,您需要实际的分机。为此的图书馆。升级包不包含 JDBC 内容。

编辑:
请记住,如果您不需要“实时”数据访问,并且您想要的信息相当静态,那么您始终可以使用 LotusScript 代理将数据拉入 Notes 文档。每天运行一次或其他什么。不需要花哨的 XPage 东西。这是相当常见的编码和实践,并提供了示例。

然后只需从您记下的文档中拉出列表框即可。

Keep in mind that you need the actual ext. library for this. The upgrade pack does not contain the JDBC stuff.

Edit:
Keep in mind that if you don't need "LIVE" data access, and the information you want is fairly static you could always just use a lotusscript agent to pull the data down into Notes Documents. Run that once a day or whatever. No fancy XPages stuff needed. That's fairly common coding and practices with examples available.

Then just have the list box pull from the documents you brought down.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文