Click here to Skip to main content
Sign Up to vote bad
good
See more: XMLJavaOracle
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:40
tusDev1323
Edited 15 Oct '12 - 22:47


1 solution

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 - 15 Oct '12 - 8:56
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. - 15 Oct '12 - 9:05
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
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 498
1 Arun Vasu 275
2 Maciej Los 273
3 Mahesh Bailwal 264
4 Aarti Meswania 175
0 Sergey Alexandrovich Kryukov 9,660
1 OriginalGriff 7,329
2 CPallini 3,968
3 Rohan Leuva 3,339
4 Maciej Los 2,851


Advertise | Privacy | Mobile
Web03 | 2.6.130516.1 | Last Updated 16 Oct 2012
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid