-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Getting tablelist of a database.
PostPosted: Thu May 14, 2009 12:17 pm 
Newbie

Joined: Thu May 14, 2009 12:12 pm
Posts: 1
How can we get tablelist of a database using Hibernate?


Top
 Profile  
 
 Post subject: Re: Getting tablelist of a database.
PostPosted: Thu May 14, 2009 11:17 pm 
Newbie

Joined: Tue Apr 07, 2009 8:48 am
Posts: 14
Location: Kerala,India
Hi,

List tableList=ses.createSQLQuery("select tname from tab").list(); will return a list comprising of all the the table names in your schema.

Plese rate if found helpful.

_________________
Its fun to LEARN
guru_G


Top
 Profile  
 
 Post subject: Re: Getting tablelist of a database.
PostPosted: Mon May 18, 2009 12:05 am 
Newbie

Joined: Tue Apr 07, 2009 8:48 am
Posts: 14
Location: Kerala,India
Hi the above query will list both tables and views from the DB. If you want only the tables to be listed, then use the following query select tname from tab where tabtype='TABLE';

_________________
Its fun to LEARN
guru_G


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.