Executing java file from DB

Hi everyone,
I am not sure how logical my question is but it struck me so here I am.
For a application whose logic changes frequently, the problem with keeping the application up becomes a problem as there have to be a lot of deployments to keep the logic up to date.
Is it possible to store a Java file into DB and then at create its class at runtime and have it run on the Application Server.
I think we can store --> retrive---> and make an object of class at run time using normal sql queries and Reflections in Java but I am not sure how will it will behave when it runs on the App Server.
Anyone implemented such case.??
If yes ,is it advisable to go via this approach.What could be the pros and cons .
Thanks ,
Ankur

Replies

  • sookie
    sookie
    Hi ankur,

    I liked the idea..very useful where applications take lot of time to start. But I couldn't get one thing if you want to save .class file or .java file to save the time.

    I guess this is achievable, I haven't given a try but you can save the file as CLOB data type in database and change the deployment script/build script where you mention your .java/.class files path, you need to work hard bit on this thing. Retrieving the file from DB at run time or whatever is the requirement. Let us know if any issues.
  • Anoop Kumar
    Anoop Kumar
    when you are running a web/application server . server builds whole application that means server context is aware of every class file/file with compile timestamp before starting a application.you are asking for storing .class file in database retrieve it --> save in build path --> and use a reflections.
    I think it's not going to work.
    for try : configure a web project with tomcat and run it , As soon as you save the any java file context will be reloaded.
    On the other way you can store logic in database or properties files.
    If you elaborate you problem we can try some solution.😀
  • PraveenKumar Purushothaman
    PraveenKumar Purushothaman
    I guess storing the scripts inside database and executing them is not a good idea. In that case, you go into a issue of executing a vulnerable script from the database and there might be loop holes and possiblities are that your script and databases might be misused or compromised.
  • K!r@nS!ngu
    K!r@nS!ngu
    ankur8819
    Is it possible to store a Java file into DB and then at create its class at runtime and have it run on the Application Server.
    I am not sure whether it is possible or not but i admire you for the creative idea. I guess we can store Java files but running it should be done after retrieving it to the separate folder from DB.

    Anyways let me give a try...

You are reading an archived discussion.

Related Posts

Hi again,I have another problem to solve. What is the integral of cos^3xcos3x dx from 0 to pi/2?? I tried to use: cos^3x=(1-sin^2x)cosx =cosx-sin^2xcosx So now it becomes IN{0 to...
We all have different perceptions about money (we need in store). How much should we prioritize on making money? Pursuing your passions not always guarantee you huge amounts of ready...
Someone,I need help in this.I have the answer but I can't think of a solution.I have tried a few things,though... Parameterization of the leaf of Descartes. y=tx => x= (3at)/(1+t^3)...
i need project ideas for my mini project . i would like to do project involving micro-controllers. preferably using AT89c51. can anyone help me as am totally blank . can't...
Prof.Anant Agarwal scores a century stuffing 100 cores on one chip. As if that is not enough, he may be eyeing putting a 1000. He may overtake Sachins run record...