WebChart database connection configuration

Links: http://www.dbatools.net/mytools/webchart-database-connection.html

    WebChart has it's own connection pool manager. There were several Java Servlet container such as Tomcat and Resin, both of them were very popular, but they have differnet database connection pool implementaion. In order to tranparently running on them, I wrote a dedicate database connection pool manager.

    Since WebChart is just for intranet usage only, don't care too much about the performance, all the database connection configuration information is stored in the following file.

WEB-INF/dbconn.cfg

    It's a pure text file, you can open and edit it with any text editor. It contains the following three sections.

# Datasource name list, separator by vertical line
DBLIST=datasource [|datasource [| datasource… ]]

# connection parameter for each datasource
datasource.DBTYPE={ORACLE|SYBASE|MSSQL|DB2NET|DB2APP|MYSQL|ODBC}
datasource.DBHOST=JDBC DB URL (without the prefix)
datasource.DBUSER=username
datasource.DBPASS=password
datasource.MAXCONNS=Max Connections Limit
datasource.INITCONNS=Min Connections Limit

......

# WebChart Metadata datasource for Authorization
ADMINDB=datasource

    You can specify multiple data source name in the DBLIST line, and specify the data source name for each SQL query in the WebChart defination file (WCML), if you omit the data source name for each SQL, it will connect to the data source named "DEFAULT". If you want to use WebChart intergreted authorization features, you must specify a metadata data source in the "ADMINDB" line, and create some tables holding the users data and sessions data.

    To be attention, there is no connection timeout exception for existing connection pool, you will never open the page if it cannot connect to the database, browser will always show you opening the page.

    The database password is still stored in unencrypted format, but I am planing to improve the security features of WebChart.

Comments (2)

hello,what's the matter with following output exception report? thanks!

com.lfx.db.DatabaseMarkdownException: Database (LOGICAL.DEFAULT) is markdown!
com.lfx.db.DBLogicalManager.getPoolConnection(DBLogicalManager.java:174)
com.lfx.web.WebChart2.generateChart(WebChart2.java:1596)
com.lfx.web.WebChart2Servlet.doGet(WebChart2Servlet.java:548)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


note The full stack trace of the root cause is available in the Apache Tomcat/5.5.26 logs.

and the dbconn.cfg

# WebChart????????
ADMINDB=ORACLE

# ????????
PHYSICAL.DBLIST=ORACLE

# ??????
PHYSICAL.ORACLE.DBTYPE=oracle
PHYSICAL.ORACLE.DBHOST=10.178.130.107:1521:jadb
PHYSICAL.ORACLE.DBUSER=jarpt
PHYSICAL.ORACLE.DBPASS=bing060318
PHYSICAL.ORACLE.MAXCONNS=4
PHYSICAL.ORACLE.INITCONNS=1
PHYSICAL.ORACLE.LOCALE=ENGLISH

LOGICAL.DBLIST=DEFAULT
LOGICAL.DEFAULT=ORACLE

LOGICAL.DEFAULT=FIRST|ORACLE

And the PHYSICAL.ORACLE.DBPASS should be encrypted with sysencrypt.rhtml service.

« Previous | Main | Next »

Powered by
Movable Type 5.01