Closed spring-projects-issues closed 12 years ago
Juergen Hoeller commented
What exactly is the error that you're getting? Spring 3.0.4 should actually allow for newlines there... Please double-check the Spring version that you're using.
Juergen
Luca Preziati commented
Script which failed
Luca Preziati commented
Spring Exception
Luca Preziati commented
Error is related to file Encoding, tomcat start with UTF-8 Encoding, but when i change in Windows file encoding from ISO8852-9 to UTF8. But as you can see, the exception is impossible to understand....
org.h2.jdbc.JdbcSQLException: Syntax error in SQL statement "CREATE[*] TABLE PROVA (ID VARCHAR2(45)) "; SQL statement: CREATE TABLE PROVA (id VARCHAR2(45)) [42000-158]
Sorry for the naming of the bug, I related to the new line, but obviusly I also change the file encoding, recreating file.
Juergen Hoeller commented
I'm afraid there is not much we can do here automatically since the actual encoding in a file is hard to detect. You'll need to specify the encoding explicitly.
If the encoding in your file differs from the platform encoding, consider specifying the "sqlScriptEncoding" property on ResourceDatabasePopulator. This is unfortunately not exposed in the jdbc namespace yet; I've added such an "encoding" attribute for Spring 3.1. On Spring 3.0, you'd need to avoid the namespace and fall back to traditional Spring bean definitions: Define the ResourceDatabasePopulator as a regular bean - using its "sqlScriptEncoding" property - and set that populator bean on the "databasePopulator" property of your EmbeddedDatabaseFactoryBean.
Juergen
Luca Preziati opened SPR-8562 and commented
If the Script sql used to popolate Embedded Db, like this