Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
所以这里有一些代码:
statement.executeUpdate("CREATE TABLE SomeTable(id INTEGER IDENTITY, " + "text CLOB)");
这会引发异常“错误的数据类型:语句 [...] 中的 CLOB”。有没有办法将 CLOB 存储在 Hsqldb 数据库中?文档说是。或者也许我对 SQL 的了解太生疏了,以至于我忘记了如何定义它们。
尝试 LONGVARCHAR 而不是 CLOB
在 2.0 及更高版本中,CLOB 是受支持的类型。对于您的示例,您应该明确添加 PRIMARY KEY 。
statement.executeUpdate("CREATE TABLE SomeTable(id INTEGER IDENTITY PRIMARY KEY, " + "text CLOB)");