Announcement Announcement Module
Collapse
No announcement yet.
HSqlDB Function not supported? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • HSqlDB Function not supported?

    Hi folks,

    I am getting some strange errors from HSQLDB, when trying to verify if my tables exist.

    My strategy is to attempt to perform the queries that I need, on the premise that if the query parses correctly (and the relevant tables and columns exist), then all is fine, and if it doesn't then I need to try to create the tables.

    But I am getting the following error:

    Code:
     INFO: SQLErrorCodes loaded: [DB2, HSQL, MS-SQL, MySQL, Oracle, Informix, PostgreSQL, Sybase]
    org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [SELECT url FROM urls WHERE id = ?]; SQL state [IM001]; error code [-20]; This function is not supported; nested exception is java.sql.SQLException: This function is not supported
    java.sql.SQLException: This function is not supported
        at org.hsqldb.jdbc.jdbcUtil.sqlException(Unknown Source)
    I tried searching for the error code [IM001], but that seems to be a MSSQL error message, according to my searches.

    Any idea what this is about?

    Thanks

    Rogan

  • #2
    table checking

    For what it is worth, here is how I'm trying to check the existence of the tables:

    Code:
        protected void initDao() throws Exception {
            super.initDao();
    
            urlQuery = new UrlQuery();
            idQuery = new IdQuery();
            urlInsert = new UrlInsert();
    
            try {
                checkTables();
            } catch (Exception e) {
                createTables();
                checkTables();
            }
        }
    and checkTables is:

    Code:
        protected void checkTables() throws SQLException {
            try {
                idQuery.query(new URL("http://localhost/"));
            } catch (MalformedURLException mue) {
                mue.printStackTrace();
            }
            urlQuery.query(new Integer(0));
        }
    and .query() is a convenience method that takes the arguments and formats them into an array of Object to be passed to execute(Object[])

    I had originally developed this code using HsqlDB memory tables, which were discarded each time I exited. This meant that the first checkTables() would always fail, the tables would be created, and the second checkTables() succeeded.

    Now that I am using a persistent db, and the tables already exist, I would hope that checkTables() would not throw an Exception, and we'd be good to go. However, I now get that [IM001] error :-(

    Any suggestions would be most welcome.

    Rogan

    Comment


    • #3
      Figured it out

      I was using rs.getURL(column), which is unsupported in HsqlDB.

      Changed to using new URL(rs.getString()) and it works perfectly.

      Comment

      Working...
      X