ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Konda, Sreenivasulu \(Consultant\)" <Sreenivasulu.Ko...@Consultmail.net>
Subject RE: How to get table metadata?
Date Fri, 19 Aug 2005 13:56:53 GMT
 Hi All,

Thank you very much for your inputs.

We would like to generate a report of all tables & columns that are
being selected/inserted/updated by our application since the database is
shared by many other applications/tools.

I will try one of the options suggested by all here, which requires less
work.

Regards,
Sreenivas

-----Original Message-----
From: Prashanth Sukumaran [mailto:prashanthsukumaran@yahoo.com] 
Sent: Thursday, August 18, 2005 12:45 PM
To: user-java@ibatis.apache.org
Subject: RE: How to get table metadata?

Hi Sreenivasulu,

Can you tell us what you want to do with the column names?

Also you may try to get it this way.  

SqlMapDaoTemplate.getSqlMapExecutor() will give you the sqlMapClient
handle.

Then you do  sqlMapClient.getDelegate() will give you the handle to
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.  

I think com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate is the
answer to you question.  

It has
  private HashMap mappedStatements;
  private HashMap cacheModels;
  private HashMap resultMaps;
  private HashMap parameterMaps;

May be one of these will have the data for what you are looking for.
You should try the getter methods for the data.  All the getters work
based on the "ID" (defined in the sqlmap) of the sql you are executing.

The developers of IBatis may have a better way.  Just see if these can
help you.

Rgds
Prashanth Sukumaran.


--- "Konda, Sreenivasulu (Consultant)"
<Sreenivasulu.Konda@Consultmail.net> wrote:

> Hi,
>  
> I have not got any solution yet. Can you please share the idea to get 
> the column names dynamically?
>  
> Thanks and regards,
> Sreenivas
> 
> ________________________________
> 
> From: Folashade Adeyosoye [mailto:shardayyy@gmail.com]
> Sent: Thursday, August 18, 2005 10:08 AM
> To: user-java@ibatis.apache.org
> Subject: RE: How to get table metadata?
> 
> 
> 
> Not that I know of, I tried this a while back to dynamically get my 
> column names. If you find a solution please let us know.
> 
>  
> 
> ________________________________
> 
> From: Konda, Sreenivasulu (Consultant) 
> [mailto:Sreenivasulu.Konda@Consultmail.net]
> Sent: Thursday, August 18, 2005 10:06 AM
> To: user-java@ibatis.apache.org
> Subject: How to get table metadata?
> 
>  
> 
> Hi,
> 
>  
> 
> I would like to know whether or not we can retrieve table metadata 
> such as table name, column name/type, etc... when used iBatis.
> 
>  
> 
> In JDBC, there is a class ResultSetMetaData, which gives us the 
> metadata of underlying table(s), column name, type, etc.
> 
>  
> 
> Is there any API to get these details and how?
> 
>  
> 
> Thanks and regards,
> 
> Sreenivas
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 

Mime
View raw message