domingo, 28 de julio de 2013

Groovy SQL

import groovy.sql.Sql;

import java.sql.RowId;
import java.text.SimpleDateFormat;

//def list=[];

sql = providedscripts.BonitaSql.newInstance("jdbc:mysql://localhost:3306/exampleBonita","root", "root",new com.mysql.jdbc.Driver());
//sql.eachRow("SELECT * FROM `personen`",{row-> list.add(row.idNachname)});

row = sql.firstRow("select id, nombre from datos where id =" + cedulaIdentidad);
//println "Columna personid = ${row.id} y la columna nombre = ${row.nombre}"



if (row == null){
    print "No existe registros" + cedulaIdentidad;
    estudiante = false;
    }
else{
    cedulaIdentidad = row.id;
    nombre = row.nombre;

    estudiante = true;
    }

No hay comentarios:

Publicar un comentario