• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Using JDBCRealm in JSP application

 
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to use JDBC-Realm to save username and password information for my JSP application.
But it seems that the username and login doesn't work when I try to login.

I built two tables in MySQL database called 'user' and 'roles'.
There is only one entry in each table:
user (column names: username, password) -> 'myname', 'mypassword'
roles (column names: username, roles) -> 'myname', 'myrole'

Then I put these lines below in my server.xml.
<Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
driverName="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://localhost:3306/startdb?dontTrackOpenResources=true&zeroDateTimeBehavior=convertToNull"
connectionName="myDbUsername" connectionPassword="myDbPassword"
userTable="user" userNameCol="username" userCredCol="password"
userRoleTable="roles" roleNameCol="roles" />

I try to login using 'myname' and 'mypassword' but it doesn't work.

Can somebody please advice?
Thanks.

ps: I'm using Tomcat 5.5
 
Of course, I found a very beautiful couch. Definitely. And this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic