Re: JDBC & views

From: John C. Bollinger (jobollin_at_indiana.edu)
Date: 11/24/03


Date: Mon, 24 Nov 2003 10:38:16 -0500

Anonymous wrote:

> That works great - thanks!!
>
> So question # 2 now is:
>
> Is there a way to have a select applied to a view?
>
> I know how to do it if I am writing the select statement. But what I
> want is a little different. The user can write and select statement
> they wish and I will then apply that statement to either the entire
> database or to a view depending on a setting I have. So the select
> will have nothing about the view in it. (In fact, the user does not
> know the view exists.)
>
> Any ideas?

It seems to me that if the user writes the SELECT statement, then he
determines which table / view he is selecting from. If you want to run
the statement against a programmatically chosen view instead of against
the user specified table(s) then you will have to modify the user's
statements appropriately before submitting them to the DB. You might be
able to (carefully) change the appropriate table names to the
corresponding view names in the statement's FROM clause.

JDBC is just the vehicle for delivering the statements to the DB and
getting the results; it has little to do with how you would implement
this kind of functionality.

John Bollinger
jobollin@indiana.edu



Relevant Pages

  • Re: Freely changing Wikipedia articles [was: Re: again the verb " go+ infinitive"]
    ... editor I work with...she found the writing to be wildly inconsistent ... investigating allegations of plagiarism. ... student's piece of writing and submitting it to Google. ...
    (alt.usage.english)
  • Simple question about mmap() system call
    ... I'm writing an utility that should examine some bytes of a large file ... and modify them - that't all. ... I've decided to mmap() the file: ... void *diskp; ...
    (freebsd-hackers)
  • Multithreading Interface Problem
    ... I'm writing a multithreaded application that uses 2 threads: ... modify the interface to reflect its busy state. ... processing I can't undo the changes because 'Controls created on one thread ... I use .NET Framework version 1.1 ...
    (microsoft.public.dotnet.languages.csharp)
  • Self-modifying Code
    ... when I was young I programmed in an interpreted language that allowed ... to modify itself. ... Also Python can (writing and running a module, ...
    (comp.lang.python)
  • Re: creating/copying files..
    ... >actually the goal is not to create an empty file, but a file that I will ... >be writing into, and will also need to copy, modify files... ... Prev by Date: ...
    (comp.lang.java.help)