Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:
XML
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 -----------------
XML
<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 --------------

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



Thanks.
Posted
Updated 15-Oct-12 22:47pm
v2

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/[^]
 
Share this answer
 
Comments
tusDev1 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. 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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900