aspose file tools*
The moose likes Beginning Java and the fly likes Connecting to Database using JDBC template (Spring) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic
Author

Connecting to Database using JDBC template (Spring)

Nimu Chox
Greenhorn

Joined: Mar 11, 2012
Posts: 27
Anayonkar Shivalkar
Bartender

Joined: Dec 08, 2010
Posts: 1509
    
    5

Hi Nimu Chox,

Welcome to CodeRanch!

Please TellTheDetails. What this xml file is about? Are you deploying any web application? Is it servlet/jsp or ejb? Either way, it does not seem to be 'beginning java' question.

We have dedicated forums for servlet, jsp, jdbc and ejb. You can request moderator to move this topic to appropriate forum.


Regards,
Anayonkar Shivalkar (SCJP, SCWCD, OCMJD, OCEEJBD)
Nimu Chox
Greenhorn

Joined: Mar 11, 2012
Posts: 27
Aim: In this XML file, I am configuring the data source, I will use the database instance in class "CityDaoImpl" - please see the code


I am getting an error "Top level element´╗┐ is not comepleted/Valid XML must have a root tag" in this line:

<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">



[Thumbnail for Try_Spring.png]

Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19723
    
  20

Recreated at http://www.coderanch.com/t/572956/JDBC/java/Connecting-Database-JDBC-template-Spring.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Connecting to Database using JDBC template (Spring)