private static Boolean isShared(int AD_Client_ID,int AD_Table_ID){
  if (s_shares.isEmpty()) {
    String sql="SELECT AD_Client_ID, AD_Table_ID, ShareType " + "FROM AD_ClientShare WHERE ShareType<>'x' AND IsActive='Y'";
    PreparedStatement pstmt=null;
    try {
      pstmt=DB.prepareStatement(sql,null);
      ResultSet rs=pstmt.executeQuery();
      while (rs.next()) {
        int Client_ID=rs.getInt(1);
        int table_ID=rs.getInt(2);
        String key=Client_ID + "_" + table_ID;
        String ShareType=rs.getString(3);
        if (ShareType.equals(SHARETYPE_ClientAllShared))         s_shares.put(key,Boolean.TRUE);
 else         if (ShareType.equals(SHARETYPE_OrgNotShared))         s_shares.put(key,Boolean.FALSE);
      }
      rs.close();
      pstmt.close();
      pstmt=null;
    }
 catch (    Exception e) {
      s_log.log(Level.SEVERE,sql,e);
    }
    try {
      if (pstmt != null)       pstmt.close();
      pstmt=null;
    }
 catch (    Exception e) {
      pstmt=null;
    }
    if (s_shares.isEmpty())     s_shares.put("0_0",Boolean.TRUE);
  }
  String key=AD_Client_ID + "_" + AD_Table_ID;
  return s_shares.get(key);
}

private static Boolean isShared ( int AD_Client_ID , int AD_Table_ID ) { if ( s_shares . isEmpty ( ) ) { String sql = "SELECT AD_Client_ID, AD_Table_ID, ShareType " + "FROM AD_ClientShare WHERE ShareType<>'x' AND IsActive='Y'" ; PreparedStatement pstmt = null ; try { pstmt = DB . prepareStatement ( sql , null ) ; ResultSet rs = pstmt . executeQuery ( ) ; while ( rs . next ( ) ) { int Client_ID = rs . getInt ( 1 ) ; int table_ID = rs . getInt ( 2 ) ; String key = Client_ID + "_" + table_ID ; String ShareType = rs . getString ( 3 ) ; if ( ShareType . equals ( SHARETYPE_ClientAllShared ) ) s_shares . put ( key , Boolean . TRUE ) ; else if ( ShareType . equals ( SHARETYPE_OrgNotShared ) ) s_shares . put ( key , Boolean . FALSE ) ; } rs . close ( ) ; pstmt . close ( ) ; pstmt = null ; } catch ( Exception e ) { s_log . log ( Level . SEVERE , sql , e ) ; } try { if ( pstmt != null ) pstmt . close ( ) ; pstmt = null ; } catch ( Exception e ) { pstmt = null ; } if ( s_shares . isEmpty ( ) ) s_shares . put ( "0_0" , Boolean . TRUE ) ; } String key = AD_Client_ID + "_" + AD_Table_ID ; return s_shares . get ( key ) ; }
is table shared for client
