Question: I am trying to store references of images in a SQL Server DB and store the actual images in a file server/folder. I am hoping someone could give me a link or code example on how to do this. I don't want to store BLOB in the database. 

I am using ASP.NET/C# to handle this.

Answer: 
[LiveConnect](http://jdk6.java.net/plugin2/liveconnect/) is what you're looking for. It allows you to define communication methods from JS to Java and viceversa. And it's a built-in technology in the JDK.
```
import javax.script.Invocable;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;

//JAVA

public class Main {
    public static void main(String[] args) throws Exception {
        ScriptEngineManager manager = new ScriptEngineManager();
        ScriptEngine engine = manager.getEngineByName("JavaScript");
        if (!(engine instanceof Invocable)) {
            System.out.println("Invoking methods is not supported.");
            return;
        }
        Invocable inv = (Invocable) engine;
        String scriptPath = "/Users/sheikhhussain/IdeaProjects/JavaHome/src/calculator.js";

        engine.eval("load('" + scriptPath + "')");

        Object calculator = engine.get("calculator");

        int x = 3;
        int y = 4;

        Object addResult = inv.invokeMethod(calculator, "add", x, y);
        Object subResult = inv.invokeMethod(calculator, "subtract", x, y);
        Object mulResult = inv.invokeMethod(calculator, "multiply", x, y);
        Object divResult = inv.invokeMethod(calculator, "divide", x, y);

        System.out.println(addResult.toString());
        System.out.println(subResult);
        System.out.println(mulResult);
        System.out.println(divResult);
    }
}

        // JAVASCRIPT

        var calculator = new Object();
        calculator.add = function (n1, n2) "jjj";
        calculator.subtract = function (n1, n2) n1 - n2;
        calculator.multiply = function (n1, n2) n1 * n2;
        calculator.divide = function (n1, n2) n1 / n2;

```