# Proposal to add a link to the documentation of the Execute SQL snippet

**URL:** <https://forum.xwiki.org/t/proposal-to-add-a-link-to-the-documentation-of-the-execute-sql-snippet/13696>\
**Category:** Help / Discuss\
**Tags:** database, sql, integration\
**Created:** [December 16, 2023, 8:01pm UTC](https://forum.xwiki.org/t/proposal-to-add-a-link-to-the-documentation-of-the-execute-sql-snippet/13696 "2023-12-16T20:01:31Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ricardo\_Rodriguez](https://forum.xwiki.org/user_avatar/forum.xwiki.org/ricardo_rodriguez/32/3454_2.png) [@Ricardo\_Rodriguez](https://forum.xwiki.org/u/Ricardo_Rodriguez)\
**Post date:** [December 16, 2023, 8:01pm UTC](https://forum.xwiki.org/t/proposal-to-add-a-link-to-the-documentation-of-the-execute-sql-snippet/13696/1 "2023-12-16T20:01:31Z")

</div>

Hi! I would like to add a link to the section [Using a Component to Connect](https://snippets.xwiki.org/xwiki/bin/view/Extension/Execute%20SQL#HUsingaComponenttoConnect) to connect to [Create a component using Groovy](https://snippets.xwiki.org/xwiki/bin/view/Extension/Create%20a%20component%20using%20Groovy).

It is being not easy to me to connect all the pieces involved/available to access data in remote databases from XWiki.

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [December 18, 2023, 2:29pm UTC](https://forum.xwiki.org/t/proposal-to-add-a-link-to-the-documentation-of-the-execute-sql-snippet/13696/2 "2023-12-18T14:29:43Z")

</div>

Hi, If you want to add a link to components, I think it would make more sense to link to [https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/Tutorials/WritingComponents/](https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/Tutorials/WritingComponents/) or [https://extensions.xwiki.org/xwiki/bin/view/Extension/Component%20Module](https://extensions.xwiki.org/xwiki/bin/view/Extension/Component%20Module)

And if you want to add a link to scripting in Groovy, then the link would be [https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/Scripting/](https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/Scripting/)

---

<div class="post-metadata">

**Author:** ![Ricardo\_Rodriguez](https://forum.xwiki.org/user_avatar/forum.xwiki.org/ricardo_rodriguez/32/3454_2.png) [@Ricardo\_Rodriguez](https://forum.xwiki.org/u/Ricardo_Rodriguez)\
**Post date:** [December 18, 2023, 3:43pm UTC](https://forum.xwiki.org/t/proposal-to-add-a-link-to-the-documentation-of-the-execute-sql-snippet/13696/3 "2023-12-18T15:43:18Z")

</div>

Thanks, Vincent. All your proposals seem reasonable to me. But I would also add a link to [Create a component using Groovy](https://snippets.xwiki.org/xwiki/bin/view/Extension/Create%20a%20component%20using%20Groovy) to the words **separate Groovy page** :

 ![image](https://forum.xwiki.org/uploads/default/original/2X/d/d0ceb439d6931ac64715161d52134afcd4848ba0.png)

Don’t you think it can be useful to show with an example how to create components using XWiki pages and Groovy?

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [December 18, 2023, 3:50pm UTC](https://forum.xwiki.org/t/proposal-to-add-a-link-to-the-documentation-of-the-execute-sql-snippet/13696/4 "2023-12-18T15:50:27Z")

</div>

> [@Ricardo\_Rodriguez](#):
>
> Don’t you think it can be useful to show with an example how to create components using XWiki pages and Groovy?

A separate groovy page is not a component 🙂 It’s just a scripting page, hence the proposed link to [https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/Scripting/](https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/Scripting/) to understand how to write a groovy script in a wiki page.

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [December 18, 2023, 3:53pm UTC](https://forum.xwiki.org/t/proposal-to-add-a-link-to-the-documentation-of-the-execute-sql-snippet/13696/5 "2023-12-18T15:53:42Z")

</div>

I understand now. If you write a groovy snippet then you don’t need a component, but if you want one, then the recommendation is to use wiki components. Basically I don’t feel it’s a good idea to point to something that is not official. But YMMV and any link is good so feel free to do what you think is best! I guess you’re better to judge it than I am (as a user).

---

<div class="post-metadata">

**Author:** ![Ricardo\_Rodriguez](https://forum.xwiki.org/user_avatar/forum.xwiki.org/ricardo_rodriguez/32/3454_2.png) [@Ricardo\_Rodriguez](https://forum.xwiki.org/u/Ricardo_Rodriguez)\
**Post date:** [December 18, 2023, 3:56pm UTC](https://forum.xwiki.org/t/proposal-to-add-a-link-to-the-documentation-of-the-execute-sql-snippet/13696/6 "2023-12-18T15:56:54Z")

</div>

This is one of the dangers of wanting to become a wizard’s apprentice! ☹ Thanks for your patience!

But, then, I don’t understand the sentence “You can hide some of the access details within a **component** , _either_ of an external JAR _or_ as a separate Groovy page”

All I’m trying to do so far is to hide the details of the connection to a remote database.

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [December 18, 2023, 4:06pm UTC](https://forum.xwiki.org/t/proposal-to-add-a-link-to-the-documentation-of-the-execute-sql-snippet/13696/7 "2023-12-18T16:06:08Z")

</div>

> [@Ricardo\_Rodriguez](#):
>
> All I’m trying to do so far is to hide the details of the connection to a remote database.

ok, then you can indeed hide it in a component. If you don’t want to write java then you can register a script service using a wiki component. See [https://extensions.xwiki.org/xwiki/bin/view/Extension/WikiComponent%20Module](https://extensions.xwiki.org/xwiki/bin/view/Extension/WikiComponent%20Module)

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [December 18, 2023, 4:07pm UTC](https://forum.xwiki.org/t/proposal-to-add-a-link-to-the-documentation-of-the-execute-sql-snippet/13696/8 "2023-12-18T16:07:40Z")

</div>

Actually you could also use [https://extensions.xwiki.org/xwiki/bin/view/Extension/Script%20Component/](https://extensions.xwiki.org/xwiki/bin/view/Extension/Script%20Component/) (I’ve never used it myself). It requires to install an Extension though.

---

<div class="post-metadata">

**Author:** ![tmortagne](https://forum.xwiki.org/user_avatar/forum.xwiki.org/tmortagne/32/4930_2.png) [@tmortagne](https://forum.xwiki.org/u/tmortagne)\
**Post date:** [December 18, 2023, 4:14pm UTC](https://forum.xwiki.org/t/proposal-to-add-a-link-to-the-documentation-of-the-execute-sql-snippet/13696/9 "2023-12-18T16:14:44Z")

</div>

> [@vmassol](#):
>
> Actually you could also use [Script Component (XWiki.org)](https://extensions.xwiki.org/xwiki/bin/view/Extension/Script%20Component/)

I would recommend that, yes (much easier and faster than wiki components).

I guess we could merge it to XWiki Standard but since it not really something we would use in XWiki Standard itself (we would always implement the component in Java in such a case IMO) it made sense to keep it as an extension.

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [December 18, 2023, 4:16pm UTC](https://forum.xwiki.org/t/proposal-to-add-a-link-to-the-documentation-of-the-execute-sql-snippet/13696/10 "2023-12-18T16:16:25Z")

</div>

> [@tmortagne](#):
>
> it made sense to keep it as an extension.

+1

---

<div class="post-metadata">

**Author:** ![Ricardo\_Rodriguez](https://forum.xwiki.org/user_avatar/forum.xwiki.org/ricardo_rodriguez/32/3454_2.png) [@Ricardo\_Rodriguez](https://forum.xwiki.org/u/Ricardo_Rodriguez)\
**Post date:** [December 18, 2023, 4:54pm UTC](https://forum.xwiki.org/t/proposal-to-add-a-link-to-the-documentation-of-the-execute-sql-snippet/13696/11 "2023-12-18T16:54:28Z")

</div>

> [@vmassol](#):
>
> something that is not official

Good point! Thus, how could I separate official from non-official documents/statements

> [@vmassol](#):
>
> feel free to do what

I tried! But I was not able to enter the editor! Perhaps I did something wrong. Should I be able to edit the documentation of a snippet with my user account @XWiki?

---

<div class="post-metadata">

**Author:** ![Ricardo\_Rodriguez](https://forum.xwiki.org/user_avatar/forum.xwiki.org/ricardo_rodriguez/32/3454_2.png) [@Ricardo\_Rodriguez](https://forum.xwiki.org/u/Ricardo_Rodriguez)\
**Post date:** [December 18, 2023, 6:48pm UTC](https://forum.xwiki.org/t/proposal-to-add-a-link-to-the-documentation-of-the-execute-sql-snippet/13696/12 "2023-12-18T18:48:33Z")

</div>

Done! [Script Component test](https://portal.igfae.usc.es/xwiki/bin/view/Scripting/Script%20Component%20test#)

@tmortagne My take: add a paragraph similar to this:

![image](https://forum.xwiki.org/uploads/default/original/2X/e/e2bfc7a23e534f2703650ebb8b88eec1b04134b5.png)

to the documentation of the [Script Component](https://extensions.xwiki.org/xwiki/bin/view/Extension/Script%20Component/) extension. Just at the end of the [Description](https://extensions.xwiki.org/xwiki/bin/view/Extension/Script%20Component/#HDescription)

---

<div class="post-metadata">

**Author:** ![tmortagne](https://forum.xwiki.org/user_avatar/forum.xwiki.org/tmortagne/32/4930_2.png) [@tmortagne](https://forum.xwiki.org/u/tmortagne)\
**Post date:** [December 19, 2023, 8:18am UTC](https://forum.xwiki.org/t/proposal-to-add-a-link-to-the-documentation-of-the-execute-sql-snippet/13696/13 "2023-12-19T08:18:29Z")

</div>

There are such examples in the linked script service reference documentation but yes it does not harm to complete the example, so I added a usage example matching the suggested script service.

---

<div class="post-metadata">

**Author:** ![Ricardo\_Rodriguez](https://forum.xwiki.org/user_avatar/forum.xwiki.org/ricardo_rodriguez/32/3454_2.png) [@Ricardo\_Rodriguez](https://forum.xwiki.org/u/Ricardo_Rodriguez)\
**Post date:** [December 19, 2023, 4:36pm UTC](https://forum.xwiki.org/t/proposal-to-add-a-link-to-the-documentation-of-the-execute-sql-snippet/13696/14 "2023-12-19T16:36:46Z")

</div>

Thanks, Thomas. Some simple examples close to the description will help _ordinary users_ like me understand the power of many XWiki features better and be encouraged to go deeper into the documentation to solve more challenging objectives.

I am not sure yet why I regularly get confused by the structure of some documents. For instance, by putting the use cases within the **Description**? Won’t they deserve a heading at the same level of **Description**? Also, I would move **Prerequisites and installation** just after **Description**. First, the **Description** provides us with an explanation of the use of the extension, snippet or application. Then, we will check if our installation satisfies the prerequisites and, eventually, we will install it. Finally, we confirmed it’s working with a very simple use case. Later, more documentation will bring us into more complex applications and the whole universe of XWiki possibilities!

Just my two cents!

---

<div class="post-metadata">

**Author:** ![Ricardo\_Rodriguez](https://forum.xwiki.org/user_avatar/forum.xwiki.org/ricardo_rodriguez/32/3454_2.png) [@Ricardo\_Rodriguez](https://forum.xwiki.org/u/Ricardo_Rodriguez)\
**Post date:** [December 21, 2023, 6:22am UTC](https://forum.xwiki.org/t/proposal-to-add-a-link-to-the-documentation-of-the-execute-sql-snippet/13696/15 "2023-12-21T06:22:35Z")

</div>

> [@Ricardo\_Rodriguez](#):
>
> how could I separate official

Confirm, please: [Recommended Extensions](https://extensions.xwiki.org/xwiki/bin/view/ExtensionCode/RecommendedExtensions/) + [Sponsored Extensions](https://store.xwiki.com/xwiki/bin/view/Main/WebHome) = Official Extensions?

Thanks!

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [December 21, 2023, 9:53am UTC](https://forum.xwiki.org/t/proposal-to-add-a-link-to-the-documentation-of-the-execute-sql-snippet/13696/16 "2023-12-21T09:53:19Z")

</div>

> [@Ricardo\_Rodriguez](#):
>
> Confirm, please: [Recommended Extensions](https://extensions.xwiki.org/xwiki/bin/view/ExtensionCode/RecommendedExtensions/) + [Sponsored Extensions](https://store.xwiki.com/xwiki/bin/view/Main/WebHome) = Official Extensions?

There’s no concept of official extensions 🙂

The only concept that exists is Recommended extensions, with a definition here: [https://extensions.xwiki.org/xwiki/bin/view/ExtensionCode/RecommendedExtensions/RecommendedDefinition/](https://extensions.xwiki.org/xwiki/bin/view/ExtensionCode/RecommendedExtensions/RecommendedDefinition/)

Thanks
