How to get Username and Pwd from DB

I am new to web application. I want to check username and password entered by user in jsp page ,
available in database or not. Consider am using struts and hibernate. where to write code ,
in Business logic or DAOIMPL . Also just give two lines , how to get username , pwd from db

You're "considering" using Hibernate, which means you aren't, but want Hibernate code that accesses the DB? Have you looked at the Hibernate tutorials or documentation, or written any test code to try things out?

Moving to ORM.

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