Subject | RE: [Firebird-Java] DatabaseProductName |
---|---|
Author | Jeremy Blythe |
Post date | 2006-08-01T12:11:17Z |
Whoops, posted too soon. Don't worry about it. It seems that Spring lets
you wildcard the DatabaseProductName so you can put 'Firebird*' in the
definition like this:
<beans>
<bean id="Firebird"
class="org.springframework.jdbc.support.SQLErrorCodes">
<property name="databaseProductName" value="Firebird*"/>
<property
name="cannotAcquireLockCodes"><value>335544336</value></property>
</bean>
</beans>
you wildcard the DatabaseProductName so you can put 'Firebird*' in the
definition like this:
<beans>
<bean id="Firebird"
class="org.springframework.jdbc.support.SQLErrorCodes">
<property name="databaseProductName" value="Firebird*"/>
<property
name="cannotAcquireLockCodes"><value>335544336</value></property>
</bean>
</beans>
> -----Original Message-----
> From: Jeremy Blythe
> Sent: 01 August 2006 12:46
> To: Firebird-Java@yahoogroups.com
> Subject: [Firebird-Java] DatabaseProductName
>
>
> Hello,
>
> I use the Spring Framework and the sql-error-codes.xml file
> to specify mappings from GDS error codes like 335544336 to
> Spring DataAccessExceptions. Spring uses the
> DatabaseProductName retrieved from a call to
> java.sql.DatabaseMetaData.getDatabaseProductName(). It then
> uses this name to find the error mapping. In Jaybird 1.5.6
> this used to work because the DatabaseProductName was
> 'Firebird' but in Jaybird 2 and above (including the new
> Beta) it returns a long string including the version number
> and the host name of the database server, therefore this
> mapping doesn't work anymore. The new DatabaseProductName
> looks like this 'Firebird 1.5)LI-V1.5.3.4870 Firebird 1.5/tcp
> (idi)/P10'. (Note that 'idi' happens to be the Firebird
> server host name that I'm connected to). Is there anyway this
> can be reverted back to just plain 'Firebird' or something
> simpler and not dependant on the deployment environment like
> the host name?
>
> Thanks in advance
>
> Jeremy.
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>