I want to connect OpenXava with SQL Server 2019 (15.0.2104), however, enabling that option in context and persistence gives me an error. When I run the program it does give me the address to the page and I can write information, however, when I click on the "record" button I get the error:
It has been impossible to execute the Record action: [PersistenceUnit: default ] Unable to build Hibernate SessionFactory
Do you know how to fix it?
I enable the TCP IP option from the SQL Server configuration And I create the database and the user with its login.
Here is the project: https://github.com/solee2222/CLINIC.git (Clone it with git)
I have this in my persistence.xml file:
<properties>
<property name="hibernate.connection.driver_class" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
<property name="hibernate.connection.username" value="user"/>
<property name="hibernate.connection.password" value="123"/>
<property name="hibernate.connection.url" value="jdbc:sqlserver://localhost:1433;databaseName=facturaciondb;encrypt=true;trustServerCertificate=true;"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.show_sql" value="true"/>
</properties>
This in my context.xml file
<!-- Microsoft SQL Server -->
<Resource name="jdbc/facturacionDS" auth="Container" type="javax.sql.DataSource"
maxTotal="20" maxIdle="5" maxWaitMillis="10000"
username="user" password="123"
driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
And finally this in my pom.xml file
<!-- Microsoft SQL Server -->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>12.4.1.jre11</version>
</dependency>