In fact, the rewritten JDBC Data-source is run in the servlet, looking for a data source through Jndi. I use the Orion trial, the site of the "Java/jsp Learning series of six (MySQL page example)," a simple rewrite.
Second, the configuration
(1) Jdbc
Need to use JDBC driver copy to [Orion]/lib directory
(2) Data-source
Add the following in the [Orion]/config/data-sources.xml file:
〈data-source
Class= "Com.evermind.sql.DriverManagerDataSource"
Name= "Mysqldbpage"
location= "Jdbc/hypersoniccoreds"
xa-location= "Jdbc/xa/hypersonicxads"
ejb-location= "Jdbc/mysqldbpage"
Connection-driver= "Org.gjt.mm.mysql.Driver"
Username= "Root"
Password= ""
Url= "Jdbc:mysql://localhost/test"
inactivity-timeout= "30"
/〉
It is to be noted that:
(1) ejb-location This "Jdbc/mysqldbpage" is the Jndi to look for.
(2) Connection-driver for JDBC Database driver
(3) URL is a URL in jdbc
(4) Username for database user name
(5) Password for user password
(6) Inactivity-timeout for database connection timeout, default is 30 seconds
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.