DatabaseMetaData.getColumns() returns 0 fileds when create a synonym on?



DatabaseMetaData.getColumns() returns 0 fileds when create a synonym
on?

Hi, There.

I met this problem:
1, create a user named tony (Roles: CONNECT,RESOURCE). Grant the SELECT
permis

sion on SCOTT.EMP to tony.
2, tony logon by sqlplus, "create synonym SYNO1 for SCOTT.EMP"

Then I tested the DatabaseMetaData.getColumns() using flowing code:


import java.sql.*;
import oracle.jdbc.driver.OracleDriver;
public class TestConnection {

public static void main(String[] args)


try {
String userName = "tony";
String userPassword = "tony";
String url = "jdbc:oracle:thin:@shg-d-01-tf:1521:tfang";
java.util.Properties info = new java.util.Properties();
info.put("user", userName);
info.put("password", userPassword);
info.put("includeSynonyms", "true"); // I need set it to true to ues
the synon

ym(SYNO1 ).
info.put("remarksReporting", "true");
DriverManager.registerDriver(new OracleDriver());
Connection conn =DriverManager.getConnection(url, info);
DatabaseMetaData md = conn.getMetaData();
String tableName = "EMP";
String schemaName = "SCOTT";
ResultSet rs = md.getColumns(null,schemaName,tableName,null);
int count = 0;
while (rs.next()){
count++;

System.out.println("count of " + tableName + "'s fields:" + count);
rs.close();
conn.close();
} catch (Exception e) {
e.printStackTrace();


The result:
count of EMP's fields:0
also I using scott login, it return 0 also.

When you set "includeSynonyms" to false,then the result is:
count of EMP's fields:1

Enviroment: Oracle 9.2.0.1 / Windows server 2003
And using Oracle client 9.2 connect to Oracle server 8.1.7 also has
this probl

em.


Any advice is helpful.

Thanks

.



Relevant Pages

  • Re: Latest Cartoon Rebuses
    ... noobie with these rebuses. ... Im pretty much worthless on these rebuses...is #3 tony hawk maybe??? ... be found in the dialogue (one is a synonym). ... Cannon, Submarine, You, Should, Hit, That) or any synonyms of those ...
    (rec.puzzles)
  • a synonym for an array of 20 integers
    ... Is there a way to declare M as a synonym for an array of 20 integers? ... Tony ...
    (microsoft.public.vc.mfc)
  • Re: NTFS physical limits
    ... > Microsoft MVP - Windows Server Networking ... But i cant find any documentation where it says ... >>that physical drives cant be larger tha 2TB. ... >>Tony Myhrberg ...
    (microsoft.public.windows.file_system)
  • Oracle 10g Express
    ... Oracle 10g Express zu tun gehabt? ... Tony ... Prev by Date: ...
    (microsoft.public.de.vb.datenbank)
  • Re: Can I use integrated security in an ODBC connection string without using a DSN?
    ... Do you know of a way to connect using integrated security with Oracle? ... Tony ... >> Can I use integrated security in an ODBC connection string without using ...
    (microsoft.public.sqlserver.odbc)