MongoDb via jndi

前端 未结 5 1100
隐瞒了意图╮
隐瞒了意图╮ 2020-12-09 23:22

Do you know if it is possible to setup mongodb instance in spring like any other db via datasource from jndi?

Thx

5条回答
  •  执念已碎
    2020-12-10 00:16

    To do this, you'll need a JDBC driver impl for MongoDB. I have only found one, and it's referred as "experimental" from the MongoDB page: GitHub JDBC Driver for MongoDB .

    to workaroud this limitation, you could setup some Spring beans and create a MongoDB implementation for your application DAO (this way, you won't need to change the DAO interface and it's client components).

    This articles may help:

    • Plain Simple MongoDB Spring Integration
    • Migrating a Spring/Hibernate application to MongoDB

提交回复
热议问题