liquibase.exception.DatabaseException: Error executing SQL select schema_name(): Incorrect syntax near the keyword 'select'.

JIRA | Willem Cazander | 7 months ago
  1. 0

    When using the jtds driver for liquibase updates it will log multiple times the following exception; (without throwing it higher) {code:java} INFO 5/11/16 5:56 PM: liquibase: Error getting default schema liquibase.exception.DatabaseException: Error executing SQL select schema_name(): Incorrect syntax near the keyword 'select'. at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:88) at liquibase.executor.jvm.JdbcExecutor.query(JdbcExecutor.java:117) at liquibase.executor.jvm.JdbcExecutor.query(JdbcExecutor.java:128) at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:136) at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:151) at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:146) at liquibase.database.AbstractJdbcDatabase.getConnectionSchemaName(AbstractJdbcDatabase.java:324) at liquibase.database.AbstractJdbcDatabase.getDefaultSchemaName(AbstractJdbcDatabase.java:305) at liquibase.changelog.ChangeLogParameters.<init>(ChangeLogParameters.java:54) at liquibase.Liquibase.<init>(Liquibase.java:104) at TestDriverJTDS.testDriverJTDS(TestDriverJTDS.java:32) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.ExpectException.evaluate(ExpectException.java:19) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) Caused by: java.sql.SQLException: Incorrect syntax near the keyword 'select'. at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:372) at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2988) at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2421) at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:671) at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:505) at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:1032) at liquibase.executor.jvm.JdbcExecutor$QueryCallableStatementCallback.doInCallableStatement(JdbcExecutor.java:368) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:81) ... 34 more {code} workaround: use the sqljdbc4 driver or set the schema name on the database.setDefaultSchemaName("test");

    JIRA | 7 months ago | Willem Cazander
    liquibase.exception.DatabaseException: Error executing SQL select schema_name(): Incorrect syntax near the keyword 'select'.
  2. 0

    When using the jtds driver for liquibase updates it will log multiple times the following exception; (without throwing it higher) {code:java} INFO 5/11/16 5:56 PM: liquibase: Error getting default schema liquibase.exception.DatabaseException: Error executing SQL select schema_name(): Incorrect syntax near the keyword 'select'. at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:88) at liquibase.executor.jvm.JdbcExecutor.query(JdbcExecutor.java:117) at liquibase.executor.jvm.JdbcExecutor.query(JdbcExecutor.java:128) at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:136) at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:151) at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:146) at liquibase.database.AbstractJdbcDatabase.getConnectionSchemaName(AbstractJdbcDatabase.java:324) at liquibase.database.AbstractJdbcDatabase.getDefaultSchemaName(AbstractJdbcDatabase.java:305) at liquibase.changelog.ChangeLogParameters.<init>(ChangeLogParameters.java:54) at liquibase.Liquibase.<init>(Liquibase.java:104) at TestDriverJTDS.testDriverJTDS(TestDriverJTDS.java:32) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.ExpectException.evaluate(ExpectException.java:19) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) Caused by: java.sql.SQLException: Incorrect syntax near the keyword 'select'. at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:372) at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2988) at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2421) at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:671) at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:505) at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:1032) at liquibase.executor.jvm.JdbcExecutor$QueryCallableStatementCallback.doInCallableStatement(JdbcExecutor.java:368) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:81) ... 34 more {code} workaround: use the sqljdbc4 driver or set the schema name on the database.setDefaultSchemaName("test");

    JIRA | 7 months ago | Willem Cazander
    liquibase.exception.DatabaseException: Error executing SQL select schema_name(): Incorrect syntax near the keyword 'select'.
  3. 0

    jTDS - SQL Server and Sybase JDBC driver / Discussion / Help:Incorrect syntax for CallableStatement

    sourceforge.net | 1 year ago
    java.sql.SQLException: Incorrect syntax near the keyword 'select'.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Incorrect syntax for CallableStatement

    jtds | 1 decade ago | furnerc
    java.sql.SQLException: Incorrect syntax near the keyword 'select'.
  6. 0

    Database connection unexpectedly closed with Glassfish, jTDS and SQL Server 2008

    Stack Overflow | 5 years ago | fernacolo
    java.sql.SQLException: I/O Error: Connection reset by peer: socket write error

  1. ruifung 1 times, last 3 months ago
12 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.sql.SQLException

    Incorrect syntax near the keyword 'select'.

    at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic()
  2. jTDS
    JtdsPreparedStatement.executeQuery
    1. net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:372)
    2. net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2988)
    3. net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2421)
    4. net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:671)
    5. net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:505)
    6. net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:1032)
    6 frames
  3. Liquibase Core
    Liquibase.<init>
    1. liquibase.executor.jvm.JdbcExecutor$QueryCallableStatementCallback.doInCallableStatement(JdbcExecutor.java:368)
    2. liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:81)
    3. liquibase.executor.jvm.JdbcExecutor.query(JdbcExecutor.java:117)
    4. liquibase.executor.jvm.JdbcExecutor.query(JdbcExecutor.java:128)
    5. liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:136)
    6. liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:151)
    7. liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:146)
    8. liquibase.database.AbstractJdbcDatabase.getConnectionSchemaName(AbstractJdbcDatabase.java:324)
    9. liquibase.database.AbstractJdbcDatabase.getDefaultSchemaName(AbstractJdbcDatabase.java:305)
    10. liquibase.changelog.ChangeLogParameters.<init>(ChangeLogParameters.java:54)
    11. liquibase.Liquibase.<init>(Liquibase.java:104)
    11 frames
  4. Unknown
    TestDriverJTDS.testDriverJTDS
    1. TestDriverJTDS.testDriverJTDS(TestDriverJTDS.java:32)
    1 frame
  5. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    4. java.lang.reflect.Method.invoke(Method.java:497)
    4 frames
  6. JUnit
    ParentRunner.run
    1. org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    2. org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    3. org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    4. org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    5. org.junit.internal.runners.statements.ExpectException.evaluate(ExpectException.java:19)
    6. org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    7. org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    8. org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    9. org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    10. org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    11. org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    12. org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    13. org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    14. org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    14 frames
  7. JUnit4 Runner
    JUnit4TestReference.run
    1. org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
    1 frame
  8. JUnit3 Runner
    RemoteTestRunner.main
    1. org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    2. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
    3. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
    4. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
    5. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
    5 frames