Easy access to various types of databases, database. xml file configuration methods, database. xml

Source: Internet
Author: User
Tags webeasy

Easy access to various types of databases, database. xml file configuration methods, database. xml

The light-Open Platform theoretically supports all databases that can be accessed through JDBC or ODBCSuch:

MySQL

SQL Server MS

Oracle

SyBase

DB2

Infomix

Teradata

...

And MPP architecture Vertica


You can access the above database simply by configuring the configuration file database. xml. The usage and configuration method are as follows:

ESql Tag:

<Esql module = module name [id = schoolbag name] [act = edit | exe | batch | refresh] [p] [commit = true | false | end]> SQL statement </ esql>

Module:The name of the module connecting to the database. required. In the WebEasy system directory (such as D:/webeasy), you can create multiple subdirectories, such as help/base.Database. xmlThe subdirectory is identified by the system as an available database connection module. To access the database, the system first needs to determine how to establish a persistent relationship with the database based on the module. The database. xml file stores the connection configuration information.

Configuration File Format and Parameters

<? Xml version = "1.0" encoding = "GB2312"?> <DatabaseDbUrl = "database connection address" [DriverName = "jdbc driver package corresponding to the current database type"] [Name = "Database Name"] [UserName = "Database User Name"] [password = "Password"] [Unicode = "data content encoding in connection"] [max = "Maximum number of connections in the pool"] [min = "least connections"] [age = "Maximum number of connections life Cycle "] [timesUsed =" Maximum number of connections available "] [frequency =" connection pool refresh cycle "] [pause =" suspend connection when the database fails to be connected several times "] [trace = "output connection pool log"] [More = "More parameters"] [weName = "data module display name"] [taskFrequency = "not enabled"]> </Database>

Version: Xml version. The default value is 1.0.

Encoding: Xml character set. The default value is GB2312.

DbUrl: Database access address, required. It can be a basic connection (Protocol: IP or host name: port), or a complete connection (basic connection + database name, user name, password, and other parameters)

DriverName: The name of the jdbc driver package corresponding to the current database type. Optional. In windows, ODBC is not used. When JDBC is used, copy the jar driver package to the project's WEB-INF/lib directory.

Name: Database name. Optional. IfDbUrlThis option is optional when it is included in

UserName: User Name. Optional. IfDbUrlThis option is optional when it is included in

Password: Password. Optional. IfDbUrlThis option is optional when it is included in

Unicode: Data content encoding in the connection. Optional. A small number of databases need to identify the character set of data storage (such as MySQL). In addition, this parameter is not required if DbUrl is already included.

Max: Maximum number of connections in the connection pool. Optional. If it is null, the default value is automatically enabled.

Min: The minimum number of connections in the connection pool. Optional. If it is null, the default value is automatically enabled.

Age: The maximum life cycle of each connection (available time, in seconds). Optional. If it is null, the default value is automatically enabled.

TimesUsed: Maximum number of times each connection can be used. Optional. If it is null, the default value is automatically enabled.

Frequency: Refresh cycle of the connection pool, in seconds. Optional. If it is null, the default value is automatically enabled.

Pause: When the database cannot be connected for several times, the connection is paused to save resources. Optional. If it is null, the default value is automatically enabled.

Trace: Whether to output connection pool logsTrueIs output,FalseNo output. The default value isFalse, Optional. If it is null, the default value is automatically enabled.

More: More parameter items, such as the MPP architecture data platform such as vertica, have more performance-related configuration items. If not, leave it empty.

WeName: Data module display name

TaskFrequency: Background task cycle, not enabled yet

Download Easy Do IT resources

Development Instance:Enterprise entry-level B2C e-commerce websites (including light source code), Free download: http://download.csdn.net/detail/tx18/8818883

The light-Open Platform (Technical QQ group: 460801944) will occasionally upgrade to provide more powerful and Easy functions for everyone. Please noteDownload the latest version

This article can be freely spread


Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.