You need to use the JBoss JAAS security manager. <security-domain> element in your jboss-web.xml file.
Are there any simple examples I could use which show the changes needed to login-config.xml, jboss-web.xml, web.xml, .conf files etc., in order to configure for a JDBC Realm using JAAS, please ?
I think there are several articles and howtos on the web, try google: http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=utf-8&q=JBoss+JAAS+article&btnG=Google+Search
to get started and see if any of those are helpful