elbambino Posted November 10, 2012 Report Share Posted November 10, 2012 hola necesito una ayuda para una aplicación de java conectada con una base de datos bueno mi consulta es la siguiente ¿como puedo hacer que esta consulta rs = stmt.executeQuery("SELECT ID,PRIMERNOMBRE,APELLIDO,AREA,CREDITO from ESTUDIANTES where "); dentro de java como hacer que onda el where dependa de una variable ingresada en java por ejemplo que sea algo asi rs = stmt.executeQuery("SELECT ID,PRIMERNOMBRE,APELLIDO,AREA,CREDITO from ESTUDIANTES where "variable ingresada java) para seleccionar dentro de muchos datos solo uno por ejemplo por rut bueno si me pueden ayudar les agradecería mucho de antemano muchas gracias Link to comment Share on other sites More sharing options...
Leoxz Posted November 10, 2012 Report Share Posted November 10, 2012 supongo que debe ser una function, puedes pasarle una variable a la funcion public "loqueretorna" verEstudiantePorRut(int rut){ // ... rs = stmt.executeQuery("SELECT ID,PRIMERNOMBRE,APELLIDO,AREA,CREDITO from ESTUDIANTES where rut = " + rut + ");";//...} Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now