[quote="christian"]Oh, it doesn't work for what you want to do. You can't include stuff in mssql-ds.xml, only in hibernate.cfg.xml, and you can't include one into the other. I don't understand why you want to even do that, the whole point of a datasource is that you configure a datasource name in mssql-ds.xml and then use that name in hibernate.cfg.xml. There is no reason why you would want to put the username and password into hibernate.cfg.xml as well, they are not used if you specify a datasource name.[/quote]
First of all, I immensely thank you for your time and answers:-
Yes, I have the connection-url, username and password defined only in mssql-ds.xml.
part of mssql-ds.xml:-
<datasources>
<local-tx-datasource>
<jndi-name>MSSQLDS</jndi-name>
<connection-url>jdbc:jtds:sqlserver://localhost:1433/eagle_eye</connection-u
rl>
<driver-class>net.sourceforge.jtds.jdbc.Driver</driver-class>
<user-name>user</user-name>
<password>userpass</password>
<close tags properly>
I just want to reference that from hibernate.cfg.xml. So I did this
in hibernate.cfg.xml:-
<session-factory name="java:comp/env/hibernate/SessionFactory">
<property name="connection.datasource">java:MSSQLDS</property>
There is some problem here, since hibernate is NOT able to refer to the datasource as defined above.
Is there any syntax error??
Any help is greatly appreciated.
Thanks
|