jpkrohling wrote:
What happens if you try to connect via direct JDBC, with the same URL? Does it uses the "default" database, or the one you specified in the URL?
I had the same doubt and therefore wrote a little jdbc test application to verify the behaviour. The test shows that if one omits the database name the connection is effectively established with the default database, but if the database name is provided, the connection is established with the desired database. That is why I suspect that Hibernate drops the database name from the uri...
jpkrohling wrote:
How does the URL looks like? Are you specifying the connection parameters as hibernate properties, or via a JBoss managed DataSource?
The connection details are spedified in Jboss DataSource as following:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE datasources
PUBLIC "-//JBoss//DTD JBOSS JCA Config 1.5//EN"
"http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd">
<datasources>
<local-tx-datasource>
<jndi-name>GestioneEdiliziaPrivataDatasource</jndi-name>
<connection-url>jdbc:sqlserver://srv002\DT_GestioneEdiliziaPrivata_Test:1433</connection-url>
<driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
<user-name>dt_ep</user-name>
<password>dt_ep</password>
</local-tx-datasource>
</datasources>
Unfortunately, on the SQLServer the
dt_ep user defaults to a different database, with which the connection is established...
Thanks in advance, Enrico