I connected db2 database from spring boot
and called stored procedures using entity manager. I didnt have any entity classes in my application. I just called stored procedures using Entity Manager reference.
Here application.properties
#DB2 dev database config
spring.datasource.url=jdbc:db2://server_nameXXX
spring.datasource.username=my_username
spring.datasource.password=my_password
And My Dao class is
EntityManager entityManager;
@Autowired
public SalesCloseEstimateDaoImpl(EntityManager entityManager){
this.entityManager = entityManager;
}
-----------------
StoredProcedureQuery procedureQuery = entityManager.createStoredProcedureQuery(StoredProcedureName);
Here I didnt use any entity classes. Now I need to connect one more ms sql server, so how can I connect it. I have searched but all configuration having entity classes usage how can I write this configuration without entity classes?
question from:
https://stackoverflow.com/questions/65881179/configure-two-databases-in-spring-boot-for-entity-manager-without-entity-classes 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…