Accessing Database table in Page

Hi every one

I have two requirements, can anyone come across the similar kind of requests

  1. I want to connect to external database from Xwiki page using JDBC, Is there any Xwiki can connect to databases like oracle, MySQL, postgres etc…

  2. I have installed xwiki 10.1 with mysql on Ubuntu server and would like build some reporting using external tool OR connect from MySQL workbench for queries on Xwiki database (MySQL) but it is saying connection refused.
    Also I tried telnet on the server itself but it got failed with IP & port but succeeded with localhost & port. looks like port 3306 (MySQL default) is opened on the server but unable to do telnet with IP but can do with local host, how to expose IP to outside of the server, So I can use MySQL workbench for exploring tables in Xwiki DB.

Thanks,
Vinay

There is no API in XWiki to connect to other databases, as far as I know.

But you can try to write a Groovy Macro or the like, as explained in the Scripting Documentation
You will have to do all the connection stuff manually in the macro, however.

For the second problem: this is a mySQL server configuration issue. Likely the configuration files have an entry like bind-address = 127.0.0.1. I think you can use bind-address = 0.0.0.0 instead to be able to connect from other hosts. Better check your firewall settings, however, or the rest of the world will try to connect to your database, too. :wink: