Subject Re: bug in PreparedStatement.setString () method
Author rrokytskyy
Hi,

This is bug in InterClient 2.01. But since there's hardly any support
for it, you have two options:

a) use Borland's InterClient 2.5. However it is not free and is
shipped only with InterBase 6.5.

b) try our type 4 JDBC driver, that is available using anonymous CVS
(there's a binary beta version on SourceForge, but it is quite old
and many fixes have been commited since that time). there's an ant
build script to build the driver.

Hope this helps.

Best regards,
Roman Rokytskyy

--- In Firebird-Java@y..., "wsaschakiss" <wsaschakiss@y...> wrote:
> Hi folks,
>
> I'm using firebird 1.0 with the interclient 1.02 in a tomcat 4.0.3
> environment. In the tomcat configuration I specified a JDBC realm as
> follows:
>
> <Realm className="org.apache.catalina.realm.JDBCRealm"
> debug="99"
> driverName="interbase.interclient.Driver"
> connectionURL="jdbc:interbase://localhost/mydatabase"
> connectionName="myuser"
> connectionPassword="mypassword"
> userTable="prs_personen" userNameCol="person"
> userCredCol="passwort"
> userRoleTable="prs_rollen" roleNameCol="rolle" />
>
> After starting firebird, the interserver and then tomcat and then
> typng the url of my web application in the browser, the catalina
> conatiner of Tomcat creates the following message:
>
> java.lang.NullPointerException
> at
> interbase.interclient.PreparedStatement.setString
> (PreparedStatement.java:979
> )
> at org.apache.catalina.realm.JDBCRealm.credentials
> (JDBCRealm.java:484)
> at org.apache.catalina.realm.JDBCRealm.authenticate
> (JDBCRealm.java:376)
> <...>
>
> I already checked my complete environment and all settings are
> correct. I already have been using mysql with the mm.mysql driver
> with the same configuration and with this driver the connection
works
> fine.
>
> Now I looked at the
interbase.interclient.PreparedStatement.setString
> () code and compared it to the equivalent of the mm.mysql driver.
The
> difference is that the mm.mysql driver checks the input string for
> null value while the interclient driver doesn't do that. Could it
be
> that for some reason the catalina container passes a null value to
> the setString () method of the PreparedStatement class?!?! I know,
> you will not answer this to me, but anyway, this could be
possible ;o)
>
> Does anybody know a workaround for this problem? Could the driver
> developers have a look at the code and enhance the setString ()
> method accurately?
>
> Bye the way, the Tomcat developers seem to know about this problem
> and fix it in a future version, but I would be grateful if this
could
> also be "fixed" in the interclient.
>
> Thanx,
>
> Jeremy.....*>