Results 1 to 3 of 3
  1. #1
    BarathVenki92 is offline Member
    Join Date
    Mar 2014
    Posts
    1
    Rep Power
    0

    Smile Accessing two schema from spring and hibernate

    Hi Mahesh,

    At present, i am facing the same problem. Have u solved this problem in your application. If u solved, please guide me to solve the same issue ASAP.

    Quote Originally Posted by Mahesh View Post
    Hi,

    I am new to hibernate and Spring
    My application use spring , struts and hibernate mapping. Its cuurently connecting to a single database

    The requirement is to create a new schema and to fetch the data from both the schemas ….. I need to take data from both the schemas…. Both the schemas are having the same set of tables (Table names are same across the schemas as the new one is the archival schema )

    In my dataAccessContext-jta.xml , datasource is defined as follows….

    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
    <property name="driverClassName">
    <value>oracle.jdbc.driver.OracleDriver</value>
    </property>
    <property name="url">
    <value>jdbc racle:thin:@someserver</value>
    </property>
    <property name="username">
    <value>usrname</value>
    </property>
    <property name="password">
    <value>passwd/value>
    </property>
    </bean>

    <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate" >
    <constructor-arg>
    <ref bean="dataSource"/>
    </constructor-arg>
    </bean>
    <bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSess ionFactoryBean"> <property name="dataSource">
    <ref local="dataSource"/>
    </property>
    <property name="mappingResources">
    <list>
    <value>trial.hbm.xml</value> </list> </property> <property name="hibernateProperties">
    <props>
    <prop key="hibernate.dialect">net.sf.hibernate.dialect.O racle9Dialect</prop>
    <prop key="hibernate.show_sql">false</prop>
    <prop key="hibernate.cache.region_prefix">hibernate.cach e</prop>
    <prop key="hibernate.cache.provider_class"> net.sf.hibernate.cache.EhCacheProvider </prop> </props></property></bean>

    <bean id="transactionManager" class="org.springframework.orm.hibernate.Hibernate TransactionManager"> <property name="sessionFactory">
    <ref local="sessionFactory"/>
    </property> </bean>

    My question is whether its possible to connect to two different schema s using hibernate … If so how can we go about it… Here we are usnig hibernate transaction manager .. Please explain in detail as I dont have any idea of how to go about it... Please help me in this…

    Thanks

  2. #2
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,266
    Rep Power
    6

    Smile Accessing two schema from spring and hibernate

    This thread is -very- old, create a new thread for yourself and ask your own question, with all the details you can give about your specific situation.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,173
    Rep Power
    20

    Default Re: Accessing two schema from spring and hibernate

    Moved to own thread.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Replies: 0
    Last Post: 08-02-2013, 10:11 AM
  2. Error while accessing a JSP page (Spring Framework)
    By new_coder in forum Web Frameworks
    Replies: 0
    Last Post: 12-15-2010, 05:14 PM
  3. Use Hibernate & Spring
    By onepseudoxy in forum Enterprise JavaBeans (EJB)
    Replies: 1
    Last Post: 06-13-2010, 10:46 AM
  4. Replies: 26
    Last Post: 02-25-2010, 12:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •