Add MSSQL/MySQL data sources to blazeds4

Source: Internet
Author: User

First download mssql driver: http://sourceforge.net/projects/jtds/files/

Unzip the downloaded file, copy the jtds-1.2.5.jar to Tomcat/lib.

Add a bean to the spring/infrastructure-config configuration file:

<Bean id = "datasource" class = "org. springframework. JDBC. datasource. drivermanagerdatasource">
<Property name = "driverclassname" value = "net. SourceForge. jtds. JDBC. Driver"/>
<Property name = "url" value = "JDBC: jtds: sqlserver: // 192.168.1.100: 1433/test"/>
<Property name = "username" value = "sa"/>
<Property name = "password" value = "admin123456"/>
</Bean>

Other data sources are similar:

Spring MySQL (MySQL driver download: http://dev.mysql.com/downloads/connector/j)

<Bean id = "maid" class = "org. springframework. JDBC. datasource. drivermanagerdatasource">
<Property name = "driverclassname" value = "com. MySQL. JDBC. Driver"/>
<Property name = "url" value = "JDBC: mysql: // 192.168.1.100: 3306/test"/>
<Property name = "username" value = "root"/>
<Property name = "password" value = "admin123456"/>
</Bean>

Spring Oracle

<Bean id = "datasource" class = "org. Apache. commons. DBCP. basicdatasource">
<Property name = "driverclassname" value = "oracle. JDBC. Driver. oracledriver"/>
<Property name = "url" value = "JDBC: oracle: thin: @ 192.168.1.100: 1521: Test"/>
<Property name = "username" value = "sa"/>
<Property name = "password" value = "admin123456"/>
</Bean>

In the official demo of blazeds4, the database is hypersql, and the data source configuration is as follows:

<JDBC: Embedded-Database ID = "datasource" type = "hsql"/>

For information about hsql, see its official website: http://hsqldb.org/

 

In the demo of the spring-flex-testdrive-1.0.3-v1, hsql is replaced with H2.

<JDBC: Embedded-Database ID = "datasource" type = "h2"/>

For information on H2 database can see its official website: http://www.h2database.com

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.