wood burning stoves 2.0*
The moose likes Object Relational Mapping and the fly likes How data stored in Database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "How data stored in Database " Watch "How data stored in Database " New topic
Author

How data stored in Database

Rajendra Prakash
Ranch Hand

Joined: Sep 10, 2009
Posts: 293
Consider I am using Hibernate. I have 10 records in ArrayList.
In which format data stored in Database.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I'm not sure what the question means. How it's stored depends on how you've mapped the class of objects in the list.
Rajendra Prakash
Ranch Hand

Joined: Sep 10, 2009
Posts: 293
Hql queries are used to retrieve data from hibernate.


From this code i can retrieve EmployeeBean object.
How can i get username and password from database and validate it.
should i do this in DAO.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Presumably you'd only want to select from the table where the user name and password are the same as the values on the form, no? So change your HQL. If you get a result, it means there's a user with that username and password. If you don't, there isn't, and login has failed.
Rajendra Prakash
Ranch Hand

Joined: Sep 10, 2009
Posts: 293
Check this code and correct. I am new to hibernate

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

That would work, but is potentially *horribly* inefficient.

What I actually meant was that you should select *only* the users from the DB whose password and username match.

http://docs.jboss.org/hibernate/core/3.3/reference/en/html/queryhql.html#queryhql-where
Rajendra Prakash
Ranch Hand

Joined: Sep 10, 2009
Posts: 293
Actually my interview asked , how you check entered username and password is correct or not.
So that am searching.can you say how to
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I did, several times.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How data stored in Database
 
Similar Threads
supported content types in jsp
SQL Server replacing characters
How to do XML to DB using Message Driven Bean?
how to download a zip file from database?
UTF8 java + arabic