Subject | Re: [Firebird-Java] Firebird with Jaybird |
---|---|
Author | Gustavo Ruiz |
Post date | 2004-09-15T19:25:28Z |
Here is the server.xml configuration:
<Resource name="jdbc/FBApoloUsers" auth="Container"
type="org.firebirdsql.pool.FBWrappingDataSource"/>
<ResourceParams name="jdbc/FBApoloUsers">
<parameter>
<name>idleTimeout</name><value>5000</value>
</parameter>
<parameter>
<name>maxConnections</name><value>5</value>
</parameter>
<parameter>
<name>minConnections</name><value>2</value>
</parameter>
<parameter>
<name>factory</name><value>org.firebirdsql.pool.FBWrappingDataSource</value>
</parameter>
<parameter>
<name>database</name><value>192.168.1.3/3050:/opt/firebird/data/users/users.fdb</value>
</parameter>
<parameter>
<name>userName</name><value>tomcat</value>
</parameter>
<parameter>
<name>password</name><value>tomcat</value>
</parameter>
<parameter>
<name>sqlRole</name><value>READ</value>
</parameter>
</ResourceParams>
And here is the database metadata info:
/* Table: ROLES, Owner: SYSDBA */
CREATE TABLE "ROLES"
(
"ROLENAME" VARCHAR(25) NOT NULL,
"ROLEDB" VARCHAR(25) NOT NULL,
CONSTRAINT "PK_ROLES" PRIMARY KEY ("ROLENAME")
);
/* Table: USERS, Owner: SYSDBA */
CREATE TABLE "USERS"
(
"USERNAME" VARCHAR(25) NOT NULL,
"STATUS" VARCHAR(1),
"USERPASS" VARCHAR(50) NOT NULL,
CONSTRAINT "PK_USERS" PRIMARY KEY ("USERNAME")
);
/* Table: USER_ROLES, Owner: SYSDBA */
CREATE TABLE "USER_ROLES"
(
"USERNAME" VARCHAR(25) NOT NULL,
"ROLENAME" VARCHAR(25) NOT NULL,
CONSTRAINT "PK_USER_ROLES" PRIMARY KEY ("USERNAME",
"ROLENAME")
);
ALTER TABLE "USER_ROLES" ADD CONSTRAINT
"FK_USER_ROLES_ROLES" FOREIGN KEY ("ROLENAME")
REFERENCES "ROLES" ("ROLENAME");
ALTER TABLE "USER_ROLES" ADD CONSTRAINT
"FK_USER_ROLES_USERS" FOREIGN KEY ("USERNAME")
REFERENCES "USERS" ("USERNAME");
/* Grant Roles for this database */
/* Role: "REALM", Owner: SYSDBA */
CREATE ROLE "READ";
/* Grant permissions for this database */
GRANT SELECT ON "ROLES" TO "READ";
GRANT SELECT ON "USERS" TO "READ";
GRANT SELECT ON "USER_ROLES" TO "READ";
GRANT "READ" TO TOMCAT;
Thanks.
--- Roman Rokytskyy <rrokytskyy@...> escribió:
_______________________________________
Ruiz Santicchio Gustavo Javier
CUCAIBA - Sector Cómputos
Tel: (0221)427-6070 int 214
La Plata - Argentina
___________________________________________________________
100mb gratis, Antivirus y Antispam
Correo Yahoo!, el mejor correo web del mundo
http://correo.yahoo.com.ar
<Resource name="jdbc/FBApoloUsers" auth="Container"
type="org.firebirdsql.pool.FBWrappingDataSource"/>
<ResourceParams name="jdbc/FBApoloUsers">
<parameter>
<name>idleTimeout</name><value>5000</value>
</parameter>
<parameter>
<name>maxConnections</name><value>5</value>
</parameter>
<parameter>
<name>minConnections</name><value>2</value>
</parameter>
<parameter>
<name>factory</name><value>org.firebirdsql.pool.FBWrappingDataSource</value>
</parameter>
<parameter>
<name>database</name><value>192.168.1.3/3050:/opt/firebird/data/users/users.fdb</value>
</parameter>
<parameter>
<name>userName</name><value>tomcat</value>
</parameter>
<parameter>
<name>password</name><value>tomcat</value>
</parameter>
<parameter>
<name>sqlRole</name><value>READ</value>
</parameter>
</ResourceParams>
And here is the database metadata info:
/* Table: ROLES, Owner: SYSDBA */
CREATE TABLE "ROLES"
(
"ROLENAME" VARCHAR(25) NOT NULL,
"ROLEDB" VARCHAR(25) NOT NULL,
CONSTRAINT "PK_ROLES" PRIMARY KEY ("ROLENAME")
);
/* Table: USERS, Owner: SYSDBA */
CREATE TABLE "USERS"
(
"USERNAME" VARCHAR(25) NOT NULL,
"STATUS" VARCHAR(1),
"USERPASS" VARCHAR(50) NOT NULL,
CONSTRAINT "PK_USERS" PRIMARY KEY ("USERNAME")
);
/* Table: USER_ROLES, Owner: SYSDBA */
CREATE TABLE "USER_ROLES"
(
"USERNAME" VARCHAR(25) NOT NULL,
"ROLENAME" VARCHAR(25) NOT NULL,
CONSTRAINT "PK_USER_ROLES" PRIMARY KEY ("USERNAME",
"ROLENAME")
);
ALTER TABLE "USER_ROLES" ADD CONSTRAINT
"FK_USER_ROLES_ROLES" FOREIGN KEY ("ROLENAME")
REFERENCES "ROLES" ("ROLENAME");
ALTER TABLE "USER_ROLES" ADD CONSTRAINT
"FK_USER_ROLES_USERS" FOREIGN KEY ("USERNAME")
REFERENCES "USERS" ("USERNAME");
/* Grant Roles for this database */
/* Role: "REALM", Owner: SYSDBA */
CREATE ROLE "READ";
/* Grant permissions for this database */
GRANT SELECT ON "ROLES" TO "READ";
GRANT SELECT ON "USERS" TO "READ";
GRANT SELECT ON "USER_ROLES" TO "READ";
GRANT "READ" TO TOMCAT;
Thanks.
--- Roman Rokytskyy <rrokytskyy@...> escribió:
>http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/saFolB/TM
> > I configure a datasource in tomcat whit
> username,
> > password and sqlRole parameters, and open
> connection
> > in a database, but throw exception: no permissions
> for
> > select in a table.
>
> Can you post a Tomcat configuration here?
>
> Roman
>
>
> ------------------------ Yahoo! Groups Sponsor
> --------------------~-->
> $9.95 domain names from Yahoo!. Register anything.
>
>--------------------------------------------------------------------~->
>=====
>
>
> Yahoo! Groups Links
>
>
> Firebird-Java-unsubscribe@yahoogroups.com
>
>
>
>
>
>
_______________________________________
Ruiz Santicchio Gustavo Javier
CUCAIBA - Sector Cómputos
Tel: (0221)427-6070 int 214
La Plata - Argentina
___________________________________________________________
100mb gratis, Antivirus y Antispam
Correo Yahoo!, el mejor correo web del mundo
http://correo.yahoo.com.ar