Array - return greatest value in the array
I am trying to write a program that for the method 'greatest' it will return the greates value in the array between the elements beginning and end.
Below is my code. No errors but I am not getting the desired results.
My output:
2
4
1
5
3
6
My code:
public class Test {
public void printArray(int x[]){
for (int i=0; i < x.length; i++)
System.out.println(x[i] + "");
System.out.println("\n");
public static int greatest(int x[], int beginning, int end){
int i;
int index = 0;
int largest = 0;
for(int z = 0; z < x.length; z++)
if(largest < x[z])
largest = x[z];
index = z;
return index;
public static void main(String[] args){
Test program = new Test();
int a[] = {2,4,1,5,3,6};
int val = greatest(a,0,a.length-1);
program.printArray(a);
}Please, I just would like someone to point out where I need to focus. I do not want anyone to write this. Yes - its for college.
Please and Thank you
Kayaman - once again you have been helpful. Thank you.
So I went to the paper and thought about the logic and rewrote what I had in the method greatest.
* I am passing to the method, successfully calculating the greatest value, but not returning a varialble so the variable val is still not used. Or if I am returning a value I dont see it. *
So, I need to return the value and then call the printArray method to print the outcome.
What line needs to be addressed - remember anyone else reading this, please do not write it for me :-)
public static int greatest(int x[], int beginning, int end){
int max = x[0];
for (int i = 0; i < x.length; i++)
if (max < x)
max = x[i];
System.out.println("The greatest: " + max);
return max;
Please and Thank you :-)
Similar Messages
-
How to search two columns and return a value in the same row to a cell?
Identification
Diameter
Soak
3" Tank (inches/kft)
AWG
mils
Code
Strands
Shield
Conductor
Insulation
Semi-Con
Days
SD
Injection
Soak
Total
2
175
00
7
External
0.288
0.692
0.752
60
0.4
3.6
20.0
23.6
2
220
00
7
External
0.284
0.764
0.864
75
0.4
3.6
20.0
23.6
2
260
00
7
External
0.284
0.844
0.944
90
0.4
3.6
21.8
25.4
2
320
00
7
External
0.288
0.964
1.064
110
0.4
3.6
24.3
27.0
2
345
00
7
External
0.288
1.014
1.114
115
0.4
3.6
25.6
29.2
Length
3"
4"
AWG
mils
Soak
SD
Injection (3")
Injection (4")
650
2
320
I want to input two values, AWG and mils and return the value in the Days column.
In the instance of what I am showing .... AWG=2 AND mils=320 so Soak=110 ....
I want to search the columns (AWG) AND (mils) to return a value in the column (Days) for that row into cell H10 (Soak) ...
So far I have toyed with LOOKUP, INDEX and MATCH ....SCW,
I'm sure there is a clever way to cascade functions to avoid adding an auxiliary column in your practice table, but to me it wouldn't be worth the aggravation. I would add a column that concatenates Columns A & B, AWG & mils. This column can be anywhere and would be Hidden. Let's say your new column is Column N.
In Column N, fill the body rows with:
=A&"-"&B
As good Numbers programming form would indicate, let's name the Practice Table Practices and only put the practices in that table. In another table where you do the lookup, let's call it Program, we will have the calculation/lookup.
Based on your example, I'd guess that AWG may be in Column D and mils in Column E of your Program table, and the Soak lookup in Column F. If I'm wrong, adjust the column id.
In Column F, write:
=OFFSET(Practices::I$1,MATCH(D&"-"&E, Practices::N,0)−1, 0)
The hyphen in the concatenated representation of the combination of AWG and mils is just tp make it more readable.
As I'm sure you know, you could use other approaches, but since I had you put your aux column at the end of your Practices table, OFFSET with MATCH is a clean approach. INDEX could be used too.
Here's an illustration:
Regards,
Jerry -
Hi,
I'm using FM F4IF_INT_TABLE_VALUE_REQUEST to show a pop-up with my internal table values. The internal table has 3 fields, ATINN, ATZHL and a description field ATWTB. ATINN and ATZHL are needed to complete the unique table key, however this FM will only return the value of one field in any line I select.
How can I see all the values in the line I select in the return table?
My code is as follows:
DATA: tbl_cawnt LIKE cawnt OCCURS 0,
wa_cawnt LIKE cawnt,
BEGIN OF tbl_list OCCURS 0,
atinn LIKE cawnt-atinn,
atzhl LIKE cawnt-atzhl,
atwtb LIKE cawnt-atwtb,
END OF tbl_list,
wa_list LIKE tbl_list,
tbl_return LIKE ddshretval OCCURS 0,
wa_return LIKE ddshretval,
tbl_fields LIKE dfies OCCURS 0,
tbl_dynp LIKE dselc OCCURS 0.
REFRESH: tbl_list, tbl_cawnt.
SELECT atinn atzhl atwtb
FROM cawnt
INTO CORRESPONDING FIELDS OF TABLE tbl_cawnt
WHERE spras EQ sy-langu.
LOOP AT tbl_cawnt INTO wa_cawnt.
CLEAR wa_list.
MOVE: wa_cawnt-atwtb TO wa_list-atwtb,
wa_cawnt-atinn TO wa_list-atinn,
wa_cawnt-atzhl TO wa_list-atzhl.
APPEND wa_list TO tbl_list.
ENDLOOP.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'ATWTB'
dynpprog = sy-repid
dynpnr = sy-dynnr
value_org = 'S'
TABLES
value_tab = tbl_list
return_tab = tbl_return
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Thanks!Hi,
Use the structure DYNPFLD_MAPPING
With this internal table you can easily define that you want to return
other columns of the hit list in addition to field RETFIELD to the
screen.
In this IT you can MAP the screen fields to the serch help screen fields this has three fields
FLDNAME this is the field anme from the search help
FLDINH This has to be blank which would be field with the field value that you want to map
DYFLDNAME THis is the screen field name.
So here you can get the values for the other fields that you want which are on the search help just populate the name of the fields in FLDNAME.
Regards,
Himanshu -
Return multiple values for the popup LOV
Hi folks,
I have one challange. I have a search engine and there is an popup lov and its having three Display and 3 Retun value such as
select
p.A || ', ' || pi.B|| ', ' || km.C|| ' ' d, p.A || ', ' || pi.B|| ', ' || km.C|| ' ' r
from tableA km,tableB p,tableC pi
where km.col1=p.id and km.col1=pi.id and km.C is not null
when i click on the pop lov it will display 3 values shuch as SAP+DBA+HR and in popup lov iteam its will return 3 values
such as SAP+DBA+HR this return values are from 3 cloumn names from same table ie. A column, B column, C column
and when i click on submit button this return values from 3 columns values should assign to the 3 column such as
A=SAP, B=DBA and C=HR and search fetchs the result in a Report.
Its some thing new, is it possible..:)
ok will be waiting for your reply..:D
Regards,
Suri
Edited by: user634694 on Feb 25, 2009 3:14 AMHi Varad,
am facing problems i wrote dynamic sql its working fine for 2 and 3 fields like (SAP+ORCL) and (SAP+ORCL+HRA) but for the single value like SAP the results are not comming properly. my code is
If (:P25_TEST Is not Null ) THEN
V_Sql := V_Sql||q'!
And
(multipleInstr1(R.Pillar,:P25_TEST)>0 )
or INSTR ( '+' || Upper(:P25_TEST) || '+', Upper(R.Pillar))>0 ) and
((multipleInstr1(R.Product_Line,:P25_TEST)>0 )
or INSTR ( '+' || Upper(:P25_TEST) || '+', Upper(R.Product_Line))>0) and
((multipleInstr1(R.Category,:P25_TEST)>0 ) or (R.Category is null)
or INSTR ( '+' || Upper(:P25_TEST) || '+', Upper(R.Category))>0 )
End If;
where multipleInstr1 is a function created to search results even its delimited by '+' it ignors '+' delimiter and
:p25_test is the popup iteam which takes values like SAP+ORCL+HRA or SAP+ORCL or SAP how its possible to get this results.
Its turning too complicated for cheking condetion for a single popup iteam, can we get any solution for this or not..
Hope will do respond
Thanks and Regards,
Suri -
Help with modal dialog returning a value to the calling page
Greetings,
Apex Version: 4.1.0.0.32
What I am trying to do is to create a modal dialog that is called from a form page. The dialog will present the user with an IR report that will allow the him to select a row and return a value from that row to a field on the calling page. I have it working in Firefox, but I get an error using IE 8. I hope someone can show me why it is not working in IE.
Here is how I am doing it:
From the calling page:
Created a button
Action: Redirect to URL
URL Target: javascript:var rc = window.showModalDialog('f?p=&APP_ID.:70:&SESSION.::&DEBUG.:::','','resizable:yes;center:yes;dialogWidth:1000px;dialogHeight:500px;');
On the called page:
The called page is an IR report where the query returns this as one of the columns:
*(Note: I had to put a dot '.' in front of the onclick to get it to show in this thread. It is not there in my real code.)*
select
<a href="#" name="z" style="color:blue; text-decoration:underline;" .onclick="javascript:passBack(''' || LOT_NO ||''');">Select</a>' SelectThis
, column1
, column2
from sometablename;This resolves the anchor to:
<a .onclick="javascript:passBack('232158');" href="#">Select</a>Here is the Javascript function that is called from the anchor onclick:
function passBack(passVal1)
opener.document.getElementById("P75_ITEM1").value = passVal1;
close();
}When I run this in Firefox, it works as expected. I click on the button on the parent page. The modal dialog is opened and the IR report is displayed. I click on one of the links in the report and it returns the correct value back to the calling page and closes the modal dialog.
When I run it in IE8, it fails. I click on the button on the parent page. The modal dialog is opened and the IR report is displayed. I click on one of the links in the report and I get this error: “opener.document is null or not an object”.
I hope that is clear and that someone can help.
Thanks
LarryA quick google search determines that window.opener doesn't exists when using window.showModalDialog
Suggestions range from using window.open instead of window.showModalDialog to using dialogArguments instead of window.opener
Try the following:
In the parent page define a getPopupValue() function:
function getPopupValue(){
var dr = window.showModalDialog('f?p=&APP_ID.:70:&SESSION.::&DEBUG.:::','','resizable:yes;center:yes;dialogWidth:1000px;dialogHeight:500px;');
if ( (dr != undefined) && (dr != '') && (dr != false) ){
$x("P75_ITEM1").value = dr;
}Change the button url to call the function:
javascript:getPopupValue(); On the popup page change the passback function to:
function passBack(passVal1)
returnValue = passVal1;
close();
} -
LOV doesn't return selected value to the base page
Hi All,
I have created an LOV based on VO. When I select value on the LOV page, it is not returning the selected value to the base page.
I am getting the error when I select any value .
Error
You are trying to access a page that is no longer active.
- The referring page may have come from a previous session. Please select Home to proceed.
Can anyone please guide me which property has to be set.
Thanks,
Edited by: user4482525 on Apr 21, 2009 11:49 PM1> Go to the About this page* of the page and check whether page Root AM is extended or not?
If the page root AM is extended then delete the extension by jdr_util.deleteDocument or using functional Adminstartor
or
2> See in the LOV CO, if you are using the method "releaseApplicationModule"
If yes , then remove this.
Thanks,
Kumar -
Returns all values if the user leaves the valuve empty ?
is there a way to return all values if a user leaves lets say, the 'Project_no' valve empty..
Below is the bit of SQL that I'm trying to get to work..
and upper(coj.CUSTOMER_PO_NO) like upper(('%&Project_No%'))JamesW wrote:
is there a way to return all values if a user leaves lets say, the 'Project_no' valve empty..
Below is the bit of SQL that I'm trying to get to work..
and upper(coj.CUSTOMER_PO_NO) like upper(('%&Project_No%'))And what's not working about it?
SQL> ed
Wrote file afiedt.buf
1* select * from emp where job like '%&job%'
SQL> /
Enter value for job: CLERK
old 1: select * from emp where job like '%&job%'
new 1: select * from emp where job like '%CLERK%'
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7369 SMITH CLERK 7902 17-DEC-1980 00:00:00 800 20
7876 ADAMS CLERK 7788 23-MAY-1987 00:00:00 1100 20
7900 JAMES CLERK 7698 03-DEC-1981 00:00:00 950 30
7934 MILLER CLERK 7782 23-JAN-1982 00:00:00 1300 10
SQL> /
Enter value for job:
old 1: select * from emp where job like '%&job%'
new 1: select * from emp where job like '%%'
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7369 SMITH CLERK 7902 17-DEC-1980 00:00:00 800 20
7499 ALLEN SALESMAN 7698 20-FEB-1981 00:00:00 1600 300 30
7521 WARD SALESMAN 7698 22-FEB-1981 00:00:00 1250 500 30
7566 JONES MANAGER 7839 02-APR-1981 00:00:00 2975 20
7654 MARTIN SALESMAN 7698 28-SEP-1981 00:00:00 1250 1400 30
7698 BLAKE MANAGER 7839 01-MAY-1981 00:00:00 2850 30
7782 CLARK MANAGER 7839 09-JUN-1981 00:00:00 2450 10
7788 SCOTT ANALYST 7566 19-APR-1987 00:00:00 3000 20
7839 KING PRESIDENT 17-NOV-1981 00:00:00 5000 10
7844 TURNER SALESMAN 7698 08-SEP-1981 00:00:00 1500 0 30
7876 ADAMS CLERK 7788 23-MAY-1987 00:00:00 1100 20
7900 JAMES CLERK 7698 03-DEC-1981 00:00:00 950 30
7902 FORD ANALYST 7566 03-DEC-1981 00:00:00 3000 20
7934 MILLER CLERK 7782 23-JAN-1982 00:00:00 1300 10
14 rows selected. -
Custom Integrator - Date Picker/LOV does not return a value to the cell
Hi,
I have configured a webADI template with a date picker in it. Though the picker is rendered when i double-click on the cell, the selected date is not populated back. Same happens for any other list of values may render in the integrator. Any suggestions on debugging this issue.
Regards,
VinayakaI have got the LOV working now. The issue was that I had not provided the table-select-column with the interface column name. It was set to the table column name.
Regards,
Vinayaka -
How to return marked values from the FM F4IF_INT_TABLE_VALUE_REQUEST
Hello all.
I'm using the FM F4IF_INT_TABLE_VALUE_REQUEST with multiple choise activated.
My problem is: if I mark, for example - 2 choises from 5, and then press OK.
If i go in to the same F4 button, I what to see the same marks like before..
At the moment, if i go in again to the same F4, nothing is marked, as if i'm going in for the first time.
Can someone help me?Hi Barak,
I don't think you can achieve this functionality using this FM. Even I think this is not there in standard SAP help, please check.
Regards,
Atish -
Georaster return all values in array
Hello,
I want to return all values of the raster in a array, to display it in a web page.
Is there a function which return that values in one query ?
ThanksSo far, there isn't a function which returns cell values in an array, but you can call SDO_GEOR.getRasterSubset(*) to get raster data in a blob, and then using functions defined in the dbms_lob package to get raster data.
-
Can the main return a value?
is there a way for the main to return a value?
possible something with the concept like public static void main -> public static int main?
(it has been tested and doesnt work)
i would like to have the main return an integer or boolean value.
help plz?
rwerSystem.exit(some_number);
doesnt work, it doesnt even compileIt does if you use it correctly. Apparently you didn't, or literally coded 'some_number' instead of taking it as an example.
and im pretty sure System.exit is a void functionSo? It ends up setting the process's exit code, so that the caller of the process may get that value.
I just want to know if its possible to return a value
from the main
changing "void main" to "int main" and having a
return 0; something that looks like
public static void main(String[] args) throws
Exception {
return 0;
will compile but will not run, im just looking for
ways to do this, any help would be nice...As stated before, no. But since the JVM is the one who calls main() and isn't going to do anything with such a return code, what good would it do? -
[UIX] How To: Return multiple values from a LOV
Hi gang
I've been receiving a number of queries via email on how to return multiple items from a LOV using UIX thanks to earlier posts of mine on OTN. I'm unfortunately aware my previous posts on this are not that clear thanks to the nature of the forums Q&A type approach. So I thought I'd write one clear post, and then direct any queries to it from now on to save me time.
Following is my solution to this problem. Please note it's just one method of many in skinning a cat. It's my understanding via chatting to Oracle employees that LOVs are to be changed in a future release of JDeveloper to be more like Oracle Forms LOVs, so my skinning skills may be rather bloody & crude very soon (already?).
I'll base my example on the hr schema supplied with the standard RDBMS install.
Say we have an UIX input-form screen to modify an employees record. The employees record has a department_id field and a fk to the departments table. Our requirement is to build a LOV for the department_id field such that we can link the employees record to any department_id in the database. In turn we want the department_name shown on the employees input form, so this must be returned via the LOV too.
To meet this requirement follow these steps:
1) In your ADF BC model project, create 2 EOs for employees and departments.
2) Also in your model, create 2 VOs for the same EOs.
3) Open your employees VO and create a new attribute DepartmentName. Check selected in query. In expressions type (SELECT dept.department_name FROM departments dept WHERE dept.department_id = employees.department_id). Check Updateable always.
4) Create a new empty UIX page in your ViewController project called editEmployees.uix.
5) From the data control palette, drag and drop EmployeesView1 as an input-form. Notice that the new field DepartmentName is also included in the input-form.
6) As the DepartmentName will be populated either from querying existing employees records, or via the LOV, disable the field as the user should not have the ability to edit it.
7) Select the DepartmentId field and delete it. In the UI Model window delete the DepartmentId binding.
8) From the data controls palette, drag and drop the DepartmentId field as a messageLovInput onto your page. Note in your application navigator a new UIX page lovWindow0.uix (or similar) has been created for you.
9) While the lovWindow0.uix is still in italics (before you save it), rename the file to departmentsLov.uix.
10) Back in your editEmployees.uix page, your messageLovInput source will look like the following:
<messageLovInput
model="${bindings.DepartmentId}"
id="${bindings.DepartmentId.path}"
destination="lovWindow0.uix"/>Change it to be:
<messageLovInput
model="${bindings.DepartmentId}"
id="DepartmentId"
destination="departmentsLov.uix"
partialRenderMode="multiple"
partialTargets="_uixState DepartmentName"/>11) Also change your DepartmentName source to look like the following:
<messageTextInput
id=DepartmentName
model="${bindings.DepartmentName}"
columns="10"
disabled="true"/>12) Open your departmentsLov.uix page.
13) In the data control palette, drag and drop the DepartmentId field of the DepartmentView1 as a LovTable into the Results area on your page.
14) Notice in the UI Model window that the 3 binding controls have been created for you, an iterator, a range and a binding for DepartmentId.
15) Right click on the DepartmentsLovUIModel node in the UI Model window, then create binding, display, and finally attribute. The attribute binding editor will pop up. In the select-an-iterator drop down select the DepartmentsView1Iterator. Now select DepartmentName in the attribute list and then the ok button.
16) Note in the UI Model you now have a new binding called DCDefaultControl. Select this, and in the property palette change the Id to DepartmentName.
17) View the LOV pages source, and change the lovUpdate event as follows:
<event name="lovSelect">
<compound>
<set value="${bindings.DepartmentId.inputValue}" target="${sessionScope}" property="MyAppDepartmentId" />
<set value="${bindings.DepartmentName.inputValue}" target="${sessionScope}" property="MyAppDepartmentName" />
</compound>
</event>18) Return to editEmployees.uix source, and modify the lovUpdate event to look as follows:
<event name="lovUpdate">
<compound>
<set value="${sessionScope.MyAppDepartmentId}" target="${bindings.DepartmentId}" property="inputValue"/>
<set value="${sessionScope.MyAppDepartmentName}" target="${bindings.DepartmentName}" property="inputValue"/>
</compound>
</event>Thats it. Now when you select a value in your LOV, it will return 2 (multiple!) values.
A couple things to note:
1) In the messageLovInput id field we dont use the .path notation. This is mechanism for returning 1 value from the LOV and is useless for us.
2) Again in the messageLovInput we supply _uixState as an entry in the partialTargets.
3) We are relying on partial-page-refresh functionality to update multiple items on the screen.
Im not going to take the time out to explain these 3 points, but its worthwhile you learning more about them, especially the last 2, as a separate exercise.
One other useful thing to do is, in your messageLovInput, include as a last entry in the partialTargets list MessageBox. In turn locate the messageBox control on your page (if any), and supply an id=MessageBox. This will allow the LOV to place any errors raised in the MessageBox and show them to the user.
I hope this works for you :)
Cheers,
CM.Thanks Chris,
It took me some time to find the information I needed, how to use return multiple values from a LOV popup window, then I found your post and all problems were solved. Its working perfectly, well, almost perfectly.
Im always fighting with ADF-UIX, it never does the thing that I expect it to do, I guess its because I have a hard time letting go of the total control you have as a developer and let the framework take care of a few things.
Anyway, I'm using your example to fill 5 fields at once, one of the fields being a messageChoice (a list with countries) with a LOV to a lookup table (id , country).
I return the countryId from the popup LOV window, that works great, but it doesn't set the correct value in my messageChoice . I think its because its using the CountryId for the listbox index.
So how can I select the correct value inside my messageChoice? Come to think of it, I dont realy think its LOV related...
Can someone help me out out here?
Kind regards
Ido -
SSAS Tabular DAX- Need to get MAX value of the MIN (top)hierarchy level row
EDIT:
I got closer to resolving the issue using MAX.
However, If I remove the department hierarchy and just place on the MAX measure I get the single largest value out of all departments.
It would be ideal if the measure could still SUM the "top level" values across everything in the system if the hierarchy is not placed on the rows grouping.
So it returns the largest value for a given department, but if the department hierarchy isn't present I need it to return a SUM of all the level 1 values for all departments...
Basically return MAX value from the MIN L1ID's DeptLevel value, but I can't seem to construct that DAX query. So if DepartmentID hierarchy is on display it gets MAX per row, but if that is removed it dips into MAX GoalValue for each L1ID grouping with
the MIN DeptLevel.
/EDIT
I have a rather odd data table I'm bringing into a SSAS Tabular model.
Instead of having all data at each child level and then it adding up to a grand total in the parent, it has a grand total predefined at each child level.
I just need this tool to display the raw data if at all possible instead of trying to aggregate everything. Filter on active level, ignore child levels.
Is there a way to do that?
Example:
SalesGoalsByDepartmentLevel:
Level1 (top level) = 5,000
Level2( lower level) = 0
Level3(lower still) = 500
Level 4(lowest) = 4,250
So note that adding up all the child levels is still $250 shy of the top 5,000.
IT is just an odd business rule, basically each level is expected to meet that goal or exceed it, the top level goal is 5,000 but management doesn't care where that last 250 comes from, they do are that each defined level is met.
These levels are in a hierarchy so if I view the top level of the hierarchy it adds up to 4250+500+5000=9750 when I just want to see 5,000 at the top level and the details when they drill down.
I added a filter to just filter to the top level, but then when I drill down of course those lower levels are blank.
Is there a way to filter on the current displayed level without aggregating all child levels?
Thanks!You might want to take a look at the Parent-Child Hierarchies pattern here:
http://www.daxpatterns.com/parent-child-hierarchies/
You might write DAX code to check what is the "current" level (see BrowseDepth measure in the sample file you can download) and depending on its level, se the filter to blank to all the levels below, so you don't aggregate "children".
Just an idea, I'm not sure if it corresponds to your requirement and I don't have time to make more tests.
I hope it will be helpful.
Marco Russo (Blog,
Twitter,
LinkedIn) - sqlbi.com:
Articles, Videos,
Tools, Consultancy,
Training
Format with DAX Formatter and design with
DAX Patterns. Learn
Power Pivot and SSAS Tabular. -
Doesn't return true value .........
Hi All,
please check the following code.
password (originalPassword) from the database is : xyz
password (password) from the login page is : xyz
when I try for equality for the password :
if(originalPassword.equalsIgnoreCase(password)) {
it doesn't return true value while the password is same that is : xyz ?
I an stuck in the problem.
Please look into the code and solve my problem.
Thanks
public boolean verifyPassword(String username, String password) {
String originalPassword=null;
try {
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
Connection con = DriverManager.getConnection("jdbc:microsoft:sqlserver://sqlserver:1433","harish","harish");
PreparedStatement pstmt = con.prepareStatement("select password from registration where username='"+username+"'");
//ResultSet rs = pstmt.getResultSet();
ResultSet rs = pstmt.executeQuery();
if(rs.next()) {
originalPassword=rs.getString(1);
pstmt.close();
if(originalPassword.equalsIgnoreCase(password)) {
return true;
} else {
return false;
} catch (Exception e){
System.out.println("Exception: verifyPassword="+e);
return false;
Harish PathakAre you sure there's no space before or after "xyz"? Try adding some debug output to your code:
if(originalPassword.equalsIgnoreCase(password)) {
//foo
} else {
System.out.println("<" + password + "> does not match <" + originalPassword + ">");
} -
How to Return a value to a 10g Oracle Form form a Web Service Call
I've read the demo available from Oracle, 'Calling a Web service from Oracle Forms', that shows how to invoke a call to a Web Service from a Form. The demo only shows how to do a call and how to display messages. I've done some searching, but can't seem to find any examples of how to return a value from the call into a field on the form. If any one could provide an example of that, I would greatly appreciate it.
We are in the process of modifing a form and we would like to use a webservice, which we have never done before. We have created a webservice which calculates a value based upon what is entered on the form and we want to pass that calculated value back to a field on the form.
This is the code provided by the demo to do a call.
DECLARE
jo ora_java.jobject;
xo ora_java.jobject;
rv varchar2(100);
ex ora_java.jobject;
BEGIN
JO := SendServiceSoapClient.new;
RV := SendServiceSoapClient.sendMessage(JO,:BLOCK3.PHONE_NUMBER, :BLOCK3.MESSAGE_BODY, xo, xo);
EXCEPTION
WHEN ORA_JAVA.JAVA_ERROR then
message('Unable to call out to Java, ' ||ORA_JAVA.LAST_ERROR);
WHEN ORA_JAVA.EXCEPTION_THROWN then
ex := ORA_JAVA.LAST_EXCEPTION;
message(Exception_.toString(ex));
END;In the future, please be sure to include the exact product versions you are using. In this case, also be sure to include the java versions you are using to build your java code.
http://blogs.oracle.com/shay/entry/10_commandments_for_the_otn_fo
Regarding your question, take a look at this older white paper which discusses integrating Forms with SOA.
http://www.oracle.com/technetwork/developer-tools/forms/documentation/forms-soa-wp-1-129441.pdf
Maybe you are looking for
-
Setup as new or restore??? Photo query
I have used my ipad for nearly a year without connecting to my computer or iTunes. I'm terrified if I click on SETUP AS NEW IPAD that my large number of photos will be deleted. Even worse is the only other choice of a RESTORE FROM THIS BACKUP (from m
-
Can I Add a Second Wireless Router to my Airport Extreme?
I have an Airport Extreme 802.11n, (the square one). I just bought a new wireless Epson All-in-One, the Artisan 700. Even though this is a brand new model, Epson foolishly built it as 802.11g, and not 802.11n. Who knows what they were thinking. 802.1
-
Attachments not showing in window (i.e. no paperclip icon)
I have seen this problem elsewhere on here, but not seen a solution so far. I'm on MobileMe emap - Apple Mail Version 3.5 (930.3). Basically I have a number of emails I have sent with attachments, but when I look at my list, the paperclip icons do no
-
Problems trying to run JDeveloper 9.0.2 on Linux
Dear All, I am facing problems while trying to run JDeveloper 9.0.2 (release 2) on my Linux machine. When I invoke jdev/bin/jdev file, the well-known JDeveloper window starts up, but in my console I keep on getting the following error: JDeveloper Err
-
Hi, I am trying to clear the JTextArea when the user clicks on a button. I could not find a clear command in the JavaDocs but I did try the following: Is there a better way to do this or a different object. Thanks, Steve String abc = " "; int xcoord