Corrupted varchar2 strings with ojdbc14.jar and Oracle 8.1.6
Date: Mon, 11 Aug 2003 15:18:05 -0400
Message-ID: <4MidnToQhZw6dqqiRTvU2Q_at_speakeasy.net>
Hello!
[Quoted] I run into the following problem and the behavior is buffling to me. We have a web-based application that, among other things, needs to update some data in Oracle database. The code is very straight-forward and looks something like this (simplified):
private static final String updateReleaseSQL = "UPDATE Releases SET Title=?, Num=?, DateReleased=? " + "WHERE Id = ?";
[...]
pstmt = conn.prepareStatement(updateReleaseSQL);
pstmt.setString(1, release.getTitle());
pstmt.setString(2, release.getNum());
if (release.getDateReleased() == null) {
pstmt.setNull(3, java.sql.Types.DATE); } else {
pstmt.setDate(3, new java.sql.Date(release.getDateReleased().getTime()));
}
pstmt.setInt(4, release.getId());
pstmt.executeUpdate();
closeStatement(pstmt);
The problem that I'm reliably seeing occurs when runnig the above code using the latest Oracle JDBC Thin drivers (9.2.0.3, ojdbc14.jar) and J2SDK 1.4.2 against Oracle 8 database (8.1.6.3.0). What happens is the value of Title (varchar2(255) gets corrupted everytime I execute the code - the first three characters of the Title change to garbage. It's always first three characters, always during the update. When I switched the drivers to version 8.1.7.1 downloaded from OTN the problem appears to have gone away. But the 8.1.7.1 drivers are not approved for use with JDK's 1.4.x.
[Quoted] Any ideas what could be causing the issue, and how can I resolve it and go back to the latest released JDBC drivers approved for use with JDK 1.4? Thanks in advance!
-M- Received on Mon Aug 11 2003 - 21:18:05 CEST