Tomcat Realm With 3 login Credential
<p>I have an application which require company id, username and password during the login and I want to do the authentication with tomcat JDBCRealm.</p>

<p>The configuration in server.xml file is like this:</p>

<pre><code>&lt;Realm className="org.apache.catalina.realm.JDBCRealm" driverName="org.gjt.mm.mysql.Driver"
  connectionURL="jdbc:mysql://localhost/authority?   user=dbuser&amp;amp;password=dbpass"
   userTable="users" userNameCol="user_name" userCredCol="user_pass" userRoleTable="user_roles" roleNameCol="role_name"/&gt;  
</code></pre>

<p>I have a users table which contains company id, user name and password.</p>

<p>The userNameCol stands for userName and the userCredCol stands for password.I want to add company id to this configuration so that it checks company id, user name and password all together during the authentication.</p>

<p>Thank you in advance for your help in this.</p>