ORA-00942: table or view does not exist- Can it be solved by granting privileges to user? I am creating a Java application that connects to an Oracle Database. 

In the application I connect to the DB as User A, which works as intended.

I then try to access tables in Schema 1 and Schema 2. 

However when I do so I get the error:

ORA-00942: table or view does not exist


I looked in SQLDeveloper and in the "other users" section of User A I cannot see any tables for Schemas 1 and 2.

How can I solve this error so that I can see and access tables in Schemas 1 and 2? 

Can I do this by assigning GRANT SELECT privileges on User A for schemas 1 and 2?
Take a look at what Oracle says about this type of error.


  ORA-00942 table or view does not exist
  
  Cause: The table or view specified does not exist, a synonym that is not allowed here was used, or a view was referenced where a table is required. If you are trying to access tables or views of another schema then you might not have required privileges to do it. 
  Action: You can-
      check the spelling of the table or view name.
      check that an existing table or view name exists.
      contact the DBA if the table needs to be created or if user or application privileges are required to access the table.


The following is the example to address your situation. It shows how grant SELECT object privilege and how to create synonym.

SQL&gt; create user userA identified by userA;

User created.

SQL&gt; grant connect, resource to usera;

Grant succeeded.

SQL&gt; conn userA/userA
Connected.
SQL&gt; create table tab (id number);

Table created.

SQL&gt; conn / as sysdba
Connected.
SQL&gt; create user schema1 identified by schema1;

User created.

SQL&gt; grant connect, resource to schema1;

Grant succeeded.

SQL&gt; conn schema1/schema1
Connected.
SQL&gt; create table tab1(id number);

Table created.

SQL&gt; select * from usera.tab;
select * from usera.tab
                    *
ERROR at line 1:
ORA-00942: table or view does not exist


SQL&gt; conn usera/userA
Connected.
SQL&gt; grant select on tab to schema1;

Grant succeeded.

SQL&gt; conn schema1/schema1
Connected.
SQL&gt; select * from usera.tab;

no rows selected

SQL&gt; create synonym for usera.tab;
create synonym for usera.tab
               *
ERROR at line 1:
ORA-00995: missing or invalid synonym identifier


SQL&gt; create synonym usera_tab for usera.tab;
create synonym usera_tab for usera.tab
*
ERROR at line 1:
ORA-01031: insufficient privileges


SQL&gt; conn / as sysdba
Connected.

SQL&gt; grant create synonym to schema1;

Grant succeeded.

SQL&gt; conn schema1/schema1 
Connected.
SQL&gt; create synonym usera_tab for usera.tab;

Synonym created.

SQL&gt; select * from usera_tab;

no rows selected

SQL&gt;