Hello,
On Mittwoch, 22. Januar 2003 16:28, Laurent Vaills wrote:
> Hi.
>
> I set up a database with 2 users created like this with dbmcli :
> sql_execute CREATE USER admin PASSWORD admin RESOURCE
> sql_execute CREATE USER toto PASSWORD toto STANDARD
>
> When I execute the attached java program it fails !
> The user toto cannot see the table TestGrant created by the user admin.
>
> The GRANT statement does not seem to be executed (returns -1).
> I tested to execute the GRANT statement with dbmcli and everything
> works.
>
>   connection = DriverManager.getConnection(url, "admin", "admin");
>   select.executeUpdate("CREATE TABLE TestGrant (ID INT NOT NULL)");
>   int count = select.executeUpdate("GRANT ALL ON TestGrant TO PUBLIC");
[...]
>       connection = DriverManager.getConnection(url, "toto", "toto");
>        rset = select.executeQuery("SELECT ID FROM TestGrant");

I am not quite sure but it looks to me as if you had missed to qualify the 
table name by the schema. You should propably ask for 
SELECT ID from admin.testgrant
or create a public synonym for your table.

Peter Willadt

_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to