1

I was wondering how one would go about using sqlite3 to validate users in tomcat6. I do not have permission to install any sql type services, so I have to depend on sqlite3. My hope was to add this as a wrapper to an already existing deployment to provide better user management.

I have a users.db (tables: users(username,password), roles(username,role)) file sitting right next to tomcat-users.xml in /etc/tomcat6. I tried (unsuccessfully) to edit server.xml with this:

<Resource name="UserDatabase" auth="Container"
    type="javax.sql.DataSource"
    description="User database that can be updated and saved"
    driverClassName="org.sqlite.JDBC"
    pathname="conf/log.db" />

<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
    resourceName="UserDatabase"/>

Additionally, I got a JDBC driver sqlitejdbc-v056.jar for sqlite3 from http://www.zentus.com/sqlitejdbc/ and placed it in CATALINA_HOME (it is specifically at /usr/share/tomcat6/lib/sqlitejdbc-v056.jar).

Any help would be greatly appreciated from this frustrated Tomcat noobie. Thank you.

palacsint
  • 28,416
  • 10
  • 82
  • 109
kevin948
  • 648
  • 1
  • 8
  • 21

1 Answers1

1

No, you don't have to depend on sqlite3. You could use HSQLDB which was written in Java and does not require any platform specific binaries. Another candidate is Apache Derby and maybe there are some others.

palacsint
  • 28,416
  • 10
  • 82
  • 109
  • 1
    Well, it turns out the target machine this will go on will have mysql, so the problem is phased out. Apparently there is no native tomcat sqlite3 support, so I was going down the wrong path as you were saying. Thank you for your answer! – kevin948 Oct 21 '11 at 21:12