Return-Path: Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: (qmail 11978 invoked from network); 28 Aug 2007 12:56:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Aug 2007 12:56:17 -0000 Received: (qmail 76207 invoked by uid 500); 28 Aug 2007 12:56:09 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 76162 invoked by uid 500); 28 Aug 2007 12:56:09 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 76151 invoked by uid 99); 28 Aug 2007 12:56:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Aug 2007 05:56:09 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [217.221.115.6] (HELO mbmx235.mbmusers.it) (217.221.115.6) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Aug 2007 12:56:04 +0000 Subject: Tomcat JDBC realm and columns names MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C7E973.399E0D5E" Date: Tue, 28 Aug 2007 14:59:09 +0200 Message-ID: <1882271E611E6E4C90AF776E38DFE855596663@mbmx235.mbmusers.it> Content-class: urn:content-classes:message X-MimeOLE: Produced By Microsoft Exchange V6.5 X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Tomcat JDBC realm and columns names thread-index: AcfpTJEpB7E7vS/aRLG84lZ9bMMHBwAJdhlg From: "Ing. Diego Trombetta" To: X-Virus-Checked: Checked by ClamAV on apache.org ------_=_NextPart_001_01C7E973.399E0D5E Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > Why is the user's name in the role's table assumed to have the same > column name as in the user's table? >=20 > I think a lot of people already discussed about this topic,=20 > and I know how to correctly manage the configuration, > but I still don't understand why this limitation has been introduced. >=20 > I know I can easly extend the class > org.apache.catalina.realm.JDBCRealm > to add a new attribute and override the query used to retrieve the > user's roles > (this is what I've been doing) but I don't want to rebuilt my project > each time > I change the version of the application server just to be sure that my > class > extendes the correct class. >=20 > Wouldn't be easyer to add an attribute "userRoleNameCol" to the > standard JDBCRealm > If that value is missing, than the column name can be supposed to be > equal to the > column name in the user's table. >=20 > Note: I don't think it's right to write the DB according to what the > application server imposes! > Also because many times I develop applications based on the customer > DB, therefore I can > not change it! >=20 A general DB structure, according to me, is: users table; +-----------+---------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-----------+---------------+------+-----+---------+-------+ | us_name | varchar(16) | | PRI | | | | us_pwd | varchar(16) | | | | | +-----------+---------------+------+-----+---------+-------+ user roles table; +-----------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-----------+-------------+------+-----+---------+-------+ | ur_user | varchar(16) | | PRI | | | | ur_role | varchar(16) | | PRI | | | +-----------+-------------+------+-----+---------+-------+ ------_=_NextPart_001_01C7E973.399E0D5E--