Giter Site home page Giter Site logo

spring-integration-with-custom-db-connection-provider-and-mongodb-through-jndi's Introduction

Spring-Integration-with-custom-DB-connection-provider-and-MongoDB-through-jndi

This project provides spring integration with

  • Our own customized DataBase ConnectionProvider which is used by hibernate for DB connection.
  • And MongoDB through JNDI Resource using Custom Mongodb Factory class.

The dao objects of DB and MongoDB will be created during server startup. The spring is initialized by spring context loader during application server startup through web.xml.

Checkedin two projects for DB and Mongodb Objects initizalition.

++++ Our own customized DataBase ConnectionProvider

ConnectionProviderImpl.java, is a java class with implemented Connection provider to handle the db operations instead using the Apach DB Connection Source. I only implemented getconnection and closeconnection.

In hibernate.properties, specify connection Provider class and other hibernate properties.

applicationContext-springdao-config.xml - main spring application context xml to load the db objects.

hibernate-config.xml - read the hibernate properties and create session factory.

TestCustomDBAndMongoDB.java - test class shows to use DB objects.

++++ MongoDB through JNDI using property file.

context.xml - create Jndi Resource entry, which provides the mongodb properties and its custom factory class information.

web.xml - create context load for spring initialization Have resource-ref entry giving jndi name and its return type.

applicationContext-springdao-config.xml - main spring application context xml to load the db objects. J2ee tag to specify the Custom Mongodb factory for creating the mongotemplate.

CustomMongoJNDIFactory.java - Creates the mongotemplate fetching mongodb properties through jndi.

TestCustomDBAndMongoDB.java - test class shows to use MongoDB objects.

+++Contribution:

Thanks to Gopalakrishnan.P for support.

http://stackoverflow.com/questions/4076254/mongodb-via-jndi

spring-integration-with-custom-db-connection-provider-and-mongodb-through-jndi's People

Contributors

tirrumala avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.