Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to detect views w/ JDBC?
On Mon, 18 Apr 2005 06:32:28 -0700, Rauf Sarwar wrote:
> Bob Bunch (OCP) wrote:
>> On Mon, 18 Apr 2005 03:39:58 +0000, HansF wrote: >> >> > On Sun, 17 Apr 2005 23:14:22 -0400, Bob Bunch (OCP) interested us
>> > writing: >> > >> >> Perhaps I should've clarified that this is for a code generator,
>> >> to-be-live application. I'm generating classes based on a given >> >> schema's tables/views, and need to determine WHAT a given entity
>> >> I can NOT generate insert/update/delete methods if the entity is a >> >> view. >> > >> > 1) If you are thinking about database independence, listen to Jim. >> > >> > 2) Oracle has vews '???_TABLES' and '???_VIEWS' that list tables
>> > views. ???=USER for those owned by the logged-in user'; =ALL for
>> > accessible by the user; =DBA for all, if the user has DBA rights. >> > >> > 3) Some of Oracle's views are updateable. If you are unfamiliar
>> > this, suggest you reread the manuals and 'Reilly book 'Mastering
>> > SQL' to get more info. >> > >> > Also check out '???_UPDATABLE_COLUMNS' >> > >> > 4) In many cases, you should seriously consider turning those
>> > into triggers (or PL/SQL routines called by triggers). That helps
>> > ensure complete data consistency regardless of which mechanism your >> > users find to bypass your application code. >> > >> > (Unless you tie their hands behind their backs, someone will find
>> > that Excel and ODBC can ruin what you are doing. They will then
>> > in telling you that there is a major bug in your system, based on
>> > report they generated after mucking with your datay.) >> > >> > 5) Oracle's online docco at http://docs.oracle.com is handy. In
>> > case, concentrate on the Concepts manual and the Reference manual
>> > the relevant version, >> > >> > 6) Realize that what you are doing is somewhat version dependent.
>> > prepared for long term maintenance. >> >> 1) Jim didn't tell me HOW TO do anything. >> >> 2) I'm not just a Java coder; I've been an Oracle DBA for > 10 years,
>> --> 10g. *Of course* I could hit the user_/all_/dba_ views to get
>> want (I've written Swing apps in the past that did all kinds of
>> DBA stuff), but this *must be* DB agnostic. MySQL, Sybase, DB2 -- do
>> have the same views? No. >> >> 3) And some are not, hence my question. >> >> 4) I'm fully aware of Oracle's SP/SF/trigger capabilities. This is
>> MEANS platform agnostic, and believe me - I'm a big proponent of
>> said capabilities! >> However, it's not appropriate for this situaion. >> >> 5) Been there done that - do they have examples for how to determine,
>> standard JDBC calls ONLY, how to detect a view? >> >> 6) No it isn't - what I'm TRYING to do is DB agnostic, therefore
>> work on not just other vendors, but any version of Oracle that JDBC
>> hook up to. >> >> Bottom line - please _fully_ read my situation befoe telling me to do >> bunch of Oracle-specific stuff. I would just LOVE it if I could ONLY
>> support Oracle - I have 99.9% of my experience w/ this great
>> however, this is not my current reality for this particular project.
>> you don't know how to do this, I appreciate your help, but please
>> just tell me how to do it w/ Oracle-specifics. I already know that.
Thanks a lot for the tip! Exactly the direction I needed to go! ;) Received on Mon Apr 18 2005 - 09:05:33 CDT
![]() |
![]() |