Skip to content

Instantly share code, notes, and snippets.

Created March 3, 2017 03:20
Show Gist options
  • Save anonymous/ae2fca424bf19d014eb431f2327b91af to your computer and use it in GitHub Desktop.
Save anonymous/ae2fca424bf19d014eb431f2327b91af to your computer and use it in GitHub Desktop.
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.*;
import lotus.domino.*;
public class BANCOLOMBIALandingZone {
private Session ss;
private Database db;
private View vwEstSigXEstIni;
private View vwPorRadicado;
private Document docSolCredito;
private DateTime dtmHoy;
private IASJavaLog objLog;
private IASJavaConexion objConexion;
private BANCOLOMBIAAccesoParamInterno objAccesoParam;
private MemoryUsageMetter metter;
public BANCOLOMBIALandingZone(BANCOLOMBIAAccesoParamInterno objAccesoParam, IASJavaLog objLog) {
String strEncabezadoError = "Error en el constructor BANCOLOMBIALandingZone. ";
try {
this.ss = NotesFactory.createSession();
this.db = ss.getAgentContext().getCurrentDatabase();
this.objAccesoParam = objAccesoParam;
this.objLog = objLog;
this.objConexion = new IASJavaConexion(objLog);
this.metter = new MemoryUsageMetter(Runtime.getRuntime(), objLog);
this.metter.check();
} catch (Exception e) {
objLog.setRegistroError(0, strEncabezadoError + "\n" + "Excepción: " + e.toString());
System.out.println("Excepcion Constructor Bancolombia Landing Zone");
}
}
public void GenearaReporte() {
String strEncabezadoError = "Error en el método carga informe LZ. ";
DocumentCollection docCol = null;
Document docConfigGral = null;
try {
insertarRegistro();
} catch (Exception e) {
objLog.setRegistroError(0, strEncabezadoError + "\n" + "Excepción: " + e.toString());
objConexion.desconectar();
}
}
private void insertarRegistro() throws Exception {
Connection dbConnection = null;
PreparedStatement ps = null;
String strNombreTabla = "TBANCOL_LZ";
String strIdConsulta = "CLIENTE";
String sql;
int SOLFECCRE = 1;
int SOLFECAPR = 2;
int SOLCODVEN = 3;
int SOLUSRCRE = 4;
int SOLCODAPR = 5;
int SOLNROSOL = 6;
int SOLVALAPR = 7;
int SOLESTADO = 8;
int SOLIDENT = 9;
int SOLTIPOID = 10;
sql = "INSERT INTO " + strNombreTabla
+ "(SOLFECCRE, SOLFECAPR, SOLCODVEN, SOLUSRCRE, SOLCODAPR, SOLNROSOL, SOLVALAPR, SOLESTADO, SOLIDENT, SOLTIPOID) "
+ "VALUES (?,?,?,?,?,?,?,?,?,?)";
try {
objConexion.conectar("jdbc:oracle:thin:@//192.168.1.251:1522/DBSURA",
"IASPIC_DLL",
"IASPIC_DLL",
"ORACLE");
objLog.setRegistro("Realiza conexion");
dbConnection = objConexion.con;
objLog.setRegistro("Preparar preparestatement");
ps = dbConnection.prepareStatement(sql.toString());
ps.setString(SOLFECCRE, "2017/02/01");
ps.setString(SOLFECAPR, "2017/02/30");
ps.setString(SOLCODVEN, "PRUEBA1");
ps.setString(SOLUSRCRE, "PRUEBA2");
ps.setString(SOLCODAPR, "PRUEBA3");
ps.setString(SOLNROSOL, "PRUEBA4");
ps.setString(SOLVALAPR, "PRUEBA5");
ps.setString(SOLESTADO, "PRUEBA6");
ps.setString(SOLIDENT, "PRUEBA7");
ps.setString(SOLTIPOID, "PRUEBA8");
ps.execute();
objLog.setRegistro("Ejecuta insercción");
} catch (SQLException e) {
System.out.println(e.getMessage());
objLog.setRegistro("Error: " + e.getMessage());
} finally {
if (ps != null) {
ps.close();
}
if (dbConnection != null) {
dbConnection.close();
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment