pruebas
This commit is contained in:
@@ -9,21 +9,25 @@ const pool = mariadb.createPool({
|
||||
connectionLimit: 5,
|
||||
});
|
||||
|
||||
pool
|
||||
.getConnection()
|
||||
.then((conn) => {
|
||||
conn
|
||||
.query("CALL busca_alumno_pcpuma('316313528')")
|
||||
.then((rows) => {
|
||||
console.log(rows);
|
||||
conn.end();
|
||||
})
|
||||
.catch((err) => {
|
||||
//handle error
|
||||
console.log(err);
|
||||
conn.end();
|
||||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
//not connected
|
||||
});
|
||||
const obtenerAlumno = (numeroCuenta) => {
|
||||
return pool
|
||||
.getConnection()
|
||||
.then((conn) => {
|
||||
conn
|
||||
.query(`CALL busca_alumno_pcpuma('${numeroCuenta}')`)
|
||||
.then((rows) => {
|
||||
conn.end();
|
||||
return rows;
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
conn.end();
|
||||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
//not connected
|
||||
});
|
||||
};
|
||||
|
||||
console.log('hola');
|
||||
console.log(obtenerAlumno('316313528'));
|
||||
|
||||
Reference in New Issue
Block a user