Añado los fuentes de java
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
package com.tarisan.chipcard.tpvvs.webservicetrayicon.accesodatos;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import es.chipcard.util.*;
|
||||
|
||||
/*****
|
||||
* Clase base de los objetos de acceso a Datos
|
||||
* @author jjrider
|
||||
*
|
||||
*/
|
||||
public abstract class ClsDBBase {
|
||||
private static java.util.HashMap hshExistTable=new java.util.HashMap();
|
||||
|
||||
public ClsDBBase(){
|
||||
checkExists();
|
||||
}
|
||||
|
||||
public void checkExists(){
|
||||
if(!tableExistLocally()){
|
||||
createLocalTable();
|
||||
}
|
||||
}
|
||||
|
||||
public abstract String getTableName();
|
||||
|
||||
protected abstract int createLocalTable();
|
||||
|
||||
public boolean tableExistLocally(){
|
||||
if(hshExistTable.containsKey(getTableName()))
|
||||
return true;
|
||||
boolean blnRetorno=false;
|
||||
ResultSet rs=LocalDatabaseControl.getInstance().getQuery("SELECT * FROM SYS.SYSTABLES WHERE TABLENAME='"+getTableName()+"'");
|
||||
if(rs!=null){
|
||||
try{
|
||||
if(rs.next()){
|
||||
blnRetorno=true;
|
||||
hshExistTable.put(getTableName(),getTableName());
|
||||
}
|
||||
}catch(Exception err){
|
||||
SerClsDebug.aLog(err);
|
||||
}
|
||||
}
|
||||
LocalDatabaseControl.forceClose(rs);
|
||||
return blnRetorno;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user