• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MySQL: Is database name must in connection URL?

 
P Lavti
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am using mysql with Jboss AS.

Is it required to give the the database name in connection URL?
<connection-url>jdbc:mysql://hostname:port/<I>database-name</I></connection-url>

My application is using 2 databases, to connect to both the databases, do I need to have two JNDI names declared in mysql-ds.xml?

Or is there any way to avoid having two JNDI names declaration and still I can connect to both the databases?

Thanks!
 
Praful Thakare
Ranch Hand
Posts: 642
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why you want to avoid it?

I dont think this is possible unless you have to hardcode it in your code.

-P
 
Scott Selikoff
author
Saloon Keeper
Posts: 4014
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by P Lavti:
Or is there any way to avoid having two JNDI names declaration and still I can connect to both the databases?


No, unless you don't use mysql-ds.xml.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic