Ver Mensaje Individual
  #6 (permalink)  
Antiguo 14/07/2009, 11:26
Avatar de Lophophora
Lophophora
 
Fecha de Ingreso: mayo-2005
Mensajes: 366
Antigüedad: 19 años
Puntos: 0
Respuesta: Equivalente en SQL SERVER "Returning"

Bueno, Creo que en Java las cosas funcionan diferente,

les comparto la solución que me funcionó.

Código PHP:
stmt conn.prepareStatement("INSERT INTO VEHICLES(LicenseNumber, ProdYear, Mileage) VALUES(?,?,?)"PreparedStatement.RETURN_GENERATED_KEYS);                                                
    
stmt.setString(1txtRegNum.getText());
    
stmt.setInt(2, (new Integer(txtProdYear.getText())).intValue());
    
stmt.setString(3txtMil.getText());
    
stmt.executeUpdate();
    
rs stmt.getGeneratedKeys();
    if(
rs.next())
    {
        
id=rs.getInt(1);
    } 
Muchas grtacias por todo

Lophophora
__________________
P.L.U.R.