您的位置:首页 > 编程语言 > Java开发

java.sql.SQLSyntaxErrorException:length must be specified in type definition:VARBINARY

2013-01-09 16:19 746 查看
Can you try this:

- Open the JBOSS_HOME/server/< servername>/conf/standardjbosscmp-jdbc.xml in a text editor

- Search for the "Hypersonic SQL" type-mappping in that file. It will look something like this:

<type-mapping>
<name>Hypersonic SQL</name>
<row-locking-template/>
...

<mapping>
<java-type>java.lang.Object</java-type>
<!-- hsqldb only supports directly serializable objects for sql type OBJECT -->
<jdbc-type>VARBINARY</jdbc-type>
<sql-type>VARBINARY</sql-type>
</mapping>
...

</type-mapping>


Try changing it to:

<type-mapping>
<name>Hypersonic SQL</name>
<row-locking-template/>
...

<mapping>
<java-type>java.lang.Object</java-type>
<!-- hsqldb only supports directly serializable objects for sql type OBJECT -->
<jdbc-type>VARBINARY</jdbc-type>
<sql-type>VARBINARY(1024)</sql-type>
</mapping>
...

</type-mapping>


See the change in the sql-type value. I set the length randomly to 1024.

After this change, restart the server and see if it works.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐