Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: XML Java Oracle
Hi,
 
Actually I am new to Java development. I found Spring is really helpful for rapid development.
 
Please tell me the links or other Study materials on database [insert/update/delete]
in Java using Spring.
I have to code for Oracle.
 

Also I would like to know how Spring 3.2 (Java) help us in managing the xml (i.e., reading, writing or modification)?
 
EDIT:
 
Actually I am trying to call queryForInt() method but it displays NULL exception. When I acces the dB with same credential using Following Code:
DriverManagerDataSource dataSource = new DriverManagerDataSource();
dataSource.setDriverClassName("oracle.jdbc.driver.OracleDriver");
dataSource.setUrl("jdbc:oracle:thin:@localhost:1521:xe");
dataSource.setUsername("userName");
dataSource.setPassword("pwd");
 

------ In Bean -----------------
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
    <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
        <property name="url" value="jdbc:oracle:thin:@localhost:1521:xe"/>
        <property name="username" value="userName"/>
        <property name="password" value="pwd"/>
    </bean>
 
    <!-- DAOS -->
    <bean id="ProductDAO" class="br.edeploy.voive.dao.ProductDAO">
        <property name="dataSource" ref="dataSource"/>
    </bean>
 

---------On ProductDAO Class --------------
 
try
{
  int i = getSimpleJdbcTemplate().queryForInt("Select * from ERP_PRODUCT", "");
}
catch(DataAccessException dax)
 {
      throw new Exception("Error: "+dax.getMessage());
 }
 

Thanks.
Posted 15-Oct-12 0:40am
tusDev1332
Edited 15-Oct-12 22:47pm
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Spring works fine with hibernate: Spring Hibernate Integration Tutorial[^]
 
Have you seen the Spring Website? http://www.springsource.org/get-started[^]. Also great source.
 
and RoseIndia has always some to contribute: http://www.roseindia.net/spring/[^]
  Permalink  
Comments
tusDev1 at 15-Oct-12 8:56am
   
Hi TorstenH.
 
Can you send me some links that describes specially Database Connectivity (with Oracle) in spring?
I have found some for xml, but I don't think spring provides functionality for managing the xml files.
 
but Thanks anyways.
TorstenH. at 15-Oct-12 9:05am
   
Please do some research yourself.
Oracle provides the database system and is also the provider of Java core development, so database connection should be just about perfect.
Starting with Java and directly jumping into Spring development is a tough one.
So do it step by step:
 
- create some "playground application"
- create some facade
- create a simple local database
- access local database
- set up spring framework
- access spring framework
- set up remote database
- access remote database
- ...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 478
1 Sergey Alexandrovich Kryukov 280
2 RajeeshMenoth 110
3 PhilLenoir 95
4 Uma Shankar Patel 80
0 Sergey Alexandrovich Kryukov 6,532
1 OriginalGriff 5,976
2 CPallini 2,473
3 Richard MacCutchan 1,687
4 Abhinav S 1,550


Advertise | Privacy | Mobile
Web04 | 2.8.140821.2 | Last Updated 16 Oct 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100