Re: How to detect views w/ JDBC?
- From: "Bob Bunch (OCP)" <bunchb@xxxxxxxxxxx>
- Date: Mon, 18 Apr 2005 10:06:09 -0400
On Mon, 18 Apr 2005 14:37:46 +0200, Arnaud Berger wrote:
> Hi,
>
> getTables(...) from DatabaseMetaData seems to do the job :
>
> http://www.jguru.com/faq/view.jsp?EID=1181
>
> Regards,
>
> Arnaud
>
> "Bob Bunch (OCP)" <bunchb@xxxxxxxxxxx> a écrit dans le message news:
> pan.2005.04.18.12.27.12.578000@xxxxxxxxxxxxxx
>> I'm trying to figure out how to tell if a given table (given "select *
>> from someTableName") using JDBC/Thin is a view. I've tried using
>>
>> ResultSetMetaData.isReadOnly(int column) ResultSetMetaData.isWritable(int
>> column) ResultSetMetaData.isDefinitelyWritable(int column)
>>
>> ...all of which return the same result for a view as a table. Doesn't
>> matter if it's a simple or complex view.
>>
>> I can't employ an Oracle-specific solution for this problem (that'd be WAY
>> to simple ;) - this needs to be DB agnostic (aka pure JDBC).
>>
>> Also - this is for a code generator, NOT a to-be-live application. I'm
>> generating classes based on a given schema's tables/views, and need to
>> determine WHAT a given entity is, so I can NOT generate
>> insert/update/delete methods if the entity is a view.
>>
>> Any ideas?
>>
>> Thanks!
Yup! Thanks for the tip! ;)
.
- References:
- How to detect views w/ JDBC?
- From: Bob Bunch (OCP)
- Re: How to detect views w/ JDBC?
- From: Arnaud Berger
- How to detect views w/ JDBC?
- Prev by Date: Re: How to detect views w/ JDBC?
- Next by Date: help me with java probs please!
- Previous by thread: Re: How to detect views w/ JDBC?
- Next by thread: help me with java probs please!
- Index(es):
Relevant Pages
|
|