• 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

to test connection..

 
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
for connection with DB i am placing ,ssql-ds.xml in deploy directory...
as below...


now my question is...how i test that connection ???....

thanks....
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Depends on what you mean by testing the connection. Have a look at Configure DataSources which has a section named Common Datasource parameters. However, if you are expecting a functionality similar to WebSphere where you have the admin console having the Test Connection page, then i am afraid that's not available in JBoss.
 
Milan Jagatiya
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Jaikiran,


However, if you are expecting a functionality similar to WebSphere where you have the admin console having the Test Connection page, then i am afraid that's not available in JBoss.



yeah, i am expecting the same..... but dont you think there should be some facility to check whether the DB connection is okey or not....

thanks for your reply,
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

but dont you think there should be some facility to check whether the DB connection is okey or not....



Yes, it would be a good to have feature. But its not available currently.
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can see if it successfully deployed in the console window or the web-console. And you can write a quick unit test that looks up the datasource and gets a Connection. You can also put validation queries in your datasource definition. One for when a new connection gets added to the pool, and one for when a connection is about to be taken out of the pool to be used by a client. Then if it fails you will see the failure in the console window.

Mark
[ April 12, 2007: Message edited by: Mark Spritzler ]
 
Mark Spritzler
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Although I was thinking, except for the two queries you can put in your DataSource configuration, how would or why would you need a "test connection" feature. I mean there is a Connection Pool, so you can't just test one connection in the pool and be 100% sure to say, Ah it is working. So you would have to test every connection in the pool. The only thing that we really need to know is that the DataSource has been deployed successfully. and let the two queries in the configuration handle our validation of connections for us.

So those validation queries should be quick to run queries, like "select 1 from dual" for Oracle.


Mark
 
Milan Jagatiya
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yeah you are right mark...
thanks mark ...its really helps me....
 
reply
    Bookmark Topic Watch Topic
  • New Topic