public String validateLanguage(String AD_Language){
  String sql="SELECT * " + "FROM AD_Language " + "WHERE AD_Language=?";
  MLanguage language=null;
  try {
    PreparedStatement pstmt=DB.prepareStatement(sql,null);
    pstmt.setString(1,AD_Language);
    ResultSet rs=pstmt.executeQuery();
    if (rs.next())     language=new MLanguage(m_ctx,rs,null);
    rs.close();
    pstmt.close();
  }
 catch (  SQLException e) {
    log.log(Level.SEVERE,sql,e);
    return e.toString();
  }
  if (language == null) {
    log.log(Level.SEVERE,"Language does not exist: " + AD_Language);
    return "Language does not exist: " + AD_Language;
  }
  if (language.isActive()) {
    if (language.isBaseLanguage())     return "";
  }
 else {
    log.log(Level.SEVERE,"Language not active or not system language: " + AD_Language);
    return "Language not active or not system language: " + AD_Language;
  }
  log.info("Start Validating ... " + language);
  language.maintain(true);
  return "";
}

public String validateLanguage ( String AD_Language ) { String sql = "SELECT * " + "FROM AD_Language " + "WHERE AD_Language=?" ; MLanguage language = null ; try { PreparedStatement pstmt = DB . prepareStatement ( sql , null ) ; pstmt . setString ( 1 , AD_Language ) ; ResultSet rs = pstmt . executeQuery ( ) ; if ( rs . next ( ) ) language = new MLanguage ( m_ctx , rs , null ) ; rs . close ( ) ; pstmt . close ( ) ; } catch ( SQLException e ) { log . log ( Level . SEVERE , sql , e ) ; return e . toString ( ) ; } if ( language == null ) { log . log ( Level . SEVERE , "Language does not exist: " + AD_Language ) ; return "Language does not exist: " + AD_Language ; } if ( language . isActive ( ) ) { if ( language . isBaseLanguage ( ) ) return "" ; } else { log . log ( Level . SEVERE , "Language not active or not system language: " + AD_Language ) ; return "Language not active or not system language: " + AD_Language ; } log . info ( "Start Validating ... " + language ) ; language . maintain ( true ) ; return "" ; }
validate language . - check if ad_language record exists - check trl table records
