Overloaded function question
I have the following two classes:
public class AClass implements Serializable;
public class RAClass extends AClass;
I have a remote EJB interface named Alarm where two methods in the remote interface look like this:
public long setAlarm(String usr, String pwd, AClass ac) throws RemoteException;
public long setAlarm(String usr, String pwd, RAClass rac) throws RemoteException;
Finally, in another class I have the following method:
public void writeAlarm(AClass ac) {
Alarm remoteObj;
//code to grab remote interface
System.out.println("class of ac "+ac.getClass().getName());
remoteObj.setAlarm(ac);
At runtime, the setAlarm call with the signature containing the base AClass is always called even when the ac object passed to writeAlarm is an object of type RACClass. I've even verified the type of the object with the println.
From reading the Java language specification, my understanding is that when the writeAlarm is called with an RACObject the setAlarm call with the RACClass in the signature should be the one called.
Is my reasoning wrong? Am I doing something else wrong?
granted that EJB is kinda goofy... this kinda popped out at me...
public long setAlarm(String usr, String pwd, AClass ac) throws RemoteException;interface has two methodd with 3 parameter arguments...
but looking at the rest of the code posted, i only see this call to said methods...
remoteObj.setAlarm(ac);and that method only takes one argument...
which would indicate that there is a method that you declared that only takes one arguement ... and what type does it take ? my thinking is probably an AClass...
and that method would be able to accept both AClass and RAClass... being that RAClass " is a " AClass...
have fun... :-)
- MaxxDmg...
- " He who never sleeps... "
Similar Messages
-
Hi, i got a question in my exam paper which went:
Write a program in Java(using BlueJ) to generate the following pattern for the first 'n' number of rows using overloaded functions
Following is the output for 5 rows:
a) 123454321 b) .... c) ...................
1234 4321
123 321
12 21
1 1
The patterns are not important, but I dont understand what overloaded functions mean. Also i have heard about overloaded constructors and I would like to know what they are too. Ive searched on the internet but i cant get answers that explain it properly. Would be glad to receive some clarification. Thanks
Message was edited by:
OverkillWell I cant really predict the questions that will come in my exam will I? Now after my exam is over , i tried to solve many of the problems i couldn't get , and i solved most, but I could not solve some.
All im asking for is help in solving those.. why are you hostile about that ? -
Calling an overloading function
Hi all,
How can I call an overloading function from outside the package without using the package name,
For example :
CREATE PACKAGE PACK
FUNCTION X(P_INTERVAL IN VARCHAR2, P_INTERVAL_VAL IN NUMBER, P_DATE_STR IN VARCHAR2) RETURN TIMESTAMP;
FUNCTION X(P_INTERVAL IN VARCHAR2, P_INTERVAL_VAL IN NUMBER, P_DATE_EXPR IN DATE) RETURN DATE;
FUNCTION X(P_INTERVAL IN VARCHAR2, P_INTERVAL_VAL IN NUMBER, P_DATE_EXPR IN TIMESTAMP) RETURN TIMESTAMP;
FUNCTION X(P_INTERVAL IN VARCHAR2, P_INTERVAL_VAL IN NUMBER, P_DATE_EXPR IN TIMESTAMP WITH TIME ZONE) RETURN TIMESTAMP WITH TIME ZONE;
Instead of calling the function by using PACK.X (SELECT PACK.X(...) FROM dual)
I want to able to call it using X only (SELECT X(...) FROM dual)
Is there any possible way ?
Thanks !That's a good question
Basically I'm converting MSSQLSERVER functions to oracle using an excellent provided ORACLE package (the SQL DEVELOPER generating it while migrating from MS to Oracle)
Now, In order to preserve code consistency, the developers wants to call these functions exactly the way the are calling it in MSSQLSERVER (for example SELECT DATEADD (...)) without the package name.
Off course its a very problematic demand, but it interest me theoretically, is it even possible. -
SD & FI BI functional Questions
Hi Experts,
I need to ask some questions to customer on SD & FI functional related questions for BI Analytical reports..
Already cutomer implemented Data ware house Informatica with congnos reporting tool.
right now they want to implement BI.
please any one can share on what type functional questions could ask the customer.
Advance Thanks,
Bala.Hi,
A few more pointers.
Start with Reports. What the client is using. What he is expecting.
If he got existing reports map the fields with Business Content BW Fields. Go to Business content and make a list of queries which are delivered from SAP. Explain them the KPI's. This should be good to start with. Also check the Tcodes they use.
Look for DataSources that get data from theses Tcode's.
Project Preparation (Initial stuff -- Do a conceptual review after this phase requirements gathering)
Collect requirement thru interviews with Business teams /Core users / Information Leaders.
Study & analyze KPI's (key figures) of Business process.
Identify the measurement criteria's (Characteristics).
Understand the Drill down requirements if any.
Understand the Business process data flow if any.
Identify the needs for data staging layers in BW (i. e need for ODS if any)
Understand the system landscape.
Prepare Final Requirements Documents in the form of Functional Specifications containing:
Report Owners, Data flow, KPI's, measurement criteria's, Report format along with drilldown requirements.
Hope this helps.
Thanks,
JituK -
I read a lot about �overloaded functions� . Are there any others way I can use overloaded functions besides having multiple constructors in a class?
Thanks
MarioA quick example is something like PrintStream.println(). Take a look at that to see how overloading can be used.
-
Hi, Everyone, I have a function question of Sumifs, here a sample as follows,
=SUMIFS(Budget :: E4:E14,Budget :: C4:C14,"=5003677000",Budget :: B4:B14,OR("=Transit","=Drawing cash")), according to the logic, I think like this, but it's wrong. So how to insert the OR function to the Sumifs function? May someone find the mistake in the function?
Thank you.
AlexI think you would actually do a sum of simifs, i.e. Sumif(....."Transit") + Sumif(....."Drawing Cash")
Basically if you have two sumifs that differ in only one condition that would be treated like an OR in SQL, then make one Sumif for each unique set of conditions and add them up
Jason -
OIC: Functional Question(11.5.10)
Hi All,
I would like to know answer for the following functional question in Oracle 11.5.10 Incentive Compensation Application(OIC). I would greatly appreciate if you anyone can reply for this.
1. Question on Foreign currency exchange rates:
We know that OIC cannot handle foreign currency exchange rates. Since all of our offer letters to the Sales guys are in local currency what we end up doing is picking an exchange rate on July 1st every year and converting them to US $. What I’m wondering is why couldn’t we just set them up in OIC in their local currency, without converting them?
Is that possible? OIC can handle this?
2. In OIC, Can I enter a DUMMY Acoount Executive (since we are not going to credit any single person in the Primary Account Executive role) that bookings could be credited to in order to ensure they roll up to the appropriate manager?
a) Is that possible?
b) Does this DUMMY Acoount Executive should be part of the HR Employee setups as well?, In OIC should we need to load the transaction for DUMMY Account
Executive so that credit will get rolled up to approriate managers based on the Group hiearchy setups?
Thanks,
Johnson
Edited by: user10413783 on Jun 23, 2009 4:06 PMHi Johnson,
2. In OIC, Can I enter a DUMMY Acoount Executive (since we are not going to credit any single person in the Primary Account Executive role) that bookings could be credited to in order to ensure they roll up to the appropriate manager?
Yes
b) Does this DUMMY Acoount Executive should be part of the HR Employee setups as well?, In OIC should we need to load the transaction for DUMMY Account
Executive so that credit will get rolled up to approriate managers based on the Group hiearchy setups?
You do not need to set up the dummy resource as employee. All you need is to create as OTHER type of resource and add that resource to group.
Hope this helps.
Thanks
Srini -
Incremental updates on collections/full schedule - Functional question
Hi everyone,
At a customer of mine we have the following set-up:
Almost all applications are deployed User Based
Collections are used for targetting the applications
Incremental updates are enabled on practically all collections which deploy applications
For the moment this setup is active for 498 collections (out of 714 collections).
Since it's not advised and Microsoft recommends to only have incremental updates active for 200 collections, I would like to change this setup by means of POSH. I have just finished writing it, but I still have a functional question:
Which schedule time would be best to activate for the collections? Keep the standard value to update collection every 7 days?
When would you activate "incremental updates"? Device collections with required software for faster deployment time?
I only foresee the following "downside":
We have a lot of applications who are available to "all domain users". When the AD-account is created, it will sync with SCCM and will receive their deployements. But by changing the update schedule to, let's say, 7 days.. They wouldn't be able
to see and install these applications if the collections haven't been updated yet?
Thanks for the insight with your experience!
Kr,
SvenWow Jörgen, thanks for this information! This was something I haven't read about. Will keep this in mind.
In your blog, you mention that you use this tool to keep track of performance issues. When do you feel that there are too many collections which have incremental updates enabled (by using the tool)?
The last weeks/months, we have a lot of issues during OSD. We have collections to which the TS is deployed.
In orchestrator we have a runbook to add workstations to SCCM + add workstation to collection + update membership of collection. But the update takes from 5 minutes to 40 minutes.. So this is the main issue that we have..
@Andrew: Thanks for your contribution! I believe you are speaking of "Global Conditions"? I haven't used it either, but I thought that this had some downsides.. For instance, we target most of the applications "Used Based" (since MS is
moving to user centric deployment). So if I target the application to the "all users" collection and create a "global condition" to only install when user is a member of a specific AD-group (for instance: Skype), then the user still sees
"skype" in the application catalog and will have an error upon installing it when he is not a member of the skype AD-group.
Maybe this is completely wrong what I'm saying.. Just did some brainstorming with collegues but haven't found the time to play with it in a test environment. @Jörgen: Please enlighten us if I'm wrong. -
Tutorials needed on overloading functions
hi,
tutorials needed on overloading functions.
provide me with some good links which explains all type of possibilities of overloading.Some samples here :
http://download-uk.oracle.com/docs/cd/B19306_01/appdev.102/b14261/subprograms.htm#i12352
Nicolas. -
Hi all
create or replace package emp_pack is
function p1 (p_tvia_num movil.tvia_num%type,
p_chaluka_num movil.chaluka_num%type) return number ;
function p1 (p_tvianum movil.tvia_num%type,
p_chlaukanum%type,
p_polisanum%type) return number ;
end emp_pack;i'm posting only the specification
now
i'm trying to invoke the function :
exec emp_pack.p1(p_tvia_num=>99,p_chaluka_num=>0);
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'P1
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored '
i know that if i declare different name for the parameters and invoking the function with the parameter name it's suppose to work ,
am i right ? or this valid only to procedures ?
Thanks in Advanced
Naama
Edited by: naama on Jun 12, 2011 2:47 AMHi peter
Sorry my mistake , i copied the wrong script
CREATE OR REPLACE PACKAGE emp_pack IS
FUNCTION p1 (
p_tvia_num movil.tvia_num%TYPE,
p_chaluka_num movil.chaluka_num%TYPE
RETURN NUMBER;
FUNCTION p1 (
p_tvianum movil.tvia_num%TYPE,
p_chlaukanum movil.chaluka_num%TYPE,
p_polisanum movil.polisa_num%TYPE
RETURN NUMBER;
end emp_pack;/
o.k you right , and i also did
var g_num
execute :g_num := emp_pack.p1(p_tvia_num=>99, p_chaluka_num=>0)
and it's work
now i was wondering
from the beginning i wanted to do like this :
CREATE OR REPLACE PACKAGE emp_pack IS
FUNCTION p1 (
p_tvia_num movil.tvia_num%TYPE,
p_chaluka_num movil.chaluka_num%TYPE
RETURN NUMBER;
FUNCTION p1 (
p_tvia_num movil.tvia_num%TYPE,
p_chlauka_num movil.chaluka_num%TYPE,
p_polisa_num movil.polisa_num%TYPE
RETURN NUMBER;
--overloading function no.3
FUNCTION p1 (
p_polisa_num movil.polisa_num%TYPE ,
p_chlauka_num movil.chaluka_num%TYPE) return number ;
end emp_pack;i added one more function which get also two parameters of the same data type ,
and also gave the parameters of all the p1 function the same name ,
is it valid and if so , it this a poor pl/sql code , ok is it o.k writing like this ?
Thanks in Advanced
Naama
Edited by: naama on Jun 12, 2011 3:35 AM
Edited by: naama on Jun 12, 2011 3:36 AM -
Performance issue and functional question regarding updates on tables
A person at my site wrote some code to update a custom field on the MARC table that was being copied from the MARA table. Here is what I would have expected to see as the code. Assume that both sets of code have a parameter called p_werks which is the plant in question.
data : commit_count type i.
select matnr zfield from mara into (wa_marc-matnr, wa_marc-zfield).
update marc set zfield = wa_marc-zfield
where werks = p_werks and matnr = wa_matnr.
commit work and wait.
endselect.
I would have committed every 200 rows instead of every one row, but here's the actual code and my question isn't around the commits but something else. In this case an internal table was built with two elements - MATNR and WERKS - could have done that above too, but that's not my question.
DO.
" Lock the record that needs to be update with material creation date
CALL FUNCTION 'ENQUEUE_EMMARCS'
EXPORTING
mode_marc = 'S'
mandt = sy-mandt
matnr = wa_marc-matnr
werks = wa_marc-werks
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc <> 0.
" Wait, if the records not able to perform as lock
CALL FUNCTION 'RZL_SLEEP'.
ELSE.
EXIT.
ENDIF.
ENDDO.
" Update the record in the table MARC with material creation date
UPDATE marc SET zzdate = wa_mara-zzdate
WHERE matnr = wa_mara-matnr AND
werks = wa_marc-werks. " IN s_werks.
IF sy-subrc EQ 0.
" Save record in the database table MARC
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'
IMPORTING
return = wa_return.
wa_log-matnr = wa_marc-matnr.
wa_log-werks = wa_marc-werks.
wa_log-type = 'S'.
" text-010 - 'Material creation date has updated'.
wa_log-message = text-010.
wa_log-zzdate = wa_mara-zzdate.
APPEND wa_log TO tb_log.
CLEAR: wa_return,wa_log.
ELSE.
" Roll back the record(un save), if there is any issue occurs
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'
IMPORTING
return = wa_return.
wa_log-matnr = wa_marc-matnr.
wa_log-werks = wa_marc-werks.
wa_log-type = 'E'.
" 'Material creation date does not updated'.
wa_log-message = text-011.
wa_log-zzdate = wa_mara-zzdate..
APPEND wa_log TO tb_log.
CLEAR: wa_return, wa_log.
ENDIF.
" Unlock the record from data base
CALL FUNCTION 'DEQUEUE_EMMARCS'
EXPORTING
mode_marc = 'S'
mandt = sy-mandt
matnr = wa_marc-matnr
werks = wa_marc-werks.
ENDIF.
Here's the question - why did this person enqueue and dequeue explicit locks like this ? They claimed it was to prevent issues - what issues ??? Is there something special about updating tables that we don't know about ? We've actually seen it where the system runs out of these ENQUEUE locks.
Before you all go off the deep end and ask why not just do the update, keep in mind that you don't want to update a million + rows and then do a commit either - that locks up the entire table!The ENQUEUE lock insure that another program called by another user will not update the data at the same time, so preventing database coherence to be lost. In fact, another user on a SAP correct transaction, has read the record and locked it, so when it will be updated your modifications will be lost, also you could override modifications made by another user in another luw.
You cannot use a COMMIT WORK in a SELECT - ENDSELECT, because COMMIT WORK will close each and every opened database cursor, so your first idea would dump after the first update. (so the internal table is mandatory)
Go through some documentation like [Updates in the R/3 System (BC-CST-UP)|http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCCSTUP/BCCSTUP_PT.pdf]
Regards -
Basic Functionality Questions - Is a computer required to serve content, etc?
I'm sorry if these are no-brainers. I ask them because I thought I had understood how an AppleTV worked, and had planned on buying one, until a friend who owns one insisted that the device functions differently than I had understood it to. I think he's wrong, but I was hoping you guys could clear up a few things for me.
1) Does an AppleTV require that I have another device (iPad, Computer running iTunes, etc) on and connected to watch content purchased from my iTunes account, or will it stream directly from the 'net?
2) If I've converted video content from a source other than the iTunes store (for example, ripped a DVD and imported it to my computer's iTunes library) can I stream it to my AppleTV (assuming the source computer is on?)
3) Assuming #2 is true, the content in question must be served by a computer - ie, I can't move it to the cloud, and viewing it is dependant on having my computer on and running. Is this correct?
Thanks in advance guys!1- it will stream purchased items such as TV shows, not music unless you have the iTunes match subscription. You need another device if you want to do "home sharing" (share your iTunes library with other devices, If you have already bought movies, music, etc.)
2- You will have to import it to iTunes if you want to see it on your ATV.
3- Yes, you need to have a computer act as a server with iTunes running all the time... -
Hi all,
I have a question like
Report has to extract the details related to invoices and payments to Vendors for the list of Purchase Orders for goods and services procured which are selected in the input screen. The report should calculate the time in days, from when the Purchase Order (services/goods) is released and till the time payment is made to the Vendor. It should take into account the invoice document posted and the payment terms for the Vendor in order to get the correct due date. It should give the difference in terms of days between invoice due date and payment date and indicate whether the payment was done before or on the due date.
Iam confused with the flow becz iam not able to relate the ekbe (po history) and the BSIS , BSAK table to get the vendor data as the ekbe (belnr shows the material document No) and the the BSIS and BSAK shows the (A/c document No).
can any one help me in this this is a urgent requirement.
Thanks,
SriRatnaSriRatna,
Pl let me know your email address so that I can email you the material prepared by me, this will give you complete overview of getting the data from different tables and their relationship based on the scenarios we commonly face in all different functional modules.
Thanks,
Sridhar Kamisetti -
Oracle XE Functionality Question
Hello,
I am here trying to get the opinion of Oracle XE users regarding a project I am considering.
Currently, my employer uses Access databases, with the master on a corporate server, and 4 slaves on local servers at warehouses. At each warehouse, there are probably 10-30 new records created per day by 2 or 3 users at each location, which get synced to the main at the end of each day. Any changes that need to be made at the corporate level get synced and sent on to the warehouse as needed.
Besides sending out these changes, the corporate office will also add 40-50 records per day. Information is also pulled for reports- seemingly pretty normal Access tasks. I don't know the exact stats, but each backed up copy of the DB is less than 100mb, so it's not a huge system. (It's for keeping track of inbound and outbound shipments, carriers, locations, etc.) There are probably 6 users at this location.
So the question I have is, would XE have the functionality to at least cover these tasks, and possibly more. (What more is at the moment, I do not know.) My own preference would be to grow into Oracle DB, but if the Access functions cannot be replicated, we would probably move on to something else, so I thought I'd ask for current user experience.
Thanks for your time.Hi,
I think application running on XE and Apex suits for your current situation perfectly.
And if system gets bigger you can get license of "full" Oracle database and upgrade.
Using single database server and web application everything is "online" and you do not need transfer any data end of day.
XE 10G database comes with Apex 2.1. That Apex version is quite old.
But you can upgrade Apex to latest one.
http://www.oracle.com/technetwork/developer-tools/apex/overview/index.html
There is coming XE 11G that ship latest Apex and features that 10G do not have.
You can also save more user data to XE 11G. But I assume XE 10G 4GB limit is enough for you.
http://www.oracle.com/technetwork/database/express-edition/11gxe-beta-download-302519.html
Regards,
Jari
Edited by: jarola on Aug 16, 2011 11:31 AM
I did find this blog that is actually running on XE and Apex
http://www.apexninjas.com/blog/f?p=100:1:1421570076381594::::P1_ARTICLE:
I think you can not run blog application on MS Access =)
Also I think Oracle database have much more features than Access, specially with Apex. -
HI,
can anyone please post some CRM functional interview questions. I have seen only technical questions so far. I am not interested in answers. This is urgent
Regards,
KarthikHi Karthik,
Refer the following links:
http://searchsap.techtarget.com/generic/0,295582,sid21_gci1149410,00.html
http://searchsap.techtarget.com/general/0,295582,sid21_gci1108668,00.html
<b>Reward points if it helps.</b>
Maybe you are looking for
-
How can I select all messages in either my Inbox, Trash and /or Bin in one go to delete them all in one go. I currently have 3000+ unwanted messages in my Bin
-
OSB 11g - Authentication - Username and password in SOAP body
Hi, I have a PS based on the WSDL provided by the client. According to the WSDL the client will send the username and password (to be used for authentication) in SOAP Body. I have extract the username and password from the body and authenticate it an
-
Error from bex query while executing in portal
Dear Experts, while executing the query bex analyzer, is working ok but the same query when executing in portal is throwing the following error: error message: The initial exception that caused the request to fail was: Termination message sent ABEND
-
Who to ask about the Caspian Sea missing from the map in Aperture 3
Hello, I'm creating a travel / photo book and have noticed that there is no Caspian Sea that shows up on the map of the region where it should be. Is there anyone to contact at Apple or a way to fix this as it's a major omission? I'm using Aperture v
-
Gallery and larger pics with longer loadtimes
Hello my experimenting page http://www.hannes-renate.de/Bilder/astonnandini/index.html shows when initially loaded long periods of white mainImageOutline-div (up to several seconds). Only the second round trip of playing the slideshow, when all pictu