0

Is it possible to reset a password for an encrypted & embedded hsqldb database?

I can open it, establish the connection, but I want to remove the password, tried this

        db.update("SET password \"\"");
        db.update("ALTER USER SA SET password \"\"");
        db.update("ALTER USER SA SET password DIGEST \"\"");
        db.update("ALTER USER SA SET password NULL");

Nothing works. Is this even supported?

PS.

The encryption key is passed as

;crypt_key="16def4bd3310e999f1a8d8d369986ab9";crypt_type=RC2;

in JDBC connection URL.

1 Answers1

1

It is supported. The first two commands strings should work, but not the other two. The more "correct" form uses single quotes around the password string.

The problem may be with the db.update( part. This is not a JDBC statement and may not be doing what you expect. With an opened JDBC Connection, try:

Statement st = connection.createStatement();
st.execute("SET PASSWORD '' ");

Perhaps you want to remove the encryption, rather than the password. This is not possible directly, but you can use the PERFOR EXPORT ... statement, documented here http://hsqldb.org/doc/2.0/guide/management-chapt.html#N14EC1 for version 2.5.0 and later.

fredt
  • 24,044
  • 3
  • 40
  • 61
  • I have realised it's probably not the password, but the encryption, been checking the HSQL source code and it seems it's not supported directly. I'm dumping the entire script to SQL file... – Boris Jodorovsky Nov 23 '19 at 15:35