Problema con consulta
Hola a todos, tengo un problema al ejecutar una sentencia SQL. La sentecia es la que cuento a continuación:
PreparedStatement preparedStatement = null;
ResultSet resultSet = null;
try{
String query = getQuery (SELECT_SUSCRIPCION_BYIDUSUARIO);
preparedStatement = connection.prepareStatement(query);
/* Se rellena el "preparedStatement". */
preparedStatement.setString(1,idUsuario);
/* Se ejecuta la query. */
resultSet = preparedStatement.executeQuery();
if (!resultSet.next()) {
throw new ObjetoNotFoundException("No se ha podido recuperar el usuario: " + idUsuario);
}
// Creamos el objeto a partir de los resultados de la query
return buildFromRow(resultSet);
}catch(Exception e ){
e.printStackTrace();
throw new InternalErrorException(e);
}
y el error que me dá es el siguiente:
java.sql.SQLException: Operand should contain 1 column(s)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2928)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1571)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1666)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2994)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:936)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1030)
at es.corporacionvoz.sedvoz.util.sql.DebuggablePreparedStatement.executeQuery(Unknown Source)
at es.corporacionvoz.sedvoz.serviciosexternos.ventaPDF.dao.ServicioPeriodicoDiaDAO.findByIdUsuario(ServicioPeriodicoDiaDAO.java:130)
at es.corporacionvoz.sedvoz.serviciosexternos.ventaPDF.dao.ServicioPeriodicoDiaDAO.findByIdUsuario(ServicioPeriodicoDiaDAO.java:94)
at es.corporacionvoz.sedvoz.serviciosexternos.ventaPDF.fachada.UsuarioServicioFacade.getDataUserAuthentication(UsuarioServicioFacade.java:67)
at es.corporacionvoz.sedvoz.serviciosexternos.ventaPDF.fachada.UsuarioServicioFacade.main(UsuarioServicioFacade.java:255)
A ver si alguine me puede echar una mano.
Gracias
Subject
Views
Written By
Posted
Problema con consulta
5027
June 28, 2007 12:19PM
2340
June 28, 2007 01:52PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.