Tengo un aplicación java que se conecta por JDBC y hago esta consulta:
Mi codigo :
String date = "21-Dec-16";
StringBuilder query = new StringBuilder("SELECT * ");
query.append("FROM TEST WHERE PUBLISHED_DATE='").append(date).append("'");
connection = getConnection(jdbc);
stmt = connection.createStatement();
rs = stmt.executeQuery(query.toString());
syso query => select * from TEST where PUBLISHED_DATE='21-Dec-16'
y el error que obtengo:
java.sql.SQLDataException: ORA-01858: a non-numeric character was found where a numeric was expected
TB he probado:
select * from TEST where PUBLISHED_DATE=TO_DATE('21-Dec-16','DD-MON-RR')
y el error:
java.sql.SQLDataException: ORA-01843: not a valid month
Sin embargo, ejecuto la misma consulta en mi sql developer y funciona