-->
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.  [ 2 posts ] 
Author Message
 Post subject: How to get column name of table in Hibernate
PostPosted: Mon Oct 02, 2006 4:28 am 
Newbie

Joined: Mon Oct 02, 2006 4:24 am
Posts: 1
Location: Kuwait
Hi Everybody

I need equivalent code in hibernate for the following code in JDBC

/***********************************************************
public static String[] getColumnInfo(Connection con, String tableName) {
String dataColname = "";
String dataTypename = "";
int dataLength = 0;
int dataScale = 0;
String cols[] = null;
try {
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select * from parsedmirheader");

ResultSetMetaData rsmd = rs.getMetaData();
cols = new String[rsmd.getColumnCount()];
for (int index = 0 ; index < cols.length ; index++) {
cols[index] = rsmd.getColumnName(index+1);
}
rs.close();
stmt.close();
} catch (Exception e) {
e.printStackTrace();
}
return cols;
}
************************************************************/

Please help me

_________________
Thank You,
Best Regards,
Syed Saifuddin
Software Engineer
www.tacksystems.com


Top
 Profile  
 
 Post subject: Re: How to get column name of table in Hibernate
PostPosted: Tue Mar 27, 2007 4:29 am 
Newbie

Joined: Sat Mar 24, 2007 8:14 am
Posts: 15
i do have the same problem n i found by googling ::

please refer to this linik:
http://forums.hibernate.org/viewtopic.p ... 695af03b11

bt its partioally implemented so if u get the proper solution then plz let me know so that i can also implement it.

waiting for ur positive reply,

Thanks n regards,

Apurv S.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.