Añado los fuentes de java
This commit is contained in:
@@ -0,0 +1,531 @@
|
||||
/**
|
||||
* @(#) Persistenciatapresca_tarisan.java
|
||||
*/
|
||||
|
||||
package com.tarisan.control;
|
||||
|
||||
import com.tarisan.data.Paciente;
|
||||
import com.tarisan.data.Taconaut;
|
||||
import com.tarisan.data.Tapresca;
|
||||
import com.tarisan.log.*;
|
||||
import com.tarisan.util.DES;
|
||||
import com.tarisan.excepcion.ExcepcionTarisan;
|
||||
|
||||
import java.sql.*;
|
||||
import java.util.Vector;
|
||||
|
||||
/**
|
||||
* Controla los accesos a la persistencia para la entidad <code>tapresca_tarisan</code>.
|
||||
* @author <a href="mailto:sistemas@imqnavarra.com">Dpto. Informática</a>.
|
||||
* @version 1.0, 24/09/2003
|
||||
*/
|
||||
public class PersistenciaTapresca
|
||||
{
|
||||
|
||||
/**
|
||||
* El objeto <code>Paginacion</code> que controla el número de filas a mostrar por cada página.
|
||||
*/
|
||||
private Paginacion objPaginacion = new Paginacion();
|
||||
|
||||
|
||||
/**
|
||||
* Obtiene el valor del objeto <code>Paginacion</code> para saber que página se está visualizando.
|
||||
* @return El objeto <code>Paginacion</code>.
|
||||
*/
|
||||
public Paginacion getPaginacion()
|
||||
{
|
||||
return objPaginacion;
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtiene los actos médicos pertenecientes a la prescripción realizada al paciente.
|
||||
* @param autorizacion Autorización de la prescripción.
|
||||
* @param colectivo Número de colectivo.
|
||||
* @param poliza Número de póliza.
|
||||
* @param beneficiario Número de beneficiario.
|
||||
* @param pagina Número de página a mostrar.
|
||||
* @return El Vector con los registros seleccionados (todos pertenencientes a la clase <code>tapresca_tarisan</code>).
|
||||
* @throws
|
||||
*/
|
||||
public Vector obtenerActosPrescripcionAnalisis(long autorizacion, long colectivo, double poliza, int beneficiario, int pagina) throws ExcepcionTarisan
|
||||
{
|
||||
int elementosPaginacion=1;
|
||||
|
||||
Vector vResultado = new Vector();
|
||||
Tapresca tapresca_tarisan = null;
|
||||
StringBuffer strSql = new StringBuffer();
|
||||
Object aCondiciones[]=null;
|
||||
|
||||
try
|
||||
{
|
||||
strSql.append("SELECT tapresca_tarisan.ACTO");
|
||||
strSql.append(" FROM tapresca_tarisan");
|
||||
strSql.append(" WHERE tapresca_tarisan.AUTORIZACION=?");
|
||||
strSql.append(" AND tapresca_tarisan.COLEC=?");
|
||||
strSql.append(" AND tapresca_tarisan.POLIZA=?");
|
||||
strSql.append(" AND tapresca_tarisan.ORDEN=?");
|
||||
|
||||
aCondiciones = new Object[4];
|
||||
aCondiciones[0] = Long.valueOf(autorizacion);
|
||||
aCondiciones[1] = Long.valueOf(colectivo);
|
||||
aCondiciones[2] = Double.valueOf(poliza);
|
||||
aCondiciones[3] = Integer.valueOf(beneficiario);
|
||||
|
||||
Connection conexion = ParametrosConfiguracion.dataStore.obtenerConexion();
|
||||
ResultSet rs = ParametrosConfiguracion.dataStore.seleccionar(conexion, strSql.toString(), aCondiciones);
|
||||
|
||||
objPaginacion.inicializarPaginacion(rs);
|
||||
if (objPaginacion.getNumeroRegistrosTotales()!=0)
|
||||
{
|
||||
objPaginacion.realizarPaginacion(rs, pagina);
|
||||
|
||||
while(rs.next() && (elementosPaginacion <= Paginacion.getFilasPorPagina()))
|
||||
{
|
||||
tapresca_tarisan = new Tapresca();
|
||||
tapresca_tarisan.setActo(rs.getInt("ACTO"));
|
||||
vResultado.addElement(tapresca_tarisan);
|
||||
if (pagina!=0) //Se quiere realizar la paginacion
|
||||
elementosPaginacion++;
|
||||
}
|
||||
}
|
||||
rs.close();
|
||||
ParametrosConfiguracion.dataStore.liberarConexion(conexion);
|
||||
LogTarisan.logger.log(NivelLog.DEBUG, "Seleccionados " + vResultado.size() + " registros de la tabla tapresca_tarisan (" + strSql.toString() + ")");
|
||||
}
|
||||
|
||||
catch (ExcepcionTarisan sqle)
|
||||
{
|
||||
LogTarisan.logger.log(NivelLog.ERROR, "Error en la selección de tapresca_tarisan: " + sqle + " (" + strSql.toString() + ")");
|
||||
throw (ExcepcionTarisan)sqle;
|
||||
}
|
||||
catch(SQLException sqle)
|
||||
{
|
||||
LogTarisan.logger.log(NivelLog.ERROR, "Error en la selección de tapresca_tarisan: " + sqle + " (" + strSql.toString() + ")");
|
||||
throw new ExcepcionTarisan(sqle.getMessage());
|
||||
}
|
||||
catch(Exception sqle)
|
||||
{
|
||||
LogTarisan.logger.log(NivelLog.ERROR, "Error en la selección de tapresca_tarisan: " + sqle + " (" + strSql.toString() + ")");
|
||||
throw new ExcepcionTarisan(sqle.getMessage());
|
||||
}
|
||||
catch(Throwable sqle)
|
||||
{
|
||||
LogTarisan.logger.log(NivelLog.ERROR, "Error en la selección de tapresca_tarisan: " + sqle + " (" + strSql.toString() + ")");
|
||||
throw new ExcepcionTarisan(sqle.getMessage());
|
||||
|
||||
}
|
||||
|
||||
return vResultado;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Inserta un nuevo registro en la tabla tapresca_tarisan en función de la sentencia INSERT indicada.
|
||||
* @param sqlSelect La sentencia INSERT.
|
||||
* @param aValores Array que contiene los valores de los parámetros utilizados en la sentencia.
|
||||
* @throws
|
||||
*/
|
||||
public boolean insertarPrescripcion(String sqlSelect, Object[] aValores) throws ExcepcionTarisan
|
||||
{
|
||||
boolean resultado = false;
|
||||
try
|
||||
{
|
||||
resultado = ParametrosConfiguracion.dataStore.insertar(sqlSelect, aValores);
|
||||
}
|
||||
catch (ExcepcionTarisan sqle)
|
||||
{
|
||||
LogTarisan.logger.log(NivelLog.ERROR, "Error en la modificacion de tapresca_tarisan: " + sqle + " (" + sqlSelect + ")");
|
||||
return resultado;
|
||||
//throw (ExcepcionTarisan)sqle;
|
||||
}
|
||||
catch(Exception sqle)
|
||||
{
|
||||
LogTarisan.logger.log(NivelLog.ERROR, "Error en la modificacion de tapresca_tarisan: " + sqle + " (" + sqlSelect + ")");
|
||||
return resultado;
|
||||
//throw new ExcepcionTarisan(sqle.getMessage());
|
||||
}
|
||||
catch(Throwable sqle)
|
||||
{
|
||||
LogTarisan.logger.log(NivelLog.ERROR, "Error en la modificacion de tapresca_tarisan: " + sqle + " (" + sqlSelect + ")");
|
||||
return resultado;
|
||||
//throw new ExcepcionTarisan(sqle.getMessage());
|
||||
}
|
||||
return resultado;
|
||||
}
|
||||
|
||||
/**
|
||||
* Inserta un nuevo registro en la tabla tapresca_tarisan en función de la sentencia INSERT indicada.
|
||||
* @param sqlSelect La sentencia INSERT.
|
||||
* @param aValores Array que contiene los valores de los parámetros utilizados en la sentencia.
|
||||
* @param conexion La conexión por la que se ejecuta la sentencia. Utilizado para el uso transacciones.
|
||||
* @throws
|
||||
*/
|
||||
public boolean insertarPrescripcion(String sqlSelect, Object[] aValores, Connection conexion) throws ExcepcionTarisan
|
||||
{
|
||||
boolean resultado = false;
|
||||
try
|
||||
{
|
||||
resultado = ParametrosConfiguracion.dataStore.insertar(sqlSelect, aValores, conexion);
|
||||
}
|
||||
catch (ExcepcionTarisan sqle)
|
||||
{
|
||||
LogTarisan.logger.log(NivelLog.ERROR, "Error en la modificacion de tapresca_tarisan: " + sqle + " (" + sqlSelect + ")");
|
||||
return resultado;
|
||||
//throw (ExcepcionTarisan)sqle;
|
||||
}
|
||||
catch(Exception sqle)
|
||||
{
|
||||
LogTarisan.logger.log(NivelLog.ERROR, "Error en la modificacion de tapresca_tarisan: " + sqle + " (" + sqlSelect + ")");
|
||||
return resultado;
|
||||
//throw new ExcepcionTarisan(sqle.getMessage());
|
||||
}
|
||||
catch(Throwable sqle)
|
||||
{
|
||||
LogTarisan.logger.log(NivelLog.ERROR, "Error en la modificacion de tapresca_tarisan: " + sqle + " (" + sqlSelect + ")");
|
||||
return resultado;
|
||||
//throw new ExcepcionTarisan(sqle.getMessage());
|
||||
}
|
||||
return resultado;
|
||||
}
|
||||
|
||||
public boolean modificarPrescripcion(String sqlSelect, Object[] aValores, Object[] aCondiciones, Connection conexion) throws ExcepcionTarisan
|
||||
{
|
||||
boolean resultado = false;
|
||||
try
|
||||
{
|
||||
resultado = ParametrosConfiguracion.dataStore.actualizar(sqlSelect, aValores, aCondiciones, conexion);
|
||||
}
|
||||
catch (ExcepcionTarisan sqle)
|
||||
{
|
||||
LogTarisan.logger.log(NivelLog.ERROR, "Error en la modificacion de tapresca_tarisan: " + sqle + " (" + sqlSelect + ")");
|
||||
return resultado;
|
||||
//throw (ExcepcionTarisan)sqle;
|
||||
}
|
||||
catch(Exception sqle)
|
||||
{
|
||||
LogTarisan.logger.log(NivelLog.ERROR, "Error en la modificacion de tapresca_tarisan: " + sqle + " (" + sqlSelect + ")");
|
||||
return resultado;
|
||||
//throw new ExcepcionTarisan(sqle.getMessage());
|
||||
}
|
||||
catch(Throwable sqle)
|
||||
{
|
||||
LogTarisan.logger.log(NivelLog.ERROR, "Error en la modificacion de tapresca_tarisan: " + sqle + " (" + sqlSelect + ")");
|
||||
return resultado;
|
||||
//throw new ExcepcionTarisan(sqle.getMessage());
|
||||
}
|
||||
return resultado;
|
||||
}
|
||||
|
||||
public boolean eliminarPrescripcion(String sqlSelect, Object[] aCondiciones, Connection conexion) throws ExcepcionTarisan
|
||||
{
|
||||
boolean resultado = false;
|
||||
try
|
||||
{
|
||||
resultado = ParametrosConfiguracion.dataStore.borrar(sqlSelect, aCondiciones, conexion);
|
||||
}
|
||||
catch (ExcepcionTarisan sqle)
|
||||
{
|
||||
LogTarisan.logger.log(NivelLog.ERROR, "Error en la eliminación de tapresca_tarisan: " + sqle + " (" + sqlSelect + ")");
|
||||
return resultado;
|
||||
//throw (ExcepcionTarisan)sqle;
|
||||
}
|
||||
catch(Exception sqle)
|
||||
{
|
||||
LogTarisan.logger.log(NivelLog.ERROR, "Error en la eliminación de tapresca_tarisan: " + sqle + " (" + sqlSelect + ")");
|
||||
return resultado;
|
||||
//throw new ExcepcionTarisan(sqle.getMessage());
|
||||
}
|
||||
catch(Throwable sqle)
|
||||
{
|
||||
LogTarisan.logger.log(NivelLog.ERROR, "Error en la eliminación de tapresca_tarisan: " + sqle + " (" + sqlSelect + ")");
|
||||
return resultado;
|
||||
//throw new ExcepcionTarisan(sqle.getMessage());
|
||||
}
|
||||
return resultado;
|
||||
}
|
||||
|
||||
public Vector obtenerPeticiones(int medico, int colectivo, long poliza, int orden, int pagina) throws ExcepcionTarisan
|
||||
{
|
||||
int elementosPaginacion=1;
|
||||
Vector autorizaciones = new Vector();
|
||||
String sqlSelect = new String();
|
||||
PersistenciaTabenefi per = new PersistenciaTabenefi();
|
||||
String tarjeta = "";
|
||||
String tarjetaChipcard = "";
|
||||
|
||||
tarjeta = per.obtenerTarjeta(colectivo, poliza, orden);
|
||||
tarjetaChipcard = per.obtenerTarjetaChipcard(colectivo, poliza, orden);
|
||||
|
||||
try
|
||||
{
|
||||
//sqlSelect = "select distinct(autorizacion) from tapresca_tarisan where prescriptor = "+ strMedico + " and colec = "+ colectivo + " and poliza = "+ poliza + " and orden = "+ orden;
|
||||
if ((tarjeta.compareTo("")!=0)&&(tarjeta.compareTo("0")!=0)){
|
||||
if (medico==0){
|
||||
sqlSelect = "select distinct(autorizacion) from tapresca_tarisan where tarjeta = "+ tarjeta;
|
||||
}else{
|
||||
sqlSelect = "select distinct(autorizacion) from tapresca_tarisan where prescriptor = "+ medico + " and tarjeta = "+ tarjeta;
|
||||
}
|
||||
}else{
|
||||
if (medico==0){
|
||||
sqlSelect = "select distinct(autorizacion) from tapresca_tarisan where tarjeta = "+ tarjetaChipcard;
|
||||
}else{
|
||||
sqlSelect = "select distinct(autorizacion) from tapresca_tarisan where prescriptor = "+ medico + " and tarjeta = "+ tarjetaChipcard;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Connection conexion = ParametrosConfiguracion.dataStore.obtenerConexion();
|
||||
|
||||
ResultSet rs = ParametrosConfiguracion.dataStore.seleccionar(conexion, sqlSelect.toString());
|
||||
objPaginacion.inicializarPaginacion(rs);
|
||||
if (objPaginacion.getNumeroRegistrosTotales()!=0)
|
||||
{
|
||||
objPaginacion.realizarPaginacion(rs, pagina);
|
||||
|
||||
while(rs.next() && (elementosPaginacion <= Paginacion.getFilasPorPagina()))
|
||||
{
|
||||
int autorizacion = rs.getInt("AUTORIZACION");
|
||||
autorizaciones.addElement(autorizacion);
|
||||
if (pagina!=0) //Se quiere realizar la paginacion
|
||||
elementosPaginacion++;
|
||||
}
|
||||
}
|
||||
rs.close();
|
||||
}
|
||||
catch (ExcepcionTarisan e) {
|
||||
LogTarisan.logger.log(NivelLog.ERROR, "Error en la selección de la peticion del paciente: " + e.toString() + " (" + sqlSelect + ")");
|
||||
} catch (SQLException e) {
|
||||
LogTarisan.logger.log(NivelLog.ERROR, "Error en la selección de la peticion del paciente: " + e.toString() + " (" + sqlSelect + ")");
|
||||
}
|
||||
return autorizaciones;
|
||||
}
|
||||
|
||||
public boolean existePeticion(long autorizacion)
|
||||
{
|
||||
boolean resultado= false;
|
||||
StringBuffer strSql = new StringBuffer();
|
||||
Object aCondiciones[]=null;
|
||||
|
||||
try
|
||||
{
|
||||
strSql.append("SELECT *");
|
||||
strSql.append(" FROM tapresca_tarisan");
|
||||
strSql.append(" WHERE tapresca_tarisan.AUTORIZACION=?");
|
||||
|
||||
aCondiciones = new Object[1];
|
||||
aCondiciones[0] = Long.valueOf(autorizacion);
|
||||
|
||||
Connection conexion = ParametrosConfiguracion.dataStore.obtenerConexion();
|
||||
ResultSet rs = ParametrosConfiguracion.dataStore.seleccionar(conexion, strSql.toString(), aCondiciones);
|
||||
|
||||
if(rs.next())
|
||||
{
|
||||
resultado = true;
|
||||
}
|
||||
rs.close();
|
||||
ParametrosConfiguracion.dataStore.liberarConexion(conexion);
|
||||
LogTarisan.logger.log(NivelLog.DEBUG, "Seleccionada la petición analítica " + autorizacion + " de la tabla tapresca_tarisan (" + strSql.toString() + ")");
|
||||
}
|
||||
|
||||
catch (ExcepcionTarisan sqle)
|
||||
{
|
||||
LogTarisan.logger.log(NivelLog.ERROR, "Error en la selección de tapresca_tarisan: " + sqle + " (" + strSql.toString() + ")");
|
||||
}
|
||||
catch(SQLException sqle)
|
||||
{
|
||||
LogTarisan.logger.log(NivelLog.ERROR, "Error en la selección de tapresca_tarisan: " + sqle + " (" + strSql.toString() + ")");
|
||||
}
|
||||
catch(Exception sqle)
|
||||
{
|
||||
LogTarisan.logger.log(NivelLog.ERROR, "Error en la selección de tapresca_tarisan: " + sqle + " (" + strSql.toString() + ")");
|
||||
}
|
||||
|
||||
|
||||
return resultado;
|
||||
}
|
||||
|
||||
public Vector listado_peticiones_por_paciente(int medico, Paciente pac, int intPagina, int tipo_peticion) throws SQLException
|
||||
{
|
||||
int elementosPaginacion=1;
|
||||
Vector resul = new Vector();
|
||||
Tapresca tapresca = null;
|
||||
String consulta = "";
|
||||
String tarDespla = "";
|
||||
String tarjeta = "";
|
||||
String strMedico = ""+medico;
|
||||
|
||||
if(pac.getDesplazado() == null)
|
||||
pac.setDesplazado(pac.getTarjeta().getEntidadChipcard());
|
||||
|
||||
tarjeta=(Integer.valueOf( pac.getTarjeta().getTarjeta())).toString();
|
||||
tarDespla=new String( pac.getTarjeta().getTarjetaDesplazado());
|
||||
|
||||
if (tarjeta != null & tarjeta.compareTo("")!=0){
|
||||
if (tarDespla != null & tarDespla.compareTo("")!=0){
|
||||
|
||||
consulta = "SELECT DISTINCT(AUTORIZACION), ESPECIALIDAD, FECHA, TEXTO FROM TAPRESCA_TARISAN WHERE (TARJETA = '" + tarjeta +"' OR TARJETA = '" + tarDespla +"') AND PRESCRIPTOR = '" + medico +"' AND TIPO_PETICION = '" + tipo_peticion +"' ORDER BY AUTORIZACION DESC";
|
||||
}else{
|
||||
consulta = "SELECT AUTORIZACION, ESPECIALIDAD, FECHA, TEXTO FROM TAPRESCA_TARISAN WHERE TARJETA = '" + tarjeta +"' AND PRESCRIPTOR = '" + medico +"' AND TIPO_PETICION = '" + tipo_peticion +"' ORDER BY AUTORIZACION DESC";
|
||||
}
|
||||
}else{
|
||||
consulta = "SELECT AUTORIZACION, ESPECIALIDAD, FECHA, TEXTO FROM TAPRESCA_TARISAN WHERE TARJETA = '" + tarDespla +"' AND PRESCRIPTOR = '" + medico +"' AND TIPO_PETICION = '" + tipo_peticion +"' ORDER BY AUTORIZACION DESC";
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
Connection conexion = ParametrosConfiguracion.dataStore.obtenerConexion();
|
||||
ResultSet rs = ParametrosConfiguracion.dataStore.seleccionar(conexion, consulta);
|
||||
objPaginacion.inicializarPaginacion(rs);
|
||||
if (objPaginacion.getNumeroRegistrosTotales()!=0)
|
||||
{
|
||||
objPaginacion.realizarPaginacion(rs, intPagina);
|
||||
|
||||
while(rs.next() && (elementosPaginacion <= Paginacion.getFilasPorPagina()))
|
||||
{
|
||||
DES encrypter = new DES(strMedico);
|
||||
String auto = rs.getString("AUTORIZACION");
|
||||
/*auto = (auto.length()<8)?"0"+auto:auto;*/
|
||||
String autoEncriptada = encrypter.encrypt(auto);
|
||||
|
||||
tapresca = new Tapresca();
|
||||
tapresca.setTexto(rs.getString("TEXTO"));
|
||||
tapresca.setFecha(rs.getDate("FECHA"));
|
||||
tapresca.setAutorizacion(rs.getLong("AUTORIZACION"));
|
||||
tapresca.setAutorizacionEncriptada(autoEncriptada);
|
||||
tapresca.setEspecialidad(rs.getInt("ESPECIALIDAD"));
|
||||
resul.addElement(tapresca);
|
||||
if (intPagina!=0) //Se quiere realizar la paginacion
|
||||
elementosPaginacion++;
|
||||
}
|
||||
}
|
||||
rs.close();
|
||||
|
||||
ParametrosConfiguracion.dataStore.liberarConexion(conexion);
|
||||
LogTarisan.logger.log(NivelLog.DEBUG, "Seleccionados " + resul.size() + " registros de tapresca_tarisan (" + consulta + ")");
|
||||
} catch (ExcepcionTarisan e) {
|
||||
LogTarisan.logger.log(NivelLog.ERROR, "Error en la selección de Tapresca_tarisan (listado_peticiones_por_paciente): " + e + " (" + consulta + ")");
|
||||
}
|
||||
|
||||
|
||||
return resul;
|
||||
}
|
||||
|
||||
public Vector obtenerEspecialidadOtrasPeticiones(long autorizacion) throws ExcepcionTarisan
|
||||
{
|
||||
int elementosPaginacion=1;
|
||||
|
||||
Vector vResultado = new Vector();
|
||||
Tapresca tapresca_tarisan = null;
|
||||
StringBuffer strSql = new StringBuffer();
|
||||
Object aCondiciones[]=null;
|
||||
|
||||
try
|
||||
{
|
||||
strSql.append("SELECT tapresca_tarisan.ESPECIALIDAD,tapresca_tarisan.TEXTO");
|
||||
strSql.append(" FROM tapresca_tarisan");
|
||||
strSql.append(" WHERE tapresca_tarisan.AUTORIZACION=?");
|
||||
|
||||
aCondiciones = new Object[1];
|
||||
aCondiciones[0] = Long.valueOf(autorizacion);
|
||||
|
||||
Connection conexion = ParametrosConfiguracion.dataStore.obtenerConexion();
|
||||
ResultSet rs = ParametrosConfiguracion.dataStore.seleccionar(conexion, strSql.toString(), aCondiciones);
|
||||
|
||||
while(rs.next())
|
||||
{
|
||||
tapresca_tarisan = new Tapresca();
|
||||
tapresca_tarisan.setEspecialidad(rs.getInt("ESPECIALIDAD"));
|
||||
tapresca_tarisan.setTexto(rs.getString("TEXTO"));
|
||||
vResultado.addElement(tapresca_tarisan);
|
||||
}
|
||||
rs.close();
|
||||
ParametrosConfiguracion.dataStore.liberarConexion(conexion);
|
||||
LogTarisan.logger.log(NivelLog.DEBUG, "Seleccionados " + vResultado.size() + " registros de la tabla tapresca_tarisan (" + strSql.toString() + ")");
|
||||
}
|
||||
|
||||
catch (ExcepcionTarisan sqle)
|
||||
{
|
||||
LogTarisan.logger.log(NivelLog.ERROR, "Error en la selección de tapresca_tarisan: " + sqle + " (" + strSql.toString() + ")");
|
||||
throw (ExcepcionTarisan)sqle;
|
||||
}
|
||||
catch(SQLException sqle)
|
||||
{
|
||||
LogTarisan.logger.log(NivelLog.ERROR, "Error en la selección de tapresca_tarisan: " + sqle + " (" + strSql.toString() + ")");
|
||||
throw new ExcepcionTarisan(sqle.getMessage());
|
||||
}
|
||||
catch(Exception sqle)
|
||||
{
|
||||
LogTarisan.logger.log(NivelLog.ERROR, "Error en la selección de tapresca_tarisan: " + sqle + " (" + strSql.toString() + ")");
|
||||
throw new ExcepcionTarisan(sqle.getMessage());
|
||||
}
|
||||
catch(Throwable sqle)
|
||||
{
|
||||
LogTarisan.logger.log(NivelLog.ERROR, "Error en la selección de tapresca_tarisan: " + sqle + " (" + strSql.toString() + ")");
|
||||
throw new ExcepcionTarisan(sqle.getMessage());
|
||||
|
||||
}
|
||||
|
||||
return vResultado;
|
||||
}
|
||||
|
||||
public Vector obtenerDatosAutorizacion(long autorizacion) throws ExcepcionTarisan
|
||||
{
|
||||
int elementosPaginacion=1;
|
||||
|
||||
Vector vResultado = new Vector();
|
||||
Tapresca tapresca_tarisan = null;
|
||||
StringBuffer strSql = new StringBuffer();
|
||||
Object aCondiciones[]=null;
|
||||
|
||||
try
|
||||
{
|
||||
strSql.append("SELECT tapresca_tarisan.ACTO,tapresca_tarisan.ESPECIALIDAD,tapresca_tarisan.TEXTO");
|
||||
strSql.append(" FROM tapresca_tarisan");
|
||||
strSql.append(" WHERE tapresca_tarisan.AUTORIZACION=?");
|
||||
|
||||
aCondiciones = new Object[1];
|
||||
aCondiciones[0] = Long.valueOf(autorizacion);
|
||||
|
||||
Connection conexion = ParametrosConfiguracion.dataStore.obtenerConexion();
|
||||
ResultSet rs = ParametrosConfiguracion.dataStore.seleccionar(conexion, strSql.toString(), aCondiciones);
|
||||
|
||||
while(rs.next())
|
||||
{
|
||||
tapresca_tarisan = new Tapresca();
|
||||
tapresca_tarisan.setActo(rs.getInt("ACTO"));
|
||||
tapresca_tarisan.setEspecialidad(rs.getInt("ESPECIALIDAD"));
|
||||
tapresca_tarisan.setTexto(rs.getString("TEXTO"));
|
||||
vResultado.addElement(tapresca_tarisan);
|
||||
}
|
||||
rs.close();
|
||||
ParametrosConfiguracion.dataStore.liberarConexion(conexion);
|
||||
LogTarisan.logger.log(NivelLog.DEBUG, "Seleccionados " + vResultado.size() + " registros de la tabla tapresca_tarisan (" + strSql.toString() + ")");
|
||||
}
|
||||
|
||||
catch (ExcepcionTarisan sqle)
|
||||
{
|
||||
LogTarisan.logger.log(NivelLog.ERROR, "Error en la selección de tapresca_tarisan: " + sqle + " (" + strSql.toString() + ")");
|
||||
throw (ExcepcionTarisan)sqle;
|
||||
}
|
||||
catch(SQLException sqle)
|
||||
{
|
||||
LogTarisan.logger.log(NivelLog.ERROR, "Error en la selección de tapresca_tarisan: " + sqle + " (" + strSql.toString() + ")");
|
||||
throw new ExcepcionTarisan(sqle.getMessage());
|
||||
}
|
||||
catch(Exception sqle)
|
||||
{
|
||||
LogTarisan.logger.log(NivelLog.ERROR, "Error en la selección de tapresca_tarisan: " + sqle + " (" + strSql.toString() + ")");
|
||||
throw new ExcepcionTarisan(sqle.getMessage());
|
||||
}
|
||||
catch(Throwable sqle)
|
||||
{
|
||||
LogTarisan.logger.log(NivelLog.ERROR, "Error en la selección de tapresca_tarisan: " + sqle + " (" + strSql.toString() + ")");
|
||||
throw new ExcepcionTarisan(sqle.getMessage());
|
||||
|
||||
}
|
||||
|
||||
return vResultado;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user