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 |