Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Select * from table_name where country_code='IN';
Database has so many datas with different country code.For example:IN(India),GB(Great Britain),US(United State) etc.
Posted
Comments
Richard MacCutchan 24-Nov-14 6:26am    
This has nothing to do with Java, that is a SQL statement. Please explain clearly what your problem is.

1 solution

Try this...

Criteria cr = session.createCriteria(Country.class);
cr.add(Restrictions.eq("code", 'IN'));
List results = cr.list();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900