-
Bug
-
Resolution: Fixed
-
P5
-
1.1.2
-
None
-
kestrel
-
x86
-
windows_95
Name: joT67522 Date: 08/22/97
I'm using Java's JDBC to attempt to execute the relational database query
embedded in
the prepared statement below. The code compiles fine, but when I execute it, an
SQLException
is generated when the program attempts to bind the second parameter using the
"setDate()"
function. The exception message reads "java.sql.SQLException: Restricted data
type attribute violation"
The data source is a Microsoft Access database connected through and ODBC
driver. I'm also
using the XDB JetConnect JDBC driver. (Note that I was able to get the same
query to work with
the same database using XDB's JetConnect API that mimics ODBC calls.)
Appreciate any help I can get, or especially, any examples of someone using the
PreparedStatement.setDate() function.
--Mike
-----------------------------------------------------------------------------
PreparedStatement sourcePStmt = con.prepareStatement
("select ssn, first_name, last_name " +
"from stumast " +
"where curric_id = ? " +
"and curric_enroll_date " +
"between ? AND ?");
sourcePStmt.setString(1, "00037");
sourcePStmt.setDate(2, new java.sql.Date(1997,01,31));
sourcePStmt.setDate(3, new java.sql.Date(1997,07,01);
company - Air Force Institute of Technology , email - ###@###.###
======================================================================