original works, from "Deep Blue Blog" blog, dark blue blog:http://blog.csdn.net/huangyanlong/article/ details/47043975
Example of configuring JDBC under Tomcat
When using Tomcat to manually configure JDBC, the Jdbc.properties file is typically found in the app name \web-inf\classes folder in the WebApps below.
Then configure JDBC According to the sample, here is an example: A Java program uses three users to access the user data of the system, the configuration file is as follows:
Jdbc.driverclassname=oracle.jdbc.driver.oracledriver
jdbc.url=jdbc:oracle:thin:@ (DESCRIPTION = (Address_list = (load_balance = yes) (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.56.60) (port = 1521)) (ADDRESS = (PROTOCOL = TCP) (HOST =192.168.56.61) (port = 1521))) (Connect_data = (failover_mode = (TYPE = Select) (METHOD = Basic)) (service_name = hyldb)))
# #jdbc. url=jdbc\:oracle\:thin\: @localhost \:1521\:ORCL
Jdbc.username=hyl_old_user
Jdbc.password=hyl_old_1
Hylnowdb.driverclassname=oracle.jdbc.driver.oracledriver
hylnowdb.url=jdbc:oracle:thin:@ (DESCRIPTION = (Address_list = (load_balance = yes) (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.56.60) (port = 1521)) (ADDRESS = (PROTOCOL = TCP) (HOST =192.168.56.61) (port = 1521))) (Connect_data = (failover_mode = (TYPE = Select) (METHOD = Basic)) (service_name = hyldb)))
Hylnowdb.username=hyl_now_user
Hylnowdb.password=hyl_now_1
Hylnewdb.driverclassname=oracle.jdbc.driver.oracledriver
hylnewdb.url=jdbc:oracle:thin:@ (DESCRIPTION = (Address_list = (load_balance = yes) (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.56.60) (port = 1521)) (ADDRESS = (PROTOCOL = TCP) (HOST =192.168.56.61) (port = 1521))) (Connect_data = (failover_mode = (TYPE = Select) (METHOD = Basic)) (service_name = hyldb)))
Hylnewdb.username=hyl_new_user
Hylnewdb.password=hyl_new_1
Deploycode=23
Title=\u9ed1\u9f99\u6c5f\u5211\u4fa6\u4fe1\u606f\u4e13\u4e1a\u5e94\u7528\u7cfb\u7edf
area=\u9ed1\u9f99\u6c5f
Uploadplace =c:/fileupload/
Uploadurl =c\:/uploadimg/uploadaccountimg/
Briefly explain the meaning of the section:
1. The Jndi of this program is named JDBC, hylnowdb, hylnewdb;
2, JDBC.URL Representative database address;
3, JDBC.USERNAME representative access to the database user name;
4, Jdbc.password representative access to the database user password;
5. Jdbc.url represents this part of the database Address "jdbc:oracle:thin:@ (DESCRIPTION = (Address_list = (load_balance = yes) (address = (PROTOCOL = TCP) (HOST =192.168.56.60) (PORT = 1521)) (ADDRESS = (PROTOCOL = TCP) (HOST =192.168.56.61) (PORT = 1521))) (Connect_data = (Failover_mode = (TYPE = Select) (METHOD = Basic)) (service_name = hyldb)) ", this is the connected RAC cluster database, The configuration method of load balancing fault tolerance is implemented by manually configuring the client;
The Blue Growth Kee series ****************************************************
original works, from the "Blue Blog" blog, Welcome to reprint, please be sure to indicate the source ( Http://blog.csdn.net/huangyanlong ).
The growth of Blue-chase DBA (1): Rushing to the road and into Shandong
Blue Growth Kee-Chase DBA (2): Install! Installation! A long-lost memory that caused me to re-perceive the DBA
The growth of Blue-Chase DBA (3): antique operation, data import and export become a problem
The growth of Blue-Chase DBA (4): Recalling the youth, and then explore Oracle installation (Linux 10g, 11g)
The growth of Blue-Chase DBA (5): No talking about business, annoying application system
The growth of Blue-Chase DBA (6): Work and life: small skills, great people
The growth of Blue-Chase DBA (7): Basic Command, foundation stone
The growth of Blue-chase DBA (8): Regain SP report, recall Oracle's Statspack experiment
The growth of Blue-Chase DBA (9): National Day, chasing DBA, new plan, new departure
The growth of the Blue-Chase DBA (10): flying knives to defend themselves, not expertise: fiddling with middleware WebSphere
The growth of Blue-chase DBA (11): The ease of coming home, the dizzy wake up
The growth of Blue-chase DBA (12): Seven days seven harvested SQL
The growth of blue-chasing DBAs (13): Coordinating hardware vendors, six stories: what you see and feel "servers, storage, switches ..."
The growth of Blue-chase DBA (14): An unforgettable "cloud" side, starting Hadoop deployment
The growth of Blue-Chase DBA (15): Think FTP is very "simple", who chengxiang twists
The growth of Blue-Chase DBA: The DBA also drank and was 捭阖
The growth of blue-chasing DBAs (17): sharing, or spending, learning to grow in the post-IoE era
***************************************************************************************************** *************
Soccer and Oracle Series *************************************************
original works, from the "Blue Blog" blog, Welcome to reprint, please be sure to indicate the source ( Http://blog.csdn.net/huangyanlong ).
Soccer and Oracle Series (1): 32 Way Princes soldiers of, Oracle32 Process Alliance Group A bigger picture of the Brazilian Smon process
Soccer and Oracle Series (2): Brazil opener Preview, Oracle architecture Talk
Soccer and Oracle Series (3): Oracle process ranking, World Cup round is about to be fought!
Soccer with Oracle Series (4): From Brazil fiasco in Germany, think of the difference in RAC topology comparison!
Soccer and Oracle Series (5): Fifa14 game The missing DirectX Library is analogous to the RPM package from Oracle!
Soccer and Oracle Series (6): The Asian Cup with the library--Refueling Chinese team
******************************************************************************************************* ***********
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Tomcat_ Configuring JDBC (small case)