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

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic

Connecting to Database using JDBC template (Spring)

Nimu Chox

Joined: Mar 11, 2012
Posts: 27
Anayonkar Shivalkar

Joined: Dec 08, 2010
Posts: 1456

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.

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

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

Joined: Oct 27, 2005
Posts: 19541

Recreated at

How To Ask Questions How To Answer Questions
I agree. Here's the link:
subject: Connecting to Database using JDBC template (Spring)
Similar Threads
Why this error?
XML name space error in Spring data JPA hibernate applicationContext.xml
Error: ERROR initServletBean, Context initialization failed
spring wont inject the entitymanager
The matching wildcard is strict, but no declaration can be found for element 'context:annotation'