简体   繁体   中英

Vaadin error : com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near 'LIMIT'

I'm trying a sample with Vaadin + Sql Server.

After create a JDBCConnectionPool I have the following :

TableQuery tq = new TableQuery("myTableName", MyJDBCConnectionPool);
tq.setVersionColumn("MyIdColName");
SQLContainer container = new SQLContainer(tq);

Then I got this error :

com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near 'LIMIT'

Any help please ?

I guess this isn't Vaadin-related: it seems to me that the problem is that JDBC thinks it's talking to a MySQL database (LIMIT is a MySQL reserved word); you need to re-check your configuration (about which I can't be of help, but if you post it others could review it).

You should use MSSQLGenerator instead of DefaultSQLGenerator. DefaultSQLGenerator uses the LIMIT clause and not MSSQLGenerator.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM