This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
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?
the problem is that you did not post any code (yet).
Also: do your java class and the Oracle DB viewer use the same driver?
Joined: Apr 27, 2007
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..