ORACLE - SQL estructura jerarquica padre hijo

SELECT 
   ID, 
   ORGANIZACION, 
   ID_PADRE, 
   LEVEL, 
   SYS_CONNECT_BY_PATH(ORGANIZACION, '/')
FROM
   MV_AUX_ODS_ORG_UNITS
where 
   ACTIVE = 0
START WITH ID = 717
CONNECT BY PRIOR ID = F_PARENT_ID
ORDER SIBLINGS BY 
   NIVEL,
   ORGANIZACION;

ID ORGANIZACION ID_PADRE NIVEL PATH
717 D/TEC 758 1 /D/TEC
2077 TEC-E 717 2 /D/TEC/TEC-E
22687 TEC-EC 2077 3 /D/TEC/TEC-E/TEC-EC
22689 TEC-ECC 22687 4 /D/TEC/TEC-E/TEC-EC/TEC-ECC
22688 TEC-ECN 22687 4 /D/TEC/TEC-E/TEC-EC/TEC-ECN

Java - JSTL, random number between values

Add the bellow tag to your jsp page:

<jsp:useBean id="random" class="java.util.Random" scope="application"/>

, and the followin tag to generate your random number:

${random.nextInt(N)}

Particular case:
Generate a random number, between 1 and 4, in order to display a different background at each page refresh:

<img src="../img/background_${random.nextInt(3)+1}.jpg">

Java - SpringMVC NetworkError 406 Not Acceptable while using JSON

Problem:

"NetworkError 406 Not Acceptable" when calling a servlet using jQuery and expecting a JSON result.

function getRecipeNutritionalInformation(recipe) {
    $.getJSON("http://xxx/getRecipeNutritionalInformation?recipe=" + recipe, function(data){
        res=jQuery.stringify(data);
        $.each(data, function(index) {
            alert(index);
        });
    })
    .success(function() {
        alert("success");})
    .error(function(XMLHttpRequest, textStatus, errorThrown) {
        alert("textStatus "+textStatus);
        alert("errorThrown "+errorThrown);})
    .complete(function() {
        alert("complete");})
    ;
}

@RequestMapping(method=RequestMethod.GET, value="/getRecipeNutritionalInformation")
public @ResponseBody NutritionalFacts getRecipeNutritionalInformation(@RequestParam("recipe") String input) {
        (...)

Solution:

The JSON converting Maven dependencies (or plain libraries) might be missing on the project classpath:


        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
            <version>2.2.6</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-mapper-asl</artifactId>
            <version>1.4.2</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-core-asl</artifactId>
            <version>1.4.2</version>
        </dependency>


Java - Project properties Cannot nest inside library

Problem:

Cannot nest 'xxx/test/java' inside library 'xxx/src'



Solution:

Check the project properties libraries configuration, in my case the problem was in the "Web App Libraries" configuration. Once removed the problem was solved.