Mais uma de data com PreparedStatement

Pq estou tentando fazer isso e não da certo:

String sql = "SELECT ID_EMPRESA, RZSOCIAL, APELIDO, DT_VENC FROM TB_EMPRESA WHERE DT_VENC = ? ORDER BY RZSOCIAL"; ps = conexao.prepareStatement(sql); ps.setString(1, "1/1/2000" ); rs = ps.executeQuery();

Não acontece erro nenhum só não me retorna nada mesmo tendo um registro com está data

Se faço a mesma sql no console do bd me retorna

Bd Firebird

postgres:

String sql = "SELECT ID_EMPRESA, RZSOCIAL, APELIDO, DT_VENC"+
" FROM TB_EMPRESA WHERE DT_VENC = convert(?,'dd/MM/yyyy') ORDER BY RZSOCIAL";

Oracle:

String sql = "SELECT ID_EMPRESA, RZSOCIAL, APELIDO, DT_VENC"+
" FROM TB_EMPRESA WHERE DT_VENC = to_date(?,'dd/MM/yyyy') ORDER BY RZSOCIAL";

Vê se assim funciona.

Falou

Pô mais to usando firebird

[quote=rocha]Pô mais to usando firebird[/quote]Tenta usar isso,
não sei se funciona pois não uso firebird :wink:

...where DT_VENC = cast(? as DATE)...

Funcionou Valeu!!! :lol: