This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets forum!
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: 1502
    
    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: 19651
    
  18

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Connecting to Database using JDBC template (Spring)
 
Similar Threads
Error: ERROR initServletBean, Context initialization failed
The matching wildcard is strict, but no declaration can be found for element 'context:annotation'
spring wont inject the entitymanager
Why this error?
XML name space error in Spring data JPA hibernate applicationContext.xml