javadatabaseoracle-databaseonline-compilation

Is it possible to install Java compiler in a database?


In order to make an online compiler, I want to compile a piece of code and send back the result.

Instead of giving the path to the hard disk, can I call a query which in return compiles the code (not by giving any links to javac hard disk location) but the files located in DB (BLOB).


Solution

  • Most databases allow you to create user defined functions. You could define such a UDF taking source code as the input and returning object code as the output.

    This seems kind of pointless though since you are pushing this non-analytical computation into the database which is not designed yo do such things, whereas pulling the source from the database and writing the object code back is likely as efficient and much easier to implement and maintain.