Ok so this is a stand alone application? I see you are using Spring 2.5? Is that a requirement? If it is not then upgrade to the newest. Currently 3.1.2
This is sufficient
get rid of this
I would use JDBCTemplate you are not gaining any of the advantages of exception translation or other benefits that Spring provides.
You are not bootstrapping your application correctly. @Autowired only happens in Spring managed beans. You are actually not even bootstrapping Spring at all.
Your main method needs to have something more like this.
Also your transaction manager is not going to work outside of a JEE container.
Also be aware that DriverManagerDataSource is fine for testing but it should not be used in production.
I think you may need to take a few steps back, buy a book or start with some beginner tutorials and work your way up to what you are trying to do here.
You can start with some of the suggestions I gave but you will find there is a lot to learn, so I would start with the basics like dependency injection and then start adding things as your understanding of what Spring is and how it works increases.
in the code you posted it looks like you are loading Spring.xml not applicationContext.xml. What is actually the name of the file? Also is the file directly on the class path? i.e src/main/resources? If it is under a subdirectory then you must specify this when you load it.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: Exception in thread "main" java.lang.NullPointerException (cannot connect to database)