Replace the default database MySQL with a different database

Source: Internet
Author: User

The default database of Roller is MySQL. In many cases, it is integrated into the existing web system, and the database used in the original web system is not MySQL. Therefore, you have to replace the database when integrating with Roller. Roller's installation manual does not detail how to replace different databases. However, if you are familiar with J2EE, you can see that you can change the database for roroller by modifying the two files. For example, if you want to change roroller to Oracle8i Database, you only need to do this: 1. Modify hibernate. cfg. hibernate database localization parameter in xml: that is, the original <property name = "dialect"> org. hibernate. dialect. change MySQLDialect </property> to <property name = "dialect"> org. hibernate. dialect. oracleDialect </property> 2. Modify Roller. database Configuration in the xml file: the modified Roller. xml is roughly as follows:
<Context path = "/roller" docBase = "D:/mywork/java/Roller" debug = "0">
<Resource name = "jdbc/rollerdb" auth = "Container"
Type = "javax. SQL. DataSource"
DriverClassName = "oracle. jdbc. driver. OracleDriver"
Url = "jdbc: oracle: thin: @ (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.0.3) (PORT = 1521 ))) (CONNECT_DATA = (SERVICE_NAME = rollerdb) (SRVR = DEDICATED )))"
Username = "roller"
Password = "roller123"
MaxActive = "20"
MaxIdle = "3"
RemoveAbandoned = "true"
MaxWait = "3000" type = "codeph" text = "/codeph"/>
<! -- If you want e-mail features, un-comment the section below -->
<! --
<Resource name = "mail/Session" auth = "Container"
Type = "javax. mail. Session"
Mail. smtp. host = "mailhost.example.com"/>
-->
</Context> In fact, the main modification is the driver and url for accessing the database. It may be because of the configuration of the oracle database. The url configuration is not the same as that of other databases. In particular, SRVR = DEDICATED is required in many cases. I still don't understand the specific reason: (if anyone knows this, I hope you can give me more advice !!

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.