Declaranet
<%
out.println("");
String nompag[] = request.getRequestURI().split("/");
%>
<%
Conexion c = null;
ConexionDeclaranet cd = null;
Connection lcnt_con = null;
Connection lcd_connection = null;
Statement lst_stm = null;
Statement lstg_conecta=null;
ResultSet lrs_res = null;
String ls_query = new String("");
String emergent_error = new String("");
boolean lb_connection = false;
String debug = new String("si");
boolean elementos_encontrados = false;
String patron_busqueda = new String("");
String patron_enviar = new String("");
String tipo_enviar = new String("");
String tipo_busqueda = new String("");
String lower_limit = new String("0");
String upper_limit = new String("50");
String total_telefonia = new String("0");
/********* INICIO. Conexión a la base de datos ********/
try {
if (!Config.getParametro("debug").equals("si")) {
debug = "no";
}
c = new Conexion();
lcnt_con = c.getConnection();
lst_stm = lcnt_con.createStatement();
lb_connection = true;
}catch (Exception e) {
emergent_error = "Error al conectarse a la base de datos ";
if (debug.equals("si")) {
emergent_error += e;
}
lb_connection = false;
}
/********* FIN. Conexión a la base de datos ********/
/********* INICIO. Conexión a la base de datos ********/
try {
cd = new ConexionDeclaranet();
lcd_connection = cd.getConnection();
lstg_conecta = lcd_connection.createStatement();
}catch (Exception e) {
emergent_error = "Error al conectarse a la base de datos 2 ";
}
/********* FIN. Conexión a la base de datos ********/
//********* INICIO. Validación fundamental para evitar ejecución de código sin privilegios suficientes **********//
try {
if (!Permisos.PermisoModulo(nompag[nompag.length - 1].toString(), Integer.parseInt(session.getAttribute("id_user").toString()))) {
if (lb_connection) {
lst_stm.close();
lcnt_con.close();
lstg_conecta.close();
lcd_connection.close();
}
emergent_error += " Privilegios insuficientes. ";
lb_connection = false;
}
}catch (Exception e) {
emergent_error += " Privilegios insuficientes. ";
if (debug.equals("si")) {
emergent_error += "Trace: " + e.toString();
}
lb_connection = false;
}
/**FIN. Validación fundamental para; evitar ejecución de código sin privilegios suficientes****/
/*INICIA. parte del código*/
if(lb_connection){
try {
%>