How to drop java source from Oracle database properly?












2















I'm a little stuck here with my Java Source. First I want completly drop it from the database, because I want to recompile it, but I can't drop is, because if I execute this command:



drop java source "SCHEMA.JAVASOURCENAME";


I get this error:



ORA-04043: object JAVASOURCENAME does not exist


The Javasource itself has this structure (this is the plsql/java code for it):



create or replace and compile java source named myjavasource as

import java.io.*;
import some.custom.jar.one.*;
import some.custom.jar.two.*;
import some.custom.jar.three.*;

public class MyJavaClass
{
public static String myjavafunction(String connectString, String identity, String password)
{
...
}
}


I executed this "create or replace and compile java source..." command as DBA and with my user as well, I don't know if this can be the problem.



So my question is, how can I drop this java source?



My second question is who can I handle the custom jars? I imported them with this command:



call dbms_java.loadjava('-genmissing -r -v -force -grant SCHEMA ./some.custom.jar.one.jar');


I also executed this as DBA and with my user. If is check the invalid objects:



SELECT *
FROM user_objects
WHERE object_type like '%JAVA%'
AND status = 'INVALID'


as DBA I see the whole world invalid (lot of Java classes), but when I check this as user I only get the javasource and the java class name in the invalid list (I think it needs some more external jars, what I can't find right now).



So, why is the invalid java object list different as DBA and as user? Do I need to execute the Java source creation and the jar imports as DBA (and ONLY with DBA), or with the database user if I want to use it (the java funtion, what is using the external jars) with all schema users?



Thank you very much!










share|improve this question





























    2















    I'm a little stuck here with my Java Source. First I want completly drop it from the database, because I want to recompile it, but I can't drop is, because if I execute this command:



    drop java source "SCHEMA.JAVASOURCENAME";


    I get this error:



    ORA-04043: object JAVASOURCENAME does not exist


    The Javasource itself has this structure (this is the plsql/java code for it):



    create or replace and compile java source named myjavasource as

    import java.io.*;
    import some.custom.jar.one.*;
    import some.custom.jar.two.*;
    import some.custom.jar.three.*;

    public class MyJavaClass
    {
    public static String myjavafunction(String connectString, String identity, String password)
    {
    ...
    }
    }


    I executed this "create or replace and compile java source..." command as DBA and with my user as well, I don't know if this can be the problem.



    So my question is, how can I drop this java source?



    My second question is who can I handle the custom jars? I imported them with this command:



    call dbms_java.loadjava('-genmissing -r -v -force -grant SCHEMA ./some.custom.jar.one.jar');


    I also executed this as DBA and with my user. If is check the invalid objects:



    SELECT *
    FROM user_objects
    WHERE object_type like '%JAVA%'
    AND status = 'INVALID'


    as DBA I see the whole world invalid (lot of Java classes), but when I check this as user I only get the javasource and the java class name in the invalid list (I think it needs some more external jars, what I can't find right now).



    So, why is the invalid java object list different as DBA and as user? Do I need to execute the Java source creation and the jar imports as DBA (and ONLY with DBA), or with the database user if I want to use it (the java funtion, what is using the external jars) with all schema users?



    Thank you very much!










    share|improve this question



























      2












      2








      2


      1






      I'm a little stuck here with my Java Source. First I want completly drop it from the database, because I want to recompile it, but I can't drop is, because if I execute this command:



      drop java source "SCHEMA.JAVASOURCENAME";


      I get this error:



      ORA-04043: object JAVASOURCENAME does not exist


      The Javasource itself has this structure (this is the plsql/java code for it):



      create or replace and compile java source named myjavasource as

      import java.io.*;
      import some.custom.jar.one.*;
      import some.custom.jar.two.*;
      import some.custom.jar.three.*;

      public class MyJavaClass
      {
      public static String myjavafunction(String connectString, String identity, String password)
      {
      ...
      }
      }


      I executed this "create or replace and compile java source..." command as DBA and with my user as well, I don't know if this can be the problem.



      So my question is, how can I drop this java source?



      My second question is who can I handle the custom jars? I imported them with this command:



      call dbms_java.loadjava('-genmissing -r -v -force -grant SCHEMA ./some.custom.jar.one.jar');


      I also executed this as DBA and with my user. If is check the invalid objects:



      SELECT *
      FROM user_objects
      WHERE object_type like '%JAVA%'
      AND status = 'INVALID'


      as DBA I see the whole world invalid (lot of Java classes), but when I check this as user I only get the javasource and the java class name in the invalid list (I think it needs some more external jars, what I can't find right now).



      So, why is the invalid java object list different as DBA and as user? Do I need to execute the Java source creation and the jar imports as DBA (and ONLY with DBA), or with the database user if I want to use it (the java funtion, what is using the external jars) with all schema users?



      Thank you very much!










      share|improve this question
















      I'm a little stuck here with my Java Source. First I want completly drop it from the database, because I want to recompile it, but I can't drop is, because if I execute this command:



      drop java source "SCHEMA.JAVASOURCENAME";


      I get this error:



      ORA-04043: object JAVASOURCENAME does not exist


      The Javasource itself has this structure (this is the plsql/java code for it):



      create or replace and compile java source named myjavasource as

      import java.io.*;
      import some.custom.jar.one.*;
      import some.custom.jar.two.*;
      import some.custom.jar.three.*;

      public class MyJavaClass
      {
      public static String myjavafunction(String connectString, String identity, String password)
      {
      ...
      }
      }


      I executed this "create or replace and compile java source..." command as DBA and with my user as well, I don't know if this can be the problem.



      So my question is, how can I drop this java source?



      My second question is who can I handle the custom jars? I imported them with this command:



      call dbms_java.loadjava('-genmissing -r -v -force -grant SCHEMA ./some.custom.jar.one.jar');


      I also executed this as DBA and with my user. If is check the invalid objects:



      SELECT *
      FROM user_objects
      WHERE object_type like '%JAVA%'
      AND status = 'INVALID'


      as DBA I see the whole world invalid (lot of Java classes), but when I check this as user I only get the javasource and the java class name in the invalid list (I think it needs some more external jars, what I can't find right now).



      So, why is the invalid java object list different as DBA and as user? Do I need to execute the Java source creation and the jar imports as DBA (and ONLY with DBA), or with the database user if I want to use it (the java funtion, what is using the external jars) with all schema users?



      Thank you very much!







      oracle plsql java






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 5 hours ago









      Basil Bourque

      3,14822037




      3,14822037










      asked Sep 2 '15 at 7:31









      VORiANDVORiAND

      11824




      11824






















          1 Answer
          1






          active

          oldest

          votes


















          3














          Each element of a name must be quoted individually:



          drop java source "SCHEMA"."JAVASOURCENAME";


          The identifier "SCHEMA.JAVASOURCENAME" refers to a java source name SCHEMA.JAVASOURCENAME in the current schema, e.g. "VORIAND"."SCHEMA.JAVASOURCENAME"






          share|improve this answer
























          • Thanks, it solve the dropping part :) Can you help with the invalid object list and the jar import as well?

            – VORiAND
            Sep 2 '15 at 8:53











          • @VORiAND: sorry, never used Java stored procedures. It might be better to split your question into two questions. Asking several things at once in a single question is not such a good idea

            – a_horse_with_no_name
            Sep 2 '15 at 9:07













          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "182"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f112912%2fhow-to-drop-java-source-from-oracle-database-properly%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          3














          Each element of a name must be quoted individually:



          drop java source "SCHEMA"."JAVASOURCENAME";


          The identifier "SCHEMA.JAVASOURCENAME" refers to a java source name SCHEMA.JAVASOURCENAME in the current schema, e.g. "VORIAND"."SCHEMA.JAVASOURCENAME"






          share|improve this answer
























          • Thanks, it solve the dropping part :) Can you help with the invalid object list and the jar import as well?

            – VORiAND
            Sep 2 '15 at 8:53











          • @VORiAND: sorry, never used Java stored procedures. It might be better to split your question into two questions. Asking several things at once in a single question is not such a good idea

            – a_horse_with_no_name
            Sep 2 '15 at 9:07


















          3














          Each element of a name must be quoted individually:



          drop java source "SCHEMA"."JAVASOURCENAME";


          The identifier "SCHEMA.JAVASOURCENAME" refers to a java source name SCHEMA.JAVASOURCENAME in the current schema, e.g. "VORIAND"."SCHEMA.JAVASOURCENAME"






          share|improve this answer
























          • Thanks, it solve the dropping part :) Can you help with the invalid object list and the jar import as well?

            – VORiAND
            Sep 2 '15 at 8:53











          • @VORiAND: sorry, never used Java stored procedures. It might be better to split your question into two questions. Asking several things at once in a single question is not such a good idea

            – a_horse_with_no_name
            Sep 2 '15 at 9:07
















          3












          3








          3







          Each element of a name must be quoted individually:



          drop java source "SCHEMA"."JAVASOURCENAME";


          The identifier "SCHEMA.JAVASOURCENAME" refers to a java source name SCHEMA.JAVASOURCENAME in the current schema, e.g. "VORIAND"."SCHEMA.JAVASOURCENAME"






          share|improve this answer













          Each element of a name must be quoted individually:



          drop java source "SCHEMA"."JAVASOURCENAME";


          The identifier "SCHEMA.JAVASOURCENAME" refers to a java source name SCHEMA.JAVASOURCENAME in the current schema, e.g. "VORIAND"."SCHEMA.JAVASOURCENAME"







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Sep 2 '15 at 8:49









          a_horse_with_no_namea_horse_with_no_name

          39k775112




          39k775112













          • Thanks, it solve the dropping part :) Can you help with the invalid object list and the jar import as well?

            – VORiAND
            Sep 2 '15 at 8:53











          • @VORiAND: sorry, never used Java stored procedures. It might be better to split your question into two questions. Asking several things at once in a single question is not such a good idea

            – a_horse_with_no_name
            Sep 2 '15 at 9:07





















          • Thanks, it solve the dropping part :) Can you help with the invalid object list and the jar import as well?

            – VORiAND
            Sep 2 '15 at 8:53











          • @VORiAND: sorry, never used Java stored procedures. It might be better to split your question into two questions. Asking several things at once in a single question is not such a good idea

            – a_horse_with_no_name
            Sep 2 '15 at 9:07



















          Thanks, it solve the dropping part :) Can you help with the invalid object list and the jar import as well?

          – VORiAND
          Sep 2 '15 at 8:53





          Thanks, it solve the dropping part :) Can you help with the invalid object list and the jar import as well?

          – VORiAND
          Sep 2 '15 at 8:53













          @VORiAND: sorry, never used Java stored procedures. It might be better to split your question into two questions. Asking several things at once in a single question is not such a good idea

          – a_horse_with_no_name
          Sep 2 '15 at 9:07







          @VORiAND: sorry, never used Java stored procedures. It might be better to split your question into two questions. Asking several things at once in a single question is not such a good idea

          – a_horse_with_no_name
          Sep 2 '15 at 9:07




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Database Administrators Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f112912%2fhow-to-drop-java-source-from-oracle-database-properly%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          الفوسفات في المغرب

          Four equal circles intersect: What is the area of the small shaded portion and its height

          جامعة ليفربول