Date problem in where clause

I'm trying to run a select query from a java class. The query is built as a simple string based on user's input. However, I get ORA-01843: not a valid month error when I have date values inside where clause.. When I copy the same query and execute in Oracle DB viewer it works perfectly.. What could be the problem?

Also: do your java class and the Oracle DB viewer use the same driver?

Herman

Steve Renard
Ranch Hand

Joined: Apr 27, 2007
Posts: 66

posted Jun 22, 2007 15:55:00

0

This is the query: String query="select PRCS_DT from PURCH_TRANS where PRCS_DT='4/5/2007'" ; rs = stmt.executeQuery(query); It works fine when copied and executed in DB viewer.. I'm also sure that both java and Oracle use the same driver.. Please help..