Subject | RE: [Firebird-Java] What is this? Help |
---|---|
Author | Евгений Путилин |
Post date | 2004-05-20T06:31:07Z |
Hello, "Francisco!
You wrote on Wed, 19 May 2004 23:24:54 +0000 (UTC):
FAV> Message: SQL type for this field is not yet supported.
FAV> private void getCliente(String cnpj)
FAV> { try
FAV> {
FAV> stm = c.createStatement();
FAV> ResultSet rs = stm.executeQuery("SELECT * FROM
CLIENTES
FAV> WHERE CNPJ='"+cnpj+"'");
^^^^^^
You have error where cnpj contain '. You must use prepare statement and
set param:
PrepareStatment ps=c.prepareStatment("SELECT * FROM CLIENTES WHERE
CNPJ=?");
ps.setString(1,cnpj);
ResultSet rs = ps.executeQuery();
FAV> if (rs.next())
FAV> {
FAV> campoNome.setText(rs.getString("NOME"));
FAV> campoCNPJ.setEnabled(false);
FAV> }
FAV> rs.close();
FAV> }
FAV> catch(SQLException se)
FAV> {
FAV> se.printStackTrace();
FAV> }
FAV> }
With best regards, Eugeney Putilin.
You wrote on Wed, 19 May 2004 23:24:54 +0000 (UTC):
FAV> Message: SQL type for this field is not yet supported.
FAV> private void getCliente(String cnpj)
FAV> { try
FAV> {
FAV> stm = c.createStatement();
FAV> ResultSet rs = stm.executeQuery("SELECT * FROM
CLIENTES
FAV> WHERE CNPJ='"+cnpj+"'");
^^^^^^
You have error where cnpj contain '. You must use prepare statement and
set param:
PrepareStatment ps=c.prepareStatment("SELECT * FROM CLIENTES WHERE
CNPJ=?");
ps.setString(1,cnpj);
ResultSet rs = ps.executeQuery();
FAV> if (rs.next())
FAV> {
FAV> campoNome.setText(rs.getString("NOME"));
FAV> campoCNPJ.setEnabled(false);
FAV> }
FAV> rs.close();
FAV> }
FAV> catch(SQLException se)
FAV> {
FAV> se.printStackTrace();
FAV> }
FAV> }
With best regards, Eugeney Putilin.