1 2 Previous Next 23 Replies Latest reply: Dec 1, 2011 9:18 PM by 6363 Go to original post RSS
      • 15. Re: two basic questions
        HarshaJ
        I'm also just now started to learn but i think loadjava comes with java, this should work from your command prompt.
        try to fix it first. I think your loadjava does not work,

        then try to follow this guide;
        Oracle® Database Java Developer's Guide
        http://docs.oracle.com/cd/B19306_01/java.102/b14187/toc.htm



        http://docs.oracle.com/cd/B19306_01/java.102/b14187/cheleven.htm#CACFHDJE

        The loadjava tool creates schema objects from files and loads them into a schema. Schema objects can be created from Java source, class, and data files. loadjava can also create schema objects from SQLJ files.


        Cheers,
        • 16. Re: two basic questions
          user492279
          Can you check if:
          * loadjava is present in the bin directory in your oracle home (from your previous posts, I understand that your oracle home is somewhere on your D: drive)
          * the bin directory of your oracle home is in the path
          ?
          • 17. Re: two basic questions
            Hjava
            thank you for the replies, just have time to come back
            'this_executable_is_not_in_my_PATH'
            I still need a guide, I can get the java class, that means my JDK is install on my local, is that I need to some jdbc to make a connection between tha java and oracle?

            just like java and mysql??
            oadjava is present in the bin directory in your oracle home (from your previous posts, I understand that your oracle home is somewhere on your D: drive)
            * the bin directory of your oracle home is in the path
            do you mean my jdk path
            classpath
            .;\D:\jdk1.6.0_11\lib\tools.jar
            path
            D:\oraclexe\app\oracle\product\10.2.0\server\bin;D:\jdk1.6.0_11\bin
            java home
            D:\jdk1.6.0_11

            Edited by: Hjava on Nov 27, 2011 5:20 AM
            • 18. Re: two basic questions
              Peter Gjelstrup
              Hjava wrote:
              I still need a guide, I can get the java class, that means my JDK is install on my local, is that I need to some jdbc to make a connection between tha java and oracle?
              The best guide you can get is in the docs, already linked to. Since you refuse to read them ;), here's a copy paste from it:





              user
              {-user | -u} user/password[@database_url]

              By default, loadjava loads into the logged in schema specified by the -user option. You use the -schema option to specify a different schema to load into. This does not require you to log in to that schema, but does require that you have sufficient permissions to alter the schema.

              The permissible forms of *@database_url depend on whether you specify -oci or -thin*, as described:

              -oci:@database_url is optional. If you do not specify, then loadjava uses the user's default database. If specified, database_url can be a TNS name or an Oracle Net Services name-value list.

              -thin:@database_url is required. The format is host:lport:SID.

              where:

              host is the name of the computer running the database.

              lport is the listener port that has been configured to listen for Oracle Net Services connections. In a default installation, it is 5521.

              SID is the database instance identifier. In a default installation, it is ORCL.

              The following are examples of loadjava commands:

              Connect to the default database with the default OCI driver, load the files in a JAR into the TEST schema, and then resolve them:

              loadjava -u joe/shmoe -resolve -schema TEST ServerObjects.jar


              Connect with the JDBC Thin driver, load a class and a resource file, and resolve each class:

              loadjava -thin -u SCOTT/TIGER@dbhost:5521:orcl \
              -resolve alpha.class beta.props


              Add Betty and Bob to the users who can run alpha.class:

              loadjava -thin -schema test -u SCOTT/TIGER@localhost:5521:orcl \
              -grant BETTY,BOB alpha.class



              Regards
              Peter
              • 19. Re: two basic questions
                user492279
                Please check if loadjava.bat is present in directory D:\oraclexe\app\oracle\product\10.2.0\server\bin.
                • 20. Re: two basic questions
                  Hjava
                  Hi Peter,
                  Thank you for the reply,
                  1)I did read ,but I don't know what I miss, right now the only one can understand is
                  [http://www.oracleutilities.com/OSUtil/loadjava.html]
                  1) but i only get the class compile step, not the load step
                  D:\oraclexe\app\oracle\product\10.2.0\server\BIN>javac HelloWorldApp.java

                  D:\oraclexe\app\oracle\product\10.2.0\server\BIN>loadjava -user test/test HelloW
                  orldApp.class
                  'loadjava' is not recognized as an internal or external command,
                  operable program or batch file.
                  2)loadjava -u joe/shmoe -resolve -schema TEST ServerObjects.jar
                  do you suggest me to add the jdbc connect jar I download ojdbc6.jar, where I should put this jar file
                  3) should I set ORACLE_HOME , or class path inorder to let the java load work????

                  Thanks
                  • 21. Re: two basic questions
                    6363
                    Hjava wrote:

                    1) but i only get the class compile step, not the load step
                    D:\oraclexe\app\oracle\product\10.2.0\server\BIN>javac HelloWorldApp.java
                    You should always mention your database version and edition, from this path it appears you are running Oracle Express Edition 10.2.0

                    So the documentation you have been provided is for the main editions of Oracle database where it states

                    http://docs.oracle.com/cd/B28359_01/license.111/b28287/editions.htm

                    >
                    Note that Oracle Database XE is a separate product from the rest of the Oracle Database product family. The features available with Oracle Database XE are documented in Oracle Database Express Edition Licensing Information, which is installed along with the product itself.
                    >

                    And if we look there we find.

                    http://docs.oracle.com/cd/B25329_01/doc/license.102/b25456/toc.htm#BABHACFJ

                    >
                    Java support in the database No
                    >

                    So there is no loadjava with XE since you cannot run Java in the database with that product.
                    • 22. Re: two basic questions
                      Hjava
                      Thank you all,
                      not I get it ! two weeks late, I will have opportunity to touch java and oracle( new) for me, if I want to prepare for the new job on this perior, any suggestions?
                      • 23. Re: two basic questions
                        6363
                        You can download the enterprise edition for free for learning purposes if you need to explore java stored procedures.

                        http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html
                        1 2 Previous Next