• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

EasyMocking for Database.

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 22784
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Kmanoj Kumar wrote:Could any one of you please provide me the java code for this.


No, we are NotACodeMill.
 
reply
    Bookmark Topic Watch Topic
  • New Topic