Home > Spring > Spring not able to retrieve Sybase database metadata

Spring not able to retrieve Sybase database metadata

Recently, when trying to execute a Sybase stored procedure using SimpleJdbcCall, I found that the Spring framework could not read the database metadata. SimpleJdbcCall uses the metadata to intelligently figure out the parameters and their types and just makes stored procedure invocation painless.

After going through Spring’s source code, I found that Spring uses the database product name to determine how the metadata should be loaded. Turns out that the commonDatabaseName method in the JdbcUtils that is used to get the product name does a string comparison against “sql server” and our Sybase server is named “SQL Server”.

I submitted a patch to do this comparison with out taking considering the case. Hopefully this gets considered in the 3.0 release.

Categories: Spring Tags:
  1. Ramandeep
  2. Yzaslavs
    August 31st, 2011 at 09:35 | #2

    Nice. However – don’t you see that Spring-JDBC creates a db load, by generating a metadata SQL call for each call you make? this is done in doExecute (as it calles checkCompiled) – inAddition, checkCompiledMethod changes the state of the “isCompiled” field – so what happens if several threads are trying for example to perform select foo(5) and select foo(6) ?
    How did you overcome this issue?

  1. October 15th, 2009 at 08:32 | #1