Erro - MySQL server version for the right syntax to use near '?

MySQL

23/12/2010

Pessoal, Estou com um erro chato danado, toda vez que executo o trecho abaixo:  
. .. 
. String teste = rs.getString("fonte"); 
. ... 
. String query = "update pedido set fonte = ? where codigo = ?"; 
. PreparedStatement stmt1 = conn.prepareStatement(query); 
. stmt1.setString(1, (String)session.getAttribute( "teste" )); 
. stmt1.setString(2, teste); 
. 
 stmt1.executeUpdate(query); 
. ... .. String teste = rs.getString("fonte"); ... String query = "update pedido set fonte = ? where codigo = ?"; 
 
PreparedStatement stmt1 = conn.prepareStatement(query); 
 
stmt1.setString(1, (String)session.getAttribute
 
( "teste" )); stmt1.setString(2, teste);
 
 stmt1.executeUpdate(query); ... 
 
  O erro que acontece é esse: MySQL server version for the right syntax to use near '? where codigo = ?' at line 1   Alguem sabe o que pode ser? valeu
Arnaldo Silveira

Arnaldo Silveira

Curtidas 0
POSTAR