View Single Post
  #17  
Old 09-13-2007, 12:46 AM
Venkat Venkat is offline
D-Web Master
 
Join Date: Mar 2007
Posts: 347
Venkat is on a distinguished road
Thumbs up Re: Java/J2EE interview Questions

Can you explain JDBCRealm?

A realm is a "database" of usernames, passwords, and user roles. When we say JDBCrealmwe mean all these attributes are stored in table. In order to connect to JDBC you need to make a context.xml and save the same in “META-INF “folder of the web application.Below is the context.xml snippet.
<Context path="/security" docBase="security" debug="0">
<Realm className="org.apache.catalina.realm.JDBCRealm" debug="99" driverName="com.mysql.jdbc.Driver"connectionURL="j dbc:mysql://localhost:3306/security?autoReconnect=true" connectionName="MyConn" connectionPassword="Password1" userTable="tblusers" userNameCol="username" userCredCol="password" userRoleTable="user_roles" roleNameCol="role_name" />
</Context>
__________________
Venkat
knowledge is Power
Reply With Quote