This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package edu.pucmm.pw.hmj; | |
import java.sql.Connection; | |
import java.sql.DriverManager; | |
import java.sql.PreparedStatement; | |
import java.sql.ResultSet; | |
import java.util.ArrayList; | |
import java.util.List; | |
public class Main { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerAdmin webmaster@localhost | |
ServerName borrame.barcamp.org.do | |
ErrorLog ${APACHE_LOG_DIR}/error.log | |
CustomLog ${APACHE_LOG_DIR}/access.log combined | |
ProxyPass / http://0.0.0.0:8080/ | |
ProxyPassReverse / http://0.0.0.0:8080/ | |
</VirtualHost> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HttpResponse<JsonNode> jsonResponse = Unirest.get("http://localhost:4567/rest/estudiantes/0") | |
.header("Content-Type", "application/json") | |
.header("Accept", "application/json") | |
.queryString("apiKey", "asdasgdasgd") | |
.asJson(); | |
if(jsonResponse.getStatus()==200){ | |
JsonNode objeto = jsonResponse.getBody(); | |
System.out.println(String.format("matricula : %d, nombre: %s, Carrera: %s", | |
objeto.getObject().get("matricula"), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) throws Exception { | |
System.out.println("Cliente REST - Hola Mundo :-D - Unirest"); | |
HttpResponse<JsonNode> jsonResponse = Unirest.get("http://localhost:4567/rest/estudiantes/0") | |
.header("Content-Type", "application/json") | |
.header("Accept", "application/json") | |
.queryString("apiKey", "asdasgdasgd") | |
.asJson(); | |
if(jsonResponse.getStatus()==200){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String convertirJasperaBase64(String conduce){ | |
String pdfBase64 = "" | |
//Obteniendo la conexion. | |
Sql con = Sql.newInstance("jdbc:sqlserver://xxxxxxxx;databaseName=xxxxxxx", "xxxxxxx", "xxxxxxx") | |
//Parametros. | |
HashMap<String, Object> parametros=new HashMap<>(); | |
parametros.put("conduce", conduce) | |
parametros.put("logo", this.getClass().getResourceAsStream("/reportes/logo_stonewood.jpg")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugins { | |
id 'java' | |
id 'application' | |
} | |
group 'edu.pucmm' | |
version '1.0-SNAPSHOT' | |
mainClassName = "edu.pucmm.hmc.Main" | |
sourceCompatibility = 1.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package edu.pucmm.hmc; | |
import java.sql.Connection; | |
import java.sql.DriverManager; | |
import java.sql.ResultSet; | |
import java.sql.SQLException; | |
import java.util.ArrayList; | |
import java.util.List; | |
public class Main { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugins { | |
id 'java' | |
id 'application' | |
} | |
group 'edu.pucmm' | |
version '1.0-SNAPSHOT' | |
sourceCompatibility = 1.8 | |
mainClassName = 'edu.pucmm.hlr.Main' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) { | |
System.out.println("Hola Mundo Rest Cliente :-D"); | |
HttpResponse<JsonNode> response = Unirest.get("http://localhost:4567/rest/estudiantes/") | |
.header("accept", "application/json") | |
.queryString("apiKey", "123") | |
.asJson(); | |
// | |
System.out.println("Codigo respuesta del HTTP: "+response.getStatus()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package edu.pucmm.hlr; | |
import kong.unirest.HttpResponse; | |
import kong.unirest.JsonNode; | |
import kong.unirest.Unirest; | |
import org.json.JSONObject; | |
public class Main { |
OlderNewer