Help coderanch get a
new server
by contributing to the fundraiser

Kmanoj Kumar

Greenhorn
+ Follow
since Oct 04, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Kmanoj Kumar

Hi Friends,'


I have a problem with easy mocking concept in java.

I have a senerior, that i need to read one xml file which have primary and secondary connection. For these primary and secondary conenctions i have the connection details in another xml file.
First i need to read one xml file and then i need to moch that connection in the development environment. if the connection fails then i need to swift to the secondary connection.

i have written the statement of e easy mocking but i am unable to do it. can any one help on the code.

1.xml file
----

<CDG>
<enabled>true</enabled>
<failover>true</failover>
<secondaryConnection>CDG_SV</secondaryConnection>
<primaryConnection>CDG_OX</primaryConnection>
<thirdConnection>CDG_AZ</thirdConnection>
<CDG>



2.xml
-----

<connections>
<CDG_OX>
<driver>oracle</driver>
<username>test</username>
<password>test</password>
<url>YYY</url>
</CDG_OX>


<CDG_SV>
<driver>oracle</driver>
<username>test</username>
<password>test</password>
<url>ZZZ</url>
</CDG_SV>

<CDG_AZ>
<driver>oracle</driver>
<username>test</username>
<password>test</password>
<url>ZZZ</url>
</CDG_AZ>

</connections>


Could any one of you please provide me the java code for this.
the URL heere is the connection which i need assume that it connects to the database .

First i read the 1.xml and picks the CDG_OX and checks for the URL YYY (this is masked value..i dont have the actaul URL.) i this connects then well and good , if not i need to switch on to secondary connection CDG_SV and then i need to check for the connection.


Please let me know.

Thanks,
Kumar.
12 years ago
Hi,

I want to find out how many hits the tomcat server is taking per day(count in number) irrespective of the applications deployed on it.
So could you please let me know how to find it.

Thanks you,
Manoj Kumar
13 years ago