How to check null condition on a Object.......
Hi I have created a JTable and Iam retrieving the data from the Jtable as an Object.
Object s=table.getValueAt(i,j)
if(s!=null)
dosomething();
}But the if loop is continuing even if there is a null value in the table.Where am I going wrong?
But the if loop is continuing even if there is a null value in the table.Where am I going wrong?Are you sure the value is null ?
This code seems to work fine for me :
package objectorientation;
public class Oo5 {
public static void main(String[] args) {
Oo5 objOo5=new Oo5();
Object o=objOo5.returnValue();
if(o!=null)
System.out.println("HI");
else
System.out.println("BYE");
public Oo5 returnValue()
//Oo5 objOo5=new Oo5();
//return objOo5;
return null;
O/P :
BYECase 2 :
package obectorientation;
public class Oo5 {
public static void main(String[] args) {
Oo5 objOo5=new Oo5();
Object o=objOo5.returnValue();
if(o!=null)
System.out.println("HI");
else
System.out.println("BYE");
public Oo5 returnValue()
Oo5 objOo5=new Oo5();
return objOo5;
O/P :
HIExperts may comment on this.
Thanks.
Similar Messages
-
How to check the Conditional transition while submit the jsp as screenflo
Hi All,
I want to know that how to check the conditional transition, which result is used to decide the next Activity while submit the JSP as Screen Flows
Edited by bpmvasu at 03/27/2007 11:14 PMHi,
Unlike BPM Object Presentations where the 'selectedButton' is automatically assigned to the predefined screenflow 'result' variable, when using JSP Persentations you need to do the mapping yourself (I don't think there is a way around this).
Assuming you're using a JSP Presentation with a Fuego Object Interactive Call, click the 'Advanced' button at the bottom of the Main Task dialog.
Select the 'showOut' argument set, add a new argument mapping. Select 'result' from the Screenflow's instance variables and map it to 'parameters["paramName"]'. Where paramName is the name of the HTML submit input element in your JSP.
Hope this helps,
Tim -
How to check the owner of any Object in the database.
How to check the owner of any Object in the database.
Thanks
HimanshuWhat about this ?
SELECT owner,Object_name,object_type FROM all_objects
OR
SELECT owner,Object_name,object_type FROM dba_objects -
Unable to check Null condition in a Shell Script
Hi,
When I am using to check the Null Condition To check for a Running Java Process its failing to check.
I am using variable in a shell script
DPID=$(ps -ef |grep - i java|grep -v grep)
if [ "$DPID"="" ' ];then
else
fi
If the DPID has Null value then its getting executed but if the DPID has value its not getting into the else part of the loop
Thanks and RegardsYou could try -c to make grep return a count of matches, then check if this count is zero or not.
DPID=`ps -ef |grep - i java|grep -vc grep`
if [[ $DBID -ne 0 ]]; then
else
fi -
How to check null status of a ResultSet
In my servlet program i'm tring to connect to a database and retrieve some values. Establishing the connection to the database working fine i can retrieve what ever the values from the desired table(empDetails),But my problem is if empDetails table is empty how do i check null or BOF=true status of the ResultSet. I use "sun.jdbc.odbc.JdbcOdbcDriver".Please any one help me on this matter.
Thanks!if (rs.next()) //rs.next() returns a boolean value
//process resultset
}else{
//resultset is null
}No, the ResultSet will never be null. It may be empty, but not null. Otherwise, rs.next() is the most common way of determining if the ResultSet has data. -
How to check 2 condition types (kschl)
Hi,
READ TABLE i_komv WITH KEY kposn = ekPo-ebelp kschl EQ 'JEC1' OR
KSCHL EQ 'JMO1'.
how to write this above stmt? I have to check 2 condition types with a single read stmt?
regards,
Star ShankarI guess Kishan wants to refer as:
READ TABLE i_komv WITH KEY kposn = ekPo-ebelp .
if <b>i_komv-</b>kschl EQ 'JEC1' OR
<b>i_komv-</b>KSCHL EQ 'JMO1'.
....<code>
endif.
As KSCHL is part of internal table I_KOMV.
or
READ TABLE i_komv WITH KEY kposn = ekPo-ebelp .
check i_komv-kschl EQ 'JEC1' OR i_komv-KSCHL EQ 'JMO1'.
....<code>
Kishan,
Correct me if i am wrong.
Regards
Eswar -
HELP !!! How to check the size of an object in Photoshop ?
Hello,
I'm using Photoshop CS 3 to design a website. I used several shapes such as rectangle, line or ellipse of different size. Probably it is a stupid question but I don't know how to check the size of an existing rectangle. I tried free transform tool that selects my rectangle but doesn't show its size. Then I made a selection with rectangular marquee tool but I see nowhere the size of the selected area.
If you know the name of such a tool please help me !
Have a nice day !Web images are all pixels. View at 100% at pixel view. that is your exact size
-
How to check the values of view object?
Hi all,
I created a new view object by right clicking my application module. Now when I try to retrieve values
of the attributes of the view object I am getting null pointer exception. How do I check whether the view has
some values in it or not manually using select statement ? I try to find the view in my database at database navigator
but it was not there. Kindly help me out in this.
Thanks,
Phanindra.
Edited by: 887737 on Oct 19, 2011 12:53 AMHi,
Right click on application module(yourAM in model project) and press Run,Then you can confirm whether your ViewObject is working or not.
Note:
Generally create viewObject using EO based or Query based how did you create viewObject
See:
http://download.oracle.com/otn_hosted_doc/jdeveloper/1012/bc4j/intro/bc_avo.html
http://www.adftips.com/2010/09/adf-model-creating-view-object-vo.html -
Hi All
I have strucked with code pls help....
How can i check the codition in java server faces.....?
like in my Application when user provides the in put like some state name in the next page i have to display some url for that state .......if he provide some other state name it will be different url .....pls help me how can i do that,,,,,,???
thanks in advance..There are certainly ways to do that. E.g. using the rendered attribute, using conditional statements in EL, using a specialized getter for that (lazily loaded if necessary), etcetera. But your functional requirement is unclear, so I can't go in detail with that.
In the future, please try to write normal English sentences. Don't write like SMS talk and save the periods and commas. The more effort you put in your question, the more chance you will be taken for serious and the more effort others will post in their answers.
Also, in the future, JSF related questions should be posted in the JSF forum.
Edited by: BalusC on 12-aug-2008 7:47 -
How to check two conditions while loading to target
Hi All,
I am New to ODI could you please help me in solving this issue.
Actually I scenario is
I am loading from DB2/As400 to oracle
I have so many itemsno's in source table, and I have to check
if count(itemno)>1 and uom='CS' then UOM_flag = 'N' else 'Y'Hi,
Welcome to ODI world! lol
At the column UOM_flag mapping use a "case when" structure (I'm assuming you Work/Stage area is at Oracle)
I believe will be something like:
Case when count(itemno) > 1 then 'N'
else 'Y'
end
ODI will define, automatically, all necessary columns as group by expression...
Does it help you?
Message was edited by:
Cezar_Santos -
How to check object with boolean
hi
i have a JComboBox
i have added the items to JComboBox as {"true", "false"}
my problem is how check with boolean
like i was trying like this
public boolean getBooleanValuesOfComboBox() {
if(Boolean.TRUE.equals(_comboBox.getSelectedItem())) {
return true;
return false;
how to do this JComboBox getSelectedItem will return object... how to check
thank u
null> i have a JComboBox
i have added the items to JComboBox as {"true",
"false"}
You could store Boolean objects in that combo-box instead of Strings. -
How to check all items are not null in CAML Query?
HI All,
In a CAML Query, i got three items. In all three items, a particular column(Closure Date) should not be null. How to check in all three items, where 'Closure date' is not null?
Thanks in advance!Hi,
Try this:
"<Where><IsNull><FieldRef Name='Closure Date' /></IsNull></Where>"
Hope it hepls!
Thanks,
Avni Bhatt
If this helped you resolve your issue, please mark it Answered -
How to update Ztable from Excel file and how to check conditions ,
HI this uday,
pls help me how can i update Ztable from Excel file and how to check conditions .
regards
uday
Moderator message: please (re)search yourself before asking.
Edited by: Thomas Zloch on Jul 13, 2010 12:00 PMHi
Use Fm : ALSM_EXCEL_TO_INTERNAL_TABLE.
L_INTERN : internal table with your fields .
make sure that the fields in the Excel should be formatted (as numeric , characher ) depending upon the data types .
LOOP AT L_INTERN INTO WA_LINTERN .
MOVE WA_LINTERN-COL TO L_INDEX.
ASSIGN COMPONENT L_INDEX OF STRUCTURE WA_INREC TO <FS> .
IF SY-SUBRC = 0.
MOVE WA_LINTERN-VALUE TO <FS>.
ENDIF.
AT END OF ROW . "#EC *
APPEND WA_INREC TO IT_DATA. "
CLEAR WA_INREC.
ENDAT.
ENDLOOP.
Regards
Swapnil -
How to check was the object bound or not without exception handling?
context.lookup("someName");throws NameNotFoundException in case object was not bound to someName.
How to check was the object bound or not without exception handling?context.lookup("someName");throws NameNotFoundException in case object was not bound to someName.
How to check was the object bound or not without exception handling? -
How to check table is NULL or not when a form load?
How to check table is NULL or not when a form load?
I want to make the form when it load it check the data in table, if there are no data in table other form will be load.
Sorry for bad English...Maybe you can do this in form1's Form_Open event:
if dcount("*", "table1") = 0 then
Cancel = True
Docmd.Openform "form2"
end if
-Tom. Microsoft Access MVP
Maybe you are looking for
-
Can't open/Install some programs
I have a new (refurb) MacbookPro 1.8. I did the migration when I set it up. For some reason I download certain programs, like Flip4Mac, and it is a .mpkg. When I click on it the Macbook says it can't find an app to open it. What do I do?
-
Photo resolution when using a single photo column
In the photo layout page you can choose the number of columns of photos to display. If you choose 2-3 columns you get little thumbnails of low resolution. Thats fine. But if you choose 1 column, the photo is large but not clear, presumably because i
-
Black border around playlist DMP 4310
I'm using a playlist for html assets with the DMP 4310, but they all render with a black border. Is there any way to get rid of that? EDIT: In DMS 5.3, the DMP 4310 was not able to render html, but we upgraded to 5.4 and are now able to render with t
-
Just a quickie, but I just can't seem to find the info no matter what criteria I Google... I'm currently using Captivate 6...I'm beginning a project and the task manager has offered to get me Captivate 8...not really interested in the new learning cu
-
Finding PO number with ITEM text as input
Hello Is there any way/table/fm to list down all the PO that has a particular ITEM text without writing a program . For eg , PO 123 , has an ITEM text 'aaaa bbbb cccc dddd' . Now i want to find out all the PO that has this particular text as its ITEM