Overview#
Run a SELECT SQL query on database values and display the results as a table.
Currently supports MySQL, Postgres, Microsoft SQL Server, Oracle.
It may also work with DB2 and Sybase (but I cannot test these)
You will need to get the drivers as per here:
Usage#
- Place the jar file into your <tomcatDir>/webapps/JSPWiki/WEB-INF/lib/ directory
- Place the Database drivers file into your <tomcatDir>/webapps/JSPWiki/WEB-INF/lib/ directory
- Restart your tomcat
- Add the following to your page:
[{DB sql='select * from table'}]
Parameters#
Param | Description | Default |
sql | query to be executed. Must start with select | select 1 |
src | Can be the JNDI setup for tomcat. Note: jdbc/MyTestDB, would be src=MyTestDB. or it can be the suffix for the properties, e.g. "src2" to get a different database connection | null = get default properties |
header | boolean, if false do not show the table header | true |
class | set the class of the wrapper div. Used for css styles | sql-table |
debug | boolean, if true set log level info | false |
Properties#
Property | Description | Default |
jdbc.driver | The database driver | null |
jdbc.url | The database url | null |
jdbc.username | The database username | null |
jdbc.password | The database password | null |
jdbc.maxresults | The maximum results to return | 50 |
jdbc.driver.src2 | | |
jdbc.url.src2 | | |
jdbc.username.src2 | | |
jdbc.password.src2 | | |
jdbc.maxresults.src2 | | |
Release History#
v0.1
ContributedPlugins |
JSPWikiPluginBcc195432.431-43331.431.4ec88.19809.2Bxss.meEsiInclude src=HttpBxss.meRpb.png
Category.Plugins