Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to detect views w/ JDBC?

Re: How to detect views w/ JDBC?

From: HansF <News.Hans_at_telus.net>
Date: Mon, 18 Apr 2005 03:39:58 GMT
Message-Id: <pan.2005.04.18.03.41.56.478320@telus.net>


On Sun, 17 Apr 2005 23:14:22 -0400, Bob Bunch (OCP) interested us by writing:

> Perhaps I should've clarified that 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.

  1. If you are thinking about database independence, listen to Jim.
  2. Oracle has vews '???_TABLES' and '???_VIEWS' that list tables and views. ???=USER for those owned by the logged-in user'; =ALL for those 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 with this, suggest you reread the manuals and 'Reilly book 'Mastering Oracle SQL' to get more info.

Also check out '???_UPDATABLE_COLUMNS'

4) In many cases, you should seriously consider turning those methods into triggers (or PL/SQL routines called by triggers). That helps to 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 out that Excel and ODBC can ruin what you are doing. They will then delight in telling you that there is a major bug in your system, based on the report they generated after mucking with your datay.)

5) Oracle's online docco at http://docs.oracle.com is handy. In this case, concentrate on the Concepts manual and the Reference manual for the relevant version,

6) Realize that what you are doing is somewhat version dependent. Be prepared for long term maintenance.

-- 
Hans Forbrich                           
Canada-wide Oracle training and consulting
mailto: Fuzzy.GreyBeard_at_gmail.com   
*** I no longer assist with top-posted newsgroup queries ***
Received on Sun Apr 17 2005 - 22:39:58 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US