Hi,

did you read the JTDS documentation?
http://jtds.sourceforge.net/typemap.html

Seems that DATE and TIME is only supported by Sybase, not by mssql. Seems you have to use TIMESTAMP.

regards,
Armin


Bart�omiej Knabel wrote:
Hi Tom!


at com.bimki.oo7j.experiments.OJB.zapytanie2(OJB.java:220)


TD> Here OJB tries to bind the query arguments to a prepared select
TD> statement but it fails to do so because the Date object that you
TD> specified does not fit the jdbc type of the corresponding statement
TD> parameter (which the JTDS driver thinks is JAVA_OBJECT). Could you
TD> please post the creation and binding of this query (method
TD> com.bimki.oo7j.experiments.OJB.zapytanie2) ?

Query is very simple

this is the code :
                 import java.util.Date;
                 (...)

void zapytanie2()
Date data = new Date();
data = Util.getDate(2005, 11, 29);


                Criteria criteria = new Criteria();
                criteria.addGreaterOrEqualThan("data", data);
                QueryByCriteria query = new QueryByCriteria(CzescAtomowa.class,
                criteria);
                results =
                broker.getCollectionByQuery(query).iterator(); // <<<< 220
                line


in Util class :

public static Date getDate(int year, int month,int day) {
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.YEAR,year);
calendar.set(Calendar.MONTH,month);
calendar.set(Calendar.DATE,day); return calendar.getTime();
}



the same code worked fine with mySQL...


-- Bartlomiej Knabel


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to