• 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

How should I configure 2 different datasources for MSSQL Server connection,

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
[B]Hi,
How should I configure 2 different datasources for MSSQL Server connection, in the same standardjbosscmp-jdbc.xml, mssql-ds.xml, login-config.xml and other config files?

I've tried this but it doesn't work...
<defaults>
<datasource>java:/MSSQLDS</datasource>
<datasource>java:/MSSQLDSRep</datasource>
<datasource-mapping>MS SQLSERVER2000</datasource-mapping>
....
and in login-config .xml i maped like this



so hear mssqlds for normal connection and mssqldsRep is for report generation in my app mssqlds is connected to datbase it give results .but from jsp it is not getting the result from database and it throws




so can you tell me what was the problem .
how can i declare two datasource to connect my application and is there any option for connectionpool in jboss if yes? how to declare that. pleace explain me

thanks in advance .
chaitanya
[/B]
[ November 05, 2007: Message edited by: chaitanya kiran pvn ]
 
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
You can configure more than one datasource in a single -ds.xml file. Like this:



That's it. You can then use java:/MyAppDS1 and java:/MyAppDS2 as you wish. For more details have a look at ConfigDataSources

By the way, the exception that you are getting:

javax.servlet.ServletException: Unable to get connection, DataSource invalid: "No suitable driver"



Make sure that the connection URL that you have specified in the -ds.xml file is correct and also the jar file containing driver class is present in the server/< serverName>/lib folder of JBoss.
 
reply
    Bookmark Topic Watch Topic
  • New Topic