dcsimg
Transparent Persistence - How can I choose a database schema (ORA-00942 error):
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Adrian_K
Posted On:   Friday, May 17, 2002 10:33 AM

I get this error when I try to get some objects from Database: ORA-00942: table or view does not exist. This is the steps used in the persisten classes creation... In order to create the persistent capable classes I added a new connection in Forte, selecting the appropiate database schema in the advanced tab of Runtime > Database > Add Connection...(the tables that I needed were in this schema) Then, using that connection, i captured the schema without problems and I was able to create the persistent classes. The problem is that when I create a new Persistent Manager, I must use some other database user as parameter for the pmf.setConnectionUserName() method. This user is not pointing automatically   More>>

I get this error when I try to get some objects from Database: ORA-00942: table or view does not exist.

This is the steps used in the persisten classes creation...


In order to create the persistent capable classes I added a new connection in Forte, selecting the appropiate database schema in the advanced tab of Runtime > Database > Add Connection...(the tables that I needed were in this schema)

Then, using that connection, i captured the schema without problems and I was able to create the persistent classes.


The problem is that when I create a new Persistent Manager, I must use some other database user as parameter for the pmf.setConnectionUserName() method. This user is not pointing automatically to the schema where the tables are stored.

So, my question is is there any way to indicate an schema in the database Connection URL? or just another way to do the same?...
I think that this is the problem, because if I copy all the tables into my default schema and use my user in the connection. I have no problems.

Thx in Advance.

P.D.: I am using Oracle 8.X Database.

   <<Less

Re: Transparent Persistence - How can I choose a database schema (ORA-00942 error):

Posted By:   Steve_Long  
Posted On:   Monday, May 20, 2002 01:59 AM

there are several ways one can approach the matter. i will share with you my preferences.

first, each application database resides in its own application schema to which no program or user has the ability to connect.

second, application or user accounts are created and granted appropriate roles or privileges on objects in the application schema(s).

third, ALL database accesses should ALWAYS be prefixed with the schema name. i usually define servlet initialization parameters for all connection parameters and schema names used in the application, and then use variables for the connection and schema prefix when building the SQL statements. this allows changing the connection and schema by changing only init parameters.

another approach is to define synonyms to the primary schema from the connection account, but i advise against this due to the amount of overhead involed in maintaining synonyms on a per user basis (and public synonyms are usually undesirable as things quickly become "cluttered").

About | Sitemap | Contact