packagejdbcConnection;importio.vertx.core.AbstractVerticle;importio.vertx.core.AsyncResult;importio.vertx.core.Future;importio.vertx.core.Handler;importio.vertx.core.json.JsonArray;importio.vertx.core.json.JsonObject;importio.vertx.ext.asyncsql.MySQLClient;importio.vertx.ext.sql.SQLClient;importio.vertx.ext.sql.SQLConnection;importio.vertx.ext.sql.SQLRowStream;importjava.util.ArrayList;importjava.util.List;/*** Created by sweet on 2017/9/13.*/
public class MyFirstVerticle extendsAbstractVerticle {private String sql = "SELECT id, name FROM t_school WHERE id IN (";privateSQLClient sqlClient;public static voidmain(String[] args) {
Runner.runExample(MyFirstVerticle.class);
}
@Overridepublic void start(Future startFuture) throwsException {
JsonObject c= newJsonObject();//配置数据库连接
c.put("username", "root").put("password", "1367356")