Oi pessoal,
Estou tentando fazer uma consulta no banco, mas o comando sql esta com problemas!!alguem pode me ajudar??
O sql é o seguinte:
RS= Stmt.executeQuery("Select distinct P.cod_barra,P.descricao,P.precocusto,P.precovenda from Produto P, PedidoPromocao Ped where Ped.mes ="'+mes+'" and Ped.ano = "'+ano+'" and P.cod_produto = Ped.cod_produto order by "'+ordenado+'"" );
e o seu respectivo erro:
[list]
GuiRelCliente.java:231: unclosed character literal
RS= Stmt.executeQuery(“Select distinct P.cod_barra,P.descricao,P.pre
cocusto,P.precovenda from Produto P, PedidoPromocao Ped where Ped.mes =”’+mes+’
" and Ped.ano = “’+ano+’” and P.cod_produto = Ped.cod_produto order by “’+ordena
do+’”" );
^
GuiRelCliente.java:231: unclosed character literal
RS= Stmt.executeQuery(“Select distinct P.cod_barra,P.descricao,P.pre
cocusto,P.precovenda from Produto P, PedidoPromocao Ped where Ped.mes =”’+mes+’
" and Ped.ano = “’+ano+’” and P.cod_produto = Ped.cod_produto order by “’+ordena
do+’”" );
^
GuiRelCliente.java:231: unclosed string literal
RS= Stmt.executeQuery(“Select distinct P.cod_barra,P.descricao,P.pre
cocusto,P.precovenda from Produto P, PedidoPromocao Ped where Ped.mes =”’+mes+’
" and Ped.ano = “’+ano+’” and P.cod_produto = Ped.cod_produto order by “’+ordena
do+’”" );
^
3 errors
[/list]