Basic package syntax

I'm creating a new class in a package called beans. Problem is, my attempts to create an object in the new file using the old file's class produces a "cannot resolve symbol" error. I've fiddled about but nothing's worked. Here's some snippets:
package pk;
public class Db implements java.io.Serializable {
    public Db() {
    private String update(Connection conn, String sql, Vector param) throws SQLException {
package pk;
public class X implements java.io.Serializable {
    public X() {
    private String InsertX(Connection conn) {
        Db db;
db.update(conn, sql, param);
}Both lines in InsertX fail. Thanks in advance for any help.

Are you using the -d option in javac to specify where your class files are to be stored? And, do you put the the same location in your classpath when you run java?
For example:
javac -d classes src/pk/Db.java
javac -classpath classes -d classes src/pk/X.java
// assume Db has a main method
java -classpath classes pk.Db.javaThis assumes you have a src/pk directory containing your source, and a classes directory where java automatically create a pk sub-directory to store your class files.
� {�                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • Instant client basic package usages needed

    Hi,
    I have installed oats in my laptop in windows xp operating system which is using the default database 10g express edition that comes along with the installation process of oats.
    Now i want to use the 11g database which is in oel5 in my desktop
    Both of the system are in a same network
    in order to connect,oats and 11g, the instant client basic package is needed and also the odbc supplement and i have downloaded both of the packages and extract them to the same directory in windows xp and the necessory changes have been made in system environment variable also
    when performing the system DSN test process it is failed and the error is occured TNS no listener
    help me pls

    I recommend that you do not install Instant Client on your laptop at all.
    Instead, use the Oracle client that is included in the 10g server.
    It is difficult to have more than one Oracle installation on one Windows machine, because Windows is not designed as a multi-user OS.
    All you have to do is change the connection string to point to the other database (the documentation of oats, whatever it is, should tell you how).
    Yours,
    Laurenz Albe

  • Help!!! How to get the recovery time of transient response of a power supply with Labview basic package without analysis option?

    How to get the recovery time of transient response of a power supply with Labview basic package without analysis option? Does anyone have any idea or some similar function SUBVIs?
    Recovery time of transient response is defined as the time from the beginning of the transient to the voltage point on the waveform fallen into 10percent of the overshoot. Well, the waveform is something like a pulse with a soft slope.

    I recommend plotting your data on a graph on paper. Take a look at the data, and determine what is unique about the point you are looking for. Look for how you can teach your program to look for this point.
    I have written several algorithms that do similar, one in fact being for a power supply, the other being for RPM. Neither algorithm used any advanced analysis tools. They are just a matter of determining, mathematically, when you achieve what you are looking for. Just sit down with your graph (I recommend multiple copies) and draw horizontal and vertical lines that determine when you get to the point you are looking for. You are probably going to have to reverse the array and start from the end, so think in those terms.
    If you have trouble, emai
    l me a bitmap of the graph, and what you are looking for and I will try to be of further assistance. Don't do that however; until you you have given this a few tries. Your solution should be involve a lot of logic on analog levels.
    Good luck

  • I bought the basic package of 9.99 dls with photoshop and lightroom , let me know as I do to install it on my PC and my laptop, I have to buy another license ?

    I bought the basic package of 9.99 dls with photoshop and lightroom , let me know as I do to install it on my PC and my laptop, I have to buy another license ?

    thank you... great!
    Dr. Manuel Jaime Dávila Márquez
    Zacatecas, Zac
    [email protected]

  • Create or Replace Package syntax different in SQL Navigator?

    Hi,
    I compared the same piece of code in both toad and sql navigator.
    In toad, the syntax for Package was as follows:
    CREATE OR REPLACE package body name_of_package
    but in SQL Navigator, the same code is displayed as follows:
    package body name_of_package
    does SQL navigator hide the "Create or replace" keywords? or does it automatically know that they belong there?

    Is Sql navigator an Oracle product? IIRC Larry spent already all his pocket money on buying Sun.
    Kindly do not clutter up this forum with questions on products not developed by Oracle.
    Sybrand Bakker
    Senior Oracle DBA

  • The Basic package says £0.77 but from reading the small print it seems to suggest this is only a trial period of 30 days when it rises to £11.99.

    Have I got this wrong?  The next package up from the Basic is only £8.99

    The difference is the FormsCentral Plus option is for a year-long subscription, while the Basic option is monthly. This sort of pricing scheme is fairly common.

  • Basic Package Deployment - Failed with exit code 1

    Hello everyone!
    I am new to SCCM and I am trying to create my first package and it is a basic one (I suppose).
    What I am trying to do is to install the File & Printer Sharing service on all Windows 7 computers in our domain. It is completely uninstalled (not only uncheck from the network adapter properties).
    I created a .cmd with these two lines
    cmd /c
    netcfg /c s /i MS_Server
    I create the package/program and configure it to download and run locally. I always get this error in execmgr : Script for Package:ALI00022, Program: File & Printer Sharing - Installation failed with exit code 1 execmgr 10/5/2014 5:55:43 PM 1712
    (0x06B0)
    I can see the package has been downloaded in the folder c:\windows\ccmcache\ of the client machine.
    When I launch the file there by running it as Administrator, it does work perfectly.
    When I launch the file by opening a command prompt (not running as administrator) it is not working. I am now supposing that the main problem I have is when my script need to be run as an administrator, it doesn't work.
    Thank you for your help!

    Ok,
    I used psexec to run the script in the SYSTEM context and it is working correctly.
    I tried to recreate a package in SCCM by using the command line only.
    here is what I got in my execmgr.log
    Successfully prepared command line "C:\Windows\system32\netcfg.exe" /c s /i MS_Server execmgr 10/6/2014 12:21:34 PM 3484 (0x0D9C)
    Command line = "C:\Windows\system32\netcfg.exe" /c s /i MS_Server, Working Directory = C:\Windows\system32\ execmgr 10/6/2014 12:21:34 PM 3484 (0x0D9C)
    Running "C:\Windows\system32\netcfg.exe" /c s /i MS_Server with 32bitLauncher execmgr 10/6/2014 12:21:34 PM 3484 (0x0D9C)
    CreateProcess or CreateProcessAsUser failed to execute command line with non-recoverable error 0x80070002 execmgr 10/6/2014 12:21:41 PM 3484 (0x0D9C)
    Raising event:
    [SMS_CodePage(437), SMS_LocaleID(1033)]
    instance of SoftDistProgramUnableToExecuteEvent
     AdvertisementId = "ALI2000D";
     ClientID = "GUID:D357F21F-E804-41AB-AB39-4B874C635118";
     CommandLine = "\"C:\\Windows\\system32\\netcfg.exe\" /c s /i MS_Server";
     DateTime = "20141006162141.138000+000";
     MachineName = "L1WIN7";
     PackageName = "ALI00023";
     ProcessID = 1940;
     ProgramName = "File & Printer Sharing - Installation";
     SiteCode = "ALI";
     ThreadID = 3484;
     Win32ErrorCode = 2147942402;
     WorkingDirectory = "C:\\Windows\\system32\\";
     execmgr 10/6/2014 12:21:41 PM 3484 (0x0D9C)
    Raised Program Unable to Execute Event for Ad:ALI2000D, Package:ALI00023, Program: File & Printer Sharing - Installation execmgr 10/6/2014 12:21:41 PM 3484 (0x0D9C)
    EnterRsRuningState failed to run script netcfg /c s /i MS_Server 0x87d01101 execmgr 10/6/2014 12:21:41 PM 3484 (0x0D9C)
    Fatal error 0x87d01101 enountered for program File & Printer Sharing - Installation. This program will not retry. execmgr 10/6/2014 12:21:42 PM 3484 (0x0D9C)

  • Very Basic Package and Import question

    Thanks in advance ...
    - I read/tried all tutorials and documents on the matter
    - the programs are from "Java 2 from scratch" book (Steven Haines)
    - I suspect the problems result from using new SDK 1.4.2 version versus SDK 1.2.1 (that the book uses)
    OK, here we go :
    package Stock1.PortfolioTotalsPanel;
    - first line in PortfolioTotalsPanels.java file
    package Stock1.StockTablePanel;
    - first line in StockTablePanel.java file
    package Stock1.StockTableTabPanel;
    - first line in StockTableTabPanel.java file
    --- then:
    Import Stock1.PortfolioTotalsPanel ;
    Import Stock1.StockTablePanel ;
    NOW : I guess I have to compile 'PortfolioTotalsPanels' and 'StockTablePanel' on their own - which I did successfully and kept the '.class' in the same directory (folder) - Stock1
    When trying to compile 'StockTableTabPanel.java' file...
    StockTableTabPanel.java : cannot resolve symbol
    Symbol : class StockTablePanel
    Location: class Stock1.StockTableTabPanel.StockTableTabPanel
    StockTablePanel stockTablePanel = new StockTablePanel();
    ...and the same error message for 'StockTablePanel' class.
    - I noticed the last line has 'stockTablePanel' instead of 'StockTablePanel' ...not sure if it makes a difference..same with the 'portfolioTotalsPanel'
    I'm out of ideas...HELP !!

    package Stock1.PortfolioTotalsPanel;
    - first line in PortfolioTotalsPanels.java file
    package Stock1.StockTablePanel;
    - first line in StockTablePanel.java file
    package Stock1.StockTableTabPanel;
    - first line in StockTableTabPanel.java file
    --- then:
    Import Stock1.PortfolioTotalsPanel ;
    Import Stock1.StockTablePanel ;
    NOW : I guess I have to compile
    'PortfolioTotalsPanels' and 'StockTablePanel' on their
    own - which I did successfully and kept the '.class'
    in the same directory (folder) - Stock1Both of your source files are in a directory named Stock1, right? Change directory so that you are in the directory above Stock1:
    c:\javastuff\Stock1> cd ..
    c:\javastuff> javac Stock1/StockTablePanel.java Stock1/PortfoloiTotalsPanels.java
    to run them, run them from this root directory:
    c:\javastuff> java Stock1.StockTablePanel
    assuming that that class has a main() method.

  • IPhone basic code syntax in xcode

    Hello !
    i am new to iPhone and Xcode.
    Can anyone tell me what does the syntax
    ?YES:No
    means in
    -(BOOL) isReachableWithoutRequiringConnection;(SCNetworkReachabilityFlags)flags
    return (isReachable && noConnectionRequired) ? YES : NO;

    Hi, the expression
    return (<exp1> ? <exp2> : <exp3>)
    is a short version of
    if (<exp1>) {
    return <exp2>;
    } else {
    return <exp3>;
    So in this case it means: return YES if both isReachable and noConnectionRequired are true (YES) otherwise false (NO).
    Altough it could be writen as
    return (isReachable && noConnectionRequired)

  • Please help with some basic javascript syntax

    Can anyone please help me with a "remove from favourites"
    facility i'm working on.
    I query to get all the favouites, then i output those
    favourites down the page
    each favourite has a "remove from favourites" link - i want
    to make it so when a user clicks this link they get a javascript
    confirm box pop up saying "are you sure you want to remove
    #favourites name# from your favourites?"
    so i have..
    function remove(profile,name) {
    if (confirm("Are you sure you want to remove #name# from
    your favourites?")) {
    window.location =
    "remove_from_favourites.cfm?deleteFavID=#profile#&removedName=#name#"
    and
    <div
    onClick="remove(#rs_favs.favouriteeID#,#rs_favs.firstName#)"
    >Remove from favourites</div>
    but it doesn't work - i think there are 2 problems..
    problem 1 - i have used the CF # in the remove function as i
    don't know what one does in javascript to "output" a variable (see
    where it says "Are you sure you want to remove #name# from your
    favourites") what should i use in place of the "#"?
    problem 2 - i have tried to pass to variables to the function
    >>
    onClick="remove(#rs_favs.favouriteeID#,#rs_favs.firstName#)" and i
    have separated them but a commer "," but i suspect that is
    incorrect syntax
    if anyone could please help me i'd be very grateful as, to be
    honest, i love coldfusion - but javascript just hurts my head! :(
    thanks very much indeed.
    PS the way i've wrapped my "remove from favourites" text in a
    div rather than making it an actual "a href" link - is that right
    or is there a better way (ideally i'd like the text to look like
    all my other links (ie they underline on mouse over)

    You can simply add CSS commands to define your div to look
    like your links.
    div#FavLink
    color: blue;
    text-decoration: underline;
    cursor: pointer;
    <div id="FavLink"
    onClick="remove(#rs_favs.favouriteeID#,'#rs_favs.firstName#')"
    Remove
    from favourites</div>
    That should get you started.
    happysailingdude wrote:
    > thanks CFDEBUG that sorted it - thanks very much
    >
    > just one last thing - more of a CSS issue i think but
    maybe not.
    >
    > so now I have <div
    >
    onClick="remove(#rs_favs.favouriteeID#,'#rs_favs.firstName#')"
    >Remove from
    > favourites</div>
    >
    > which of course isnt a link so it just looks like my
    standard text (as if i'd
    > done <p>Remove from favourites</p>
    >
    > how do i make the "Remove from favourites" text look
    like a link as if i'd
    > done <a href="remove_from_favourites.cfm?....."
    >Remove from favourites</a>
    >
    > i think ive seen links that when you hover over them it
    says "javascript:void"
    > or something at the bottom of the browser - is this the
    answer and if so what
    > is the correct syntax please? or do i need to do
    something with my CSS file?
    >
    > thanks very much indeed for any further help anyone can
    give me to get this
    > page finshed off - thank you
    >

  • Basic Varray syntax

    I wanted to create a VARRAY with a size_limit of 15 then initialize the VARRAY to 5 elements starting with 1. Can somebody tell me the exact syntax?

    this?
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2     type var_ty is varray (15) of Number;
      3     v var_ty:=var_ty (1,2,3,4,5);--declare and initialize
      4  begin
      5     for i in 1..v.count loop
      6       dbms_output.put_line(v(i));
      7    end loop;
      8* end;
    SQL> /
    1
    2
    3
    4
    5
    PL/SQL procedure successfully completed.

  • Basic package question

    After working thru a package problem with some forum members(thanx to those who contributed), it seems to me that the following things about creating/using packages are true:
    If my package is pack, I need to install the classes in that package to a directory pack. The CLASSPATH should point to the parent directory of pack. Then, in code that uses packages, I import pack.* to get access to the classes.
    The source code for classes in pack cannot be on the classpath anywhere, at least in all the testing I did to get my code to compile. Can anyone confirm or refute this? It seems to be a really inconvenient behavior on the part of the java compiler.
    In my general source tree I have a directory units. I created a vo_unit package in that directory and installed all class files to units/vo_unit. I then wrote a test program in units, but it wouldnt work because I had my package class source in the units directory. I dont think that this source model is bad, but unless someone can tell me otherwise it seems that packages cannot be developed in the same source directories where they are used, as trying to compile confuses java when it sees someclass.java, when trying to use someclass in the test code...

    The source code for classes in pack cannot be on the
    classpath anywhere, at least in all the testing I did
    to get my code to compile. Can anyone confirm or
    refute this? It seems to be a really inconvenient
    behavior on the part of the java compiler.
    If you use import pack.* and the source code is in a directory that is in the classpath, the javac compiler will likely error. If you import the specific classes from pack, it likely will work. I don't know of a scenario in which importing the specific class does not work.

  • Basic broadband package off-peak?

    Hello all, a relative of mine has the basic £10/month home broadband package and has asked me if i could find out if this package has an off-peak time that provides unlimited download bandwidth? If so, between which hours provide said off-peak times?
    Thank you for your time and patience.
    - CJ
    Solved!
    Go to Solution.

    No, the basic package is limited 24/7. If you want unlimited your relative would need to upgrade the broadband to an unlimited package.

  • BT Basic telephone package and 0345/0370 etc. numb...

    Please can you confirm if calls to 0300/0344/0345/0370 can be charged from the includive call allowance when on BT basic.
    I believe these are all g21 rate which the BT Basic price list says can be taken from the inclusive call allowance, but it is difficult to determine exactly which number prefixes are g21 rate.

    Hi
    I am sorry to see you are having problems
    I suggest you contact live chat at this link they should be able to help you with the BT Basic package call charges
    http://bt.custhelp.com/app/contact/c/2902/?s_intcid=con_intban_sanda_contact_us_chat_from_forums
    If you want to say thanks for a helpful answer,please click on the Ratings star on the left-hand side If the reply answers your question then please mark as ’Mark as Accepted Solution’

  • A package is considered invalid from another package when it isn't

    Hi all,
    I have two packages, A and B. I have unit test for both packages. B uses some procedures from A. After they are compiled (A first, then B), when I run the unit test for B in sqlplus, I get
    ORA-04068: existing state of packages has been discarded
    ORA-04065: not executed, altered or dropped stored procedure "my_schema.A"
    ORA-06508: PL/SQL: could not find program unit being called
    ORA-06512: at "my_schema.B", line 886
    ORA-06512: at line 6
    But if I run the unit test for A, it works perfectly (so I think A has been compiled correctly and could be found in the database).
    For those who have read my post yesterday titled 'existing state of packages has been discarded', this is the same problem. Sorry for posting twice but I really need to get this working.
    Thanks.
    Gloria Chung

    This shouldn't be a problem if you are running the unit tests in the same session as you are recompiling the packages.
    Basically, package A must be storing values in package level variables. Like this...
    SQL1> CREATE OR REPLACE PACKAGE ap AS
    2 FUNCTION f RETURN number;
    3 END;
    4 /
    Package created.
    SQL1> CREATE OR REPLACE PACKAGE BODY ap AS
    2 FUNCTION f RETURN number IS
    3 BEGIN
    4 RETURN 2;
    5 END;
    6 END;
    7 /
    Package body created.
    SQL1> CREATE OR REPLACE PACKAGE bp AS
    2 FUNCTION f RETURN NUMBER;
    3 END;
    4 /
    Package created.
    SQL1> CREATE OR REPLACE PACKAGE BODY bp AS
    2 n NUMBER;
    3 FUNCTION f RETURN NUMBER IS
    4 BEGIN
    5 n := n + ap.f;
    6 RETURN n;
    7 END;
    8 BEGIN
    9 n := 0;
    10 END;
    11 /
    Package body created.
    SQL1>
    Now we can use that in another session...
    SQL2> var x number
    SQL2> exec :x := bp.f
    PL/SQL procedure successfully completed.
    SQL2> print x
             X
             2
    SQL2>So far so good. Now in the first session we run ...
    SQL1> CREATE OR REPLACE PACKAGE BODY bp AS
      2    n NUMBER;
      3    FUNCTION f RETURN NUMBER IS
      4    BEGIN
      5       n := n * ap.f;
      6       RETURN n;
      7    END;
      8  BEGIN
      9      n := 4;
    10  END;
    11  /
    Package body created.
    SQL1> back in session two...
    SQL2> exec :x := bp.f
    BEGIN :x := bp.f; END;
    ERROR at line 1:
    ORA-04068: existing state of packages has been discarded
    ORA-04061: existing state of package body "APC.BP" has been invalidated
    ORA-04065: not executed, altered or dropped package body "APC.BP"
    ORA-06508: PL/SQL: could not find program unit being called
    ORA-06512: at line 1
    SQL2>aaargh! disaster! But all we have to do is ...
    SQL2> conn apc/apc
    Connected.
    SQL2> var x number
    SQL2> exec :x := bp.f
    PL/SQL procedure successfully completed.
    SQL2> print x
             X
             8
    SQL2> I'm not saying its satisfactory, because obviously it isn't. But I don't see what else Oracle can do.
    Cheers, APC

Maybe you are looking for

  • VAT not appearing in Print preview

    Dear Experts, We have created one Purchase order in our concern. That materials are not excise. only VAT applicable. In Calculation schema we have updated Printer setting. In PO, Conditions tab VAT is available. but in print preview we can not able t

  • S_ALR_87012178 - Reporting by Region

    Hi - Is it possible to have Region data display when Reporting via TCode S_ALR_87012178? Or is there any other TCode/Report which can be utlised to Reprt on AR Overdue items by Region? Thanks.....

  • How do I find an e-mail in my Time Machine back-up?

    i'm looking for a draft e-mail in mac mail from a time machine back-up....where can i find that? i see the mail application but cannot see specific e-mails. please help! thanks.

  • [SOLVED] Dependencies can't be resolved

    Hi guys, I'm trying to install something, but it requires deendencies that are in conflict with other dependencies on my machine. Is there any way to resolve this? The details are below: sudo pacman -S libpanelappletmm resolving dependencies... looki

  • IMAP Exchange 2007 & Password Issue

    Anybody else having trouble with getting the IMAP 2007 Exchange account to hold a password? When I set account up, it downloads my email to Mail but then keeps asking me for the password and doesn't show it in the account. Only way I can get my email