Importing a defined package

Hi all, I'm having issues setting up packages and importing stuff between them.
My scenario is this
I have a package called WebUtils where I want to put all my web related classes.
I have a class called DatabaseConnection in the WebUtils package that my web stuff can access using import WebUtils.DatabaseConnection
I have another set of classes for manipulating XML that I want to put in package WebUtils.Xml.*
My problem is that the classes in WebUtils.Xml can't access the DatabaseConnection class. Is there a way for classes in WebUtils.Xml to access other parts in the package without changing my classpath?

It seems to be a common misconception that because packages share names, that they are somehow linked in java...
The packages WebUtils and WebUtils.Xml have no more in common as they do with, say, java.util. The names merely make it clear to whoever uses the packages that the classes are related.
In short, if you need to access a class in WebUtils you need to import WebUtils.*; and if you need to access a class in WebUtils.Xml, you need to import WebUtils.Xml.*;
In particular, the classes in WebUtils.Xml still need to import WebUtils.DataBaseConnection; in order to use it

Similar Messages

  • Importing user defined package in JDEV

    Hi,
    new to the JDEV9i tool. i have a project arranged in packages and am tryin to import this to the jdev9i. i successfully created the workspace and project and added all the packages. I can also view the package tree and package list but when i run my project the files in one directory import the files from the package structure.
    do i have to change Project properties?
    C:\jdev9i\jdev\mywork\Workspace1\Project1\websphinx\workbench\WebGraph.java
    Error(26,14): cannot access class graph.Graph; file graph\Graph.class not found

    It sounds like the Class path is not set up properly. You can configure this manually from the Project Settings dialog (Project > Project Settings). Alternatively, if you import all the packages from the top level, the path should be set for you automatically. For example, if you have your work in a directory structure like this:
    d:\mywork
    d:\mywork\toppackage
    Class1.java
    d:\mywork\toppackage\subpackage1
    Class2.java
    Class3.java
    d:\mywork\toppackage\subpackage2
    Class4.java
    Class5.java
    You can create a new project from existing source by creating a Workspace, then selecting File > New. In the Projects category there is an item called Project from Existing Source. Launch this wizard, and select the top level package from the directory listing (d:\mywork\toppackage in the example above). You then get the option to recurse through subdirectories, picking up all the classes along the way, and the paths will be set automatically. Note that you can use the Categories View button in the Navigator to view the files by package name.
    I hope this helps!
    -- Brian (JDev Team)
    Hi,
    new to the JDEV9i tool. i have a project arranged in packages and am tryin to import this to the jdev9i. i successfully created the workspace and project and added all the packages. I can also view the package tree and package list but when i run my project the files in one directory import the files from the package structure.
    do i have to change Project properties?
    C:\jdev9i\jdev\mywork\Workspace1\Project1\websphinx\workbench\WebGraph.java
    Error(26,14): cannot access class graph.Graph; file graph\Graph.class not found

  • Importing User defined package problem.

    Hi All,
    I have made to package, "forum" and "utility". DBhandler java file is in "utility" package and Forumhandler is in "forum" package.
    I want to import DBhandler classes from "utility" package into "forum" package for this i write
    "import utility.*" in forum package's Forumhandler java file. But it is giving error.
    The error is -
    forum/ForumHandler.java:13: cannot resolve symbol
    symbol : class DBHandler
    location: class forum.ForumHandler
    DBHandler dbhand = new DBHandler();

    forum/ForumHandler.java:13: cannot resolve symbol
    symbol : class DBHandler
    location: class forum.ForumHandler
    DBHandler dbhand = new DBHandler();
    Do you have your visibility right?
    The class DBHandler should be declared public.
    P.s. it's a bad practice to use wildcards for imports if you just want to import a few classes, use
    import my.company.product.utility.DBHandler;instead (or something similar).

  • How to use user-defined packages in JAX-RPC web service

    I am trying to use Object of my class located in my package in jax-rpc webservice,the code is
    package supercomputer;
    import Hello.*;
    public class SuperImpl implements SuperIF
    public String sendParam(String data)
    Temp ob=new Temp();
    int i=ob.get1(10000);
    return data+"returned by supercomputer";
    Temp is located in Hello package,I have jar the Hello package as Hello.jar and has set its classpath in targets.xml of Ant tool.
    The code compiles well and service is deployed successfully,but when i try to call the service from the client its gives me following error.
    [echo] Running the supercomputer.SuperClient program....
    [java] java.rmi.ServerException: Missing port information
    [java] at com.sun.xml.rpc.client.StreamingSender._raiseFault(StreamingSender.java:357)
    [java] at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:228)
    [java] at supercomputer.SuperIF_Stub.sendParam(SuperIF_Stub.java:60)
    [java] at supercomputer.SuperClient.main(Unknown Source)
    I dont know if it deploys why it gives error on client side.
    Please tell how to use user-defined packages and class in jax-rpc service code ,i am not talking about passing user-defined parameters i am just talking about making objects of user defined classes in jax-rpc service.I think there is some problem in classpath.
    Please guide me in doing that.
    Thanks,
    Farrukh

    Farrukh,
    I don't know if your error is about a missing class from your custom package, ... what track did you followed to say that?
    To use your package in the implementation of you web service, you should only follow the rules of making a web application: put your package jar in your \lib directory inside WEB-INF/ or your package classes unjared in classes (also in WEB-INF/).
    As I already said, I have doubts that your error should be originated from a missing class from your package, but:
    -try to see the logs (errors?) when you deploy your web service that could give a hint about the problem.
    -try to see if you can access your endpoint through your browser to see if there is a online status
    -display your config/WSDL file, and the steps you did to build your web service.
    regards,
    Pedro Salazar.

  • Import a single Package from dmp

    Hi,
    Is this posible the we can import an single package from a dmp file ?
    If yes please give the syntex.
    Thanks
    Nitesh

    Oracle Version.
    SQL> host exp hr/hr
    SQL> host imp hr/hr show=y
    "end;"
    "CREATE PACKAGE emp_stuff AS"
    " CURSOR c1 RETURN employees%ROWTYPE; -- declare cursor spec"
    "END emp_stuff;"
    "CREATE PACKAGE BODY emp_stuff AS"
    " CURSOR c1 RETURN employees%ROWTYPE IS"
    " SELECT * FROM employees WHERE salary > 2500; -- define cursor body"
    "END emp_stuff;"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Purpose of Update/Overwrite Hierarchy in Import master data package

    Hi All,
    Please let me know what is the difference in update and overwrite option in import master data package. Here when i tried running the package, both the option are altering the hierarchy of existing member.
    My requirement is just to add a new member ID, if it already exist it should not affect those records and only update the new master data records.
    Thanks & Regards,
    Ramanathan

    Hi Ramanathan,
    You can run Import Master Data DM package in BPC to perform delta master data load. While you run DM package you get option to load Master Data from BW/BI where you can select:
    1. MERGE: this will keep old data intact and also load new master data, and
    2. COPY and REPLACE: This will copy new data and delete old master data.
    As per your requirement, you need to select the First option. If you select Update option then it will not delete old master data, instead update the members and hierarchy according to the parent-children design which you would have given in the dimension membersheet.
    Hope this corresponds to your requirement.
    Rgds,
    Poonam

  • How to import user defined class in UIX page?

    Does anyone know how to import user defined class in UIX page so that the class can be called in the javascript in the UIX ?
    Thks & Rgds,
    Benny

    what you are referring to is not javascript.
    it is JSP scriptlets. These are very different.
    In order to keep a strict separation between View and Controller, it is not possible to run arbitrary java code from within your UIX code.
    However, you can run java code from within a UIX event handler; see:
    http://otn.oracle.com/jdeveloper/help/topic?inOHW=true&linkHelp=false&file=jar%3Afile%3A/u01/app/oracle/product/IAS904/j2ee/OC4J_ohw/applications/jdeveloper904/jdeveloper/helpsets/jdeveloper/uixhelp.jar!/uixdevguide/introducingbaja.html
    event handler code is run before the page is rendered.

  • How to import a tcl package in Java

    Hi,
    I want to convert an existing tcl file into a java source file. In my existing tcl file, some tcl packages have been imported, using the syntax
    package requires XML
    where "XML" is the name of a tcl package.
    But I am not sure how to import this tcl package in my Java code. Also, how can i call tcl procedures from Java code. The tcl package file contains a set of tcl procedures.
    Please let me know that
    1> How can I import/call a tcl package in a Java code.
    2> How can I call a tcl procedure in a Java code. The tcl procedure is contained in the tcl package file.

    I have searched the url provided by you. But I couldn't find anything relevant to my requirements.
    They have basically explained about how to call a Java program from a tcl code using java::call command
    But they haven't provided anything related to importing tcl package files inside java source.
    Please let me know your opinion on this issue.

  • Import javax.mail package does not exists

    Hi,
    when i tried to compile the source code for email using jdk1.3.1, it compiled fine. but when i tried to compile using jdk1.4.., it had the following errors such as
    import javax.mail package does not exists,
    import javax.mail.internet package does not exists
    package javax.activation does not exist
    Is it because of the jdk version problem???
    Pls help me

    I have the same problem with javax.ejb
    Now i've downloaded and installed the j2ee and set my classpath to the j2ee.jar. I've had to make a new path cause i'm running XP.
    This doesn't work.
    to compile it in Jcreator or JBuilder I can make it work by adding this package (j2ee.jar) in the project settings - required libraries.
    But I have to do this for every project again and again.
    I can make it work but i thougt the classpath would be enough ??
    Bassegio

  • How to make an applet load user-defined package?

    How to have an applet load user-defined package?
    I have packages in their own directories, and the applet compiles and links with them, by use of CLASSPATH env variable. But when it comes time to run, it ignores that and does not know where the classes (in the packages) are.
    If I don't use packages and put all code in one directory, runs fine. If I use an application, I can link with and load my packages.
    I know applets can't use things like CLASSPATH for security reasons, but still, they should be able to be compiled out of several packages, why do I have to put all code together??

    OK, for reference for future newbies, here's the answer:
    use CODEBASE attribute in your html file (if on Windows server, don't use drive letter but relative path to .html file, Unix style, and put all your .class files beneath that, for example, in your .html file
    <applet
    CODEBASE="..\class
    and then have package bar Bar.class file, in ..\class\bar

  • Problem in importing ESS Business Package in EP 5.0

    Hi
    I am aiming at importing the ESS 4.6C Business Package which is a zip file into EP 5.0. At the time of import i receive a prompt saying that the files with only the following extensions can be imported into the portal.
    The file extensions that can be imported into the portal:
    CDF, XML, IVU, PCK, IVS, PAG, PGS, ROL, FLD, PIV, TPL.
    Can anyone suggest the method of importing the ESS Package into EP 5.0?
    Thanks in advance
    Regards
    Priya

    Hi
    Check the zip file to see if there is a .pkg file, the pkg file contain definitions on what are the associated files (CDF, XML, IVU, PCK, IVS, PAG, PGS, ROL, FLD, PIV, TPL). Try importing the pkg file (unzip zip).
    Regards
    Pran

  • How to Import a DTS Package, while keeping version History in Destination Intact

    Hi Guys,
    Not sure if this is the right forum for my question. But I couldn't find any other DTS forum to post my query.
    Basically, I have my Production Environment in SQL 2008R2 and it contains few DTS [NOT SSIS!!!!] packages in Management > Legacy. One of those packages, Let's say is, 'PackageA.dts'.
    Now for the PackageA, we have versions of last couple of years (almost 11 versions we have for this package), recently in Test Environment (again, SQL 2008R2) we made Lot of changes to that Package and now we want bring that package from Test Env. to Production.
    But a) we prefer not to 'open it in Prod then make all individual changes one by one' rather we just need to kind of overwrite/replace our existing Production Package   b) also, we don't want to loose version  history for the Existing PackageA.dts
    in Production, so anytime we can rollback when required.
    Any Idea if I can? [Please don't post non relevant answer like, convert DTS to SSIS. Sorry if I sound rude, really will appreciate if some one can try helping me.]  
    Regards, Avik M.

    Hi ArthurZ... "...No deletions, just import, it overrides the prod package" --- Is that the
    case? If so, it could have resolved my issue I guess. But that's not happening...
    If I don't delete and try to import same named package, I get below error::
    TITLE: Object Explorer
    DTS Package 'PackageA' already exists with a different ID in this category. (Microsoft OLE DB Provider for SQL Server)
    Regards, Avik M.
    EDIT: Also, I found another Post : dts-package-already-exists-with-different-id-in-this-category which
    says, we need to basically delete the existing Package to import same named package. -- Just opposite of what you mentioned ArthurZ. So what's the conclusion?
    I need to understand why the same package that I'm bringing from a different server is not just creating a new version if that package name already exists?
    Any workaround Microsoft?

  • Unable to import CRM Business Packager in the Portal

    I have downloaded the Business Package for CRM, but it was in Zip file.
    I was unable to import it in the Portal since EP6 format has to be in epa not zip?
    Please advise.
    AA

    Hi,
    CRM 4.0 Business package is available for EP 5.0 and above. When importing the business package do pay attention that you import a zip file that contains objects that are EP 5.0 version compatible such as files ending with the "PKG" extension. "EPA" extension is acceptable from EP 6.0 on.
    The package content will be available at "migrated content" in your PCD, after the import process is done.
    Regards,
    Haguy

  • How to view defination of already defined packages ?

    Hi,
    how can i view defination of a already defined package? Its spec and its body?

    Hi,
    user12222356 wrote:
    My package name is 'PackageTest1' , since at the time of creation i had given that name.
    But while writing this query
    select text from user_source where name='PacklageTest1'no row is selected, and when i give this command
    select text from user_source where name='PACKAGETEST1'defination is shown .But why only capital letter package name is identified ?One reason is that the names are different; there's an 'l' (5th character) in 'PacklageTest1', but not in 'PACKAGETEST1'.
    A more subtle reason is that identifiers in Oracle are case-sensitive. You can have one package called
    "PackageTest1", another called
    "Packagetest1" (with a small 't'), another called
    "PACKAGETEST1" (all capitals), another called
    "pAckAgEtEst1" (vowels capitalized),
    all in the same schema.
    Normally, the parser capitalizes all unquoted text, so if you say
    EXEC  packagetest1.foo ('Hello, world!');what actually gets compiled is
    EXEC  PACKAGETEST1.FOO ('Hello, world!');If you actually have an identifier with lower-case letters, then you have to use quotes around it; double-quotes, in places where you don't want it mistaken for a string literal:
    EXEC  "PackageTest1"."Foo" ('Hello, world!');or single-quotes when it really is a string literal:
    select       text                     -- Column name is actually TEXT, but lower-case will work here
    from      user_source                -- View name is actually USER_SOURCE, but lower-case will work here
    where     name     = 'PackageTest1'     -- String literal is already quoted
    and       type     = 'PACKAGE BODY'     -- If you don't want source code from package spec mixed in
    order by  line                    -- Only way to make sure output is in order
    ;

  • IMPORT USER DEFINED FIELD USING DTW

    Hi
    I want to IMPORT USER DEFINED FIELD OF SALE ORDER THAT ARE PRESENT IN ROW LEVEL AND DOCUMENT LEVEL
    USING DTW.
    SO PLZ GIVE ME SOLUTION FOR THAT.
    THANK YOU

    Hi,
    What is your B1 version and PL? Please do not use all CAPS. It is not polite.
    Thanks,
    Gordon

Maybe you are looking for

  • Is there continuous play of a song while importing cd's iTunes?

    I would like to know if there is a feature for, once the songs you are importing from a cd, when you play a song from the cd itself, if you hit the eject button while the song is playing, the song continues to play without delay. If there isn't, this

  • How to display an image in a Text Area

    Hi, I will like to display an image in a textarea that I created. Whereby, I will click on File>>Open>>then select an image from a file or folder. But when I select the image, all I see is a bunch of encrypted stuff. I will really appreciate it if so

  • EJBs in dynpro

    Hi all, I want to use  ejbs in my dynpro. In this case, is it required to use a command bean i.e an intermediate layer? The ejbs will have business functions. To use an ejb using a javabean model, i'll bind the context attributes of component to that

  • Problem with load balancing on ACE 4710

    Hello. I'm setting ACE4710. I'm using DSR (Direct server return). The load balancing cannot be distributed now. I append the network configuration. Could someone please help out? THANKS!

  • Issue in adobe forms(Printing table)

    Hi experts... I have one requirement.I have two tables in the form.In first table after each row second table should appear.This is done.But one issue is if no records are there in second table it should not appear in the form.i have written scriptin