How can i check if the database contains the rows stated or not?

hi there..
i hav a problem here. I need to check the database if it contains the row of the attribute. If it doesnt not hav the row, i would then insert a new row into it, or else, i would only update the attribute. I have encountered a null pointer error and i've been trying to resolve it but i cant solve it. Here's my code..
"i" is the attribute i wan to check if it exist in the database.
"id" is the attribute i wan to check, from my JSP
String m = null;
String sql11 = "SELECT i from database WHERE i ='" + i+ "'";
System.out.println(sql11);
try {
db = new Database();
rs = db.readRequest(sql11);
if (rs != null && rs.next()) {
U u= new U();
u.setU(rs.getString("i"));
m = u.getU(); ==> this is the line tat's givin my null pointer
System.out.println(m);
db.close();
} catch (SQLException se) {
se.printStackTrace();
throw (new UserException("Unable to retrieve from Database!"));
} catch (Exception e) {
e.printStackTrace();
throw (new UserException("Unknow error encountered!"));
if (m.equals(id)){
//performs the updating of database
else if (m_userID.equals("nil")){
// performs the inserting of new row in the database
}*/

And what does getU() do?

Similar Messages

  • How can i use offline & online database in the same time?

    how can i use offline & online database in the same time?
    my database in another server when the connection true it connect
    but if not does not work
    i wanna make offline database if the server not connected it connect offline then the server is on it alter all data from the offline to the server.

    User, please tell us your Jdev version!
    There is no such functionality build into the framework. The offline data base is only for designing the db, not to have a backup db.
    If you can't connect to the db the application will not work.
    Timo

  • How can I check if I am using the latest version of Firefox browser? I have just seen a popup saying I am not and that I should click on the popup to upgrade.

    As above

    Hello, from your system details I can see that you are using the latest version of Firefox (24).
    Here is how to check it: '''Firefox menu''' > '''Help''' > '''About Firefox''' or visit this link [https://www.mozilla.org/firefox www.mozilla.org/firefox]
    Can you give me more details about the popup?

  • HT203180 how can you check prior to purchase if the video format is compatible, and how to get refund if purchased itunes video cannot play on the ipod

    Is it possible to check prior to purchase that the iTunes video about to be purchased can played on the iPod.  Also is it possible to get refund if purchased videos from itunes are not compatible on their own products (i only play videos on my ipod).

    I am having this same issue since I updated OS7. Please advise.

  • How can I check a Remote Database is alive in a Stored Procedure

    Hi
    In a PL/SQL stored procedure, I do a select from a table on a remote database via the database link. There is a Loop around the select as it waits for a flag to be set on the remote table. However, on several occasions, while looping, the remote database has gone down and the procedure then fails with error:
    'Details ORA-02068: following severe error from ORA-02068: following severe error from 'Remote Database ' ORA-01033: ORACLE initialization or shutdown in progress ORA-06512: at "Current Database.Stored Procedure", line'
    Is it possible to trap this error and prevent the procedure from crashing?
    My current code is like:-
    LOOP     
    SELECT flag
    INTO v_flag
    FROM remote_table@remote_db;
         IF v_flag= 'OK'
         THEN
    < Run Oracle Warehouse Builder Process Flow >
         EXIT;
         ELSE dbms_lock.sleep(600);
         END IF;
    END LOOP;
    Any help with this would be appreciated.
    Thanks
    GB

    Hi Bernd
    Thanks for your help. If I do this, I think the procedure would continue onto the 'IF' statement. I am looking for a way of looping round and trying to run the select again before moving on.
    If I did something like
    LOOP --- Loop 1 ---
    LOOP --- Loop 2---
    BEGIN
    SELECT flag
    INTO v_flag
    FROM remote_table@remote_db;
    EXCEPTION WHEN OTHERS THEN NULL;
    END;
    -- Need to exit if no exception ---
    END LOOP;
    IF v_flag= 'OK'
    THEN
    < Run Oracle Warehouse Builder Process Flow >
    EXIT;
    ELSE dbms_lock.sleep(600);
    END IF;
    END LOOP;
    Is there a way of going back to the start of Loop 2 if there was an exception, otherwise EXIT and continue onto the 'IF' statement.

  • I lost my latest photos when I mirrored my new iPhone 5 with my previous iPhone 4. How can I check if they're in the Cloud?

    I lost my latest photos when I mirrored my new iPhone 5 with my previous iPhone 4, and I don't know how to access the Cloud to check if they're still there. Can someone help me how to access the Cloud to check my content?
    Thanks, gd

    If you backed up your iPhone 5 before you did this, photo in the camera roll would be included in the backup.  You would have to restore the entire backup to recover them.  Also, you can see what's in the backup ahead of time.  You can only find out what photos are there by restoring the backup.

  • How can I check my daugters text messages?

    How can I check my Daughters text messages?  Her boyfriend is not the kind of boy I want her seeing but she is young and doesn't know what she wants.

    It is very simple.
    depending on how old she is.  If she is a minor, then the phone is technically your property and under contract with you. If she is older then 18 then you could have some legal issues in trying to do this.
    Either way, you can install SMS Backup on her phone or one of the other SMS apps.  SMS Backup will save a copy of every text message to a gmail account and you can simply read them from gmail.
    I am not going to lecture on the ethical or legal part of this as I do track my son (for various reasons) with this (with 100% knowledge on his side)

  • How can i check if a procedure exists in a certain database version

    So today i became really frustrated after noticing that the Oracle SQL version on some computer I needed to work on was 10.1. The problem with that was that I needed a procedure called "xmlserialize". I browsed the documentation for it, but I didn't see anything like "since 11.0" or something similar.
    So.. how can I see what is the first Oracle SQL version that supported some procedure?
    For example, when I check a class definition for Java, I consult the javadoc :
    http://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html
    and there there's a field called "Since". For BigInteger ( it's just an example ), it says "Since: JDK1.1", so I know that if I'm using a JDK version earlier that 1.1, I won't have that class.
    Is there some similar information for Oracle procedures/ functions/ features/ etc?

    >
    Let me be more explicit. I've searched for xmlserialize function.
    The only place on the website that holds information regarding this function is this page:
    >
    To paraphrase sybrand - that's utter nonsense. I have never found only one reference to anything on the web.
    Your question subject is
    >
    how can i check if a procedure exists in a certain database version
    >
    And since you said you were using 10.1 I searched for
    >
    oracle 10.1 xmlserialize
    >
    And the very first link on the search results is
    >
    What's New In Oracle XML DB?
    http://docs.oracle.com/cd/B19306_01/appdev.102/b14259/whatsnew.htm
    >
    That link is for the XML Db Dev Guide for 10g Release 2
    Would you like to guess what you find if you search for xmlserialize?
    Right on the very first page is this
    >
    Oracle Database 10g Release 2 (10.2) New Features in Oracle XML DB
    SQL/XML Standard Compliance (SQL:2005 Standard Part 14)
    Support for the developing SQL/XML standard has been extended. The following SQL functions have been added: XMLPI, XMLComment, XMLRoot, XMLSerialize, XMLCDATA, and XMLParse. Escaping of identifiers has also been updated, in accordance with a change to the SQL/XML standard. See "Generating XML Using SQL Functions".
    >
    Did you notice the second sentence? I removed the clutter to make it easier to see.
    >
    The following SQL functions have been added: . . .XMLSerialize. . .
    >
    Fnding information can't get any easier than that.

  • How can I check and change the system set events trace level?

    Dear all:
    How can I check the system set events trace level? I don't want the alert_log so big.
    Regards
    Terry

    Hi Terry;
    Please check :
    How to determine which system events are currently being set? [ID 845043.1]
    How To List All The Named Events Set For A Database [ID 436036.1]
    How to set EVENTS in the SPFILE [ID 160178.1]
    Also check:
    http://www.dba-oracle.com/t_grid_rac_events_in_Oracle.htm
    http://www.akadia.com/services/ora_events.html
    Hope it helps
    Regard
    Helios

  • There was an error opening the database for the library "/Users/stacia134/Pictures/Aperture Library.aplibrary".  Why am I getting this message and how do I correct it so that I can open Aperture????  any suggestions would be most appreciated

    There was an error opening the database for the library “/Users/stacia134/Pictures/Aperture Library.aplibrary”.  Why am I getting this message and how do I correct it so that I can open Aperture????  any suggestions would be most appreciated

    Then I'd check the system drive, if it has problems.
    To check your System drive boot into the Recovery Partition, see: OS X Lion: About Lion Recovery
    Restart your Mac and hold down the Command key and the R key (Command-R), and keep holding them until the Apple icon appears, indicating that your Mac is starting up.
    You will see a panel, where you can use Disk Utility to check your System Drive.

  • How can i check how many tables are in my database?

    Hi Guyz,
    If any body can tell how can i check how any and which tables are in my database.how big are they.and who are the owners.
    Thanx in advance,
    Navneet Kaur

    hi,
    how any and which tables.select count(*) from dba_tables;
    how big are they.and who are the owners.select a.owners,a.table_name,sum(b.bytes)/1024/1024/1024 from dba_tables a, dba_segments b
    where a.table_name=b.segment_name
    group by a.owner
    regards
    Jafar

  • How can i check the selection profile

    Hi Friends,
    In BS42 have assigned selection  status profile to status profile and few status are assigned to status profile(CRTD, APRV and REL)
    In BS42 i can assign one type of status profile(say XXX) to more than on type of selection profiles(say AAA;BBB;CCC).
    Now I am creating a appropriation request (AR). Now have approved AR. and if I check in AR-->Control data tab and clicking on display status overview i m getting here asystem and user status overview and after scrolling down I can see the status profile.
    Now in AR how can I check that which type of selection status  profile it is choosing though I am able to see the status profile.
    Any pointers
    Regards
    Ashutosh

    status selection profile is used to restrcit the selection of objects from the database
    if you AR with REL and the status selection profile allows REL then this AR will be se;ected and displayed in the report.
    You cannot see the status selection profile in any tabs on the object as you can see the system ans user status

  • IP Job in BW finished, but how can I check the IDoc receive status in BW ?

    Hi,experts
    After I execute a Infopackage with loading more than 200000 records data, the infopackage monitor show me yellow light, 186020 from 200000 records. this infomation still show me till now, seaval hours,it looks pause here.
    And I check the request in the R/3, the Job has finished. as you know it means the R/3 push the IDoc already finished.
    and how can I do now ? or how can I check the IDoc receive status in BW side?

    Hi,
    I too had the same problem, i executed the following to solve the proble, may be this will help you:
    1) Go to T-code SM58 and select TRFC and press F6,
    2) For manual push of I-Docs, GO to T-COde BD87 select perticular idoc and see the status if it is not executed properly then do the manual push by pressing Execute option,
    Thanks,

  • How can I list all folders that contain files with a specific file extension? I want a list that shows the parent folders of all files with a .nef extension.

    not the total path to the folder containing the files but rather just a parent folder one level up of the files.
    So file.nef that's in folder 1 that's in folder 2 that's in folder 3... I just want to list folder 1, not 2 or 3 (unless they contain files themselves in their level)

    find $HOME -iname '*.nef' 2>/dev/null | awk -F '/'   'seen[$(NF-1)]++ == 0 { print $(NF-1) }'
    This will print just one occurrence of directory
    The 'find' command files ALL *.nef files under your home directory (aka Folder)
    The 2>/dev/null throws away any error messages from things like "permissions denied" on a protected file or directory
    The 'awk' command extracts the parent directory and keeps track of whether it has displayed that directory before
    -F '/' tells awk to split fields using the / character
    NF is an awk variable that contains the number of fields in the current record
    NF-1 specifies the parent directory field, as in the last field is the file name and minus one if the parent directory
    $(NF-1) extracts the parent directory
    seen[] is a context addressable array variable (I choose the name 'seen'). That means I can use text strings as lookup keys.  The array is dynamic, so the first time I reference an element, if it doesn't exist, it is created with a nul value.
    seen[$(NF-1)] accesses the array element associated with the parent directory.
    seen[$(NF-1)]++ The ++ increments the element stored in the array associated with the parent directory key AFTER the value has been fetched for processing.  That is to say the original value is preserved (short term) and the value in the array is incremented by 1 for the next time it is accessed.
    the == 0 compares the fetched value (which occurred before it was incremented) against 0.  The first time a unique parent directory is used to access the array, a new element will be created and its value will be returned as 0 for the seen[$(NF-1)] == 0 comparison.
    On the first usage of a unique parent directory the comparison will be TRUE, so the { print $(NF-1) } action will be performed.
    After the first use of a unique parent directory name, the seen[$(NF-1)] access will return a value greater than 0, so the comparison will be FALSE and thus the { print $(NF-1)] } action will NOT be performed.
    Thus we get just one unique parent directory name no matter how many *.nef files are found.  Of course you get only one unique name, even if there are several same named sub-directories but in different paths
    You could put this into an Automator workflow using the "Run Shell Script" actions.

  • I have two email accounts. It is only letting me check one. How can I check the other?

    I registered two different email accounts on my iPad mini. It's only letting me check one. How can I check the other one too?

    Congratuations on your new iPad!
    Since your device is so new, I can state categorically that this an issue with configuration. Delete the account that doesn't work, and enter the information anew.
    If you're still having problems, check that your email address and password are correct, and if possible, verify it by checking your ISP's settings.

Maybe you are looking for

  • Open Procedure for service "BITS" in DLL "C:\Windows\system32\bitsperf.dll" failed

    This error is occurring on my Windows Server 2008R2 server with SQL 2008R2 installed.  I have found lots of "help" but none of it works... The Open Procedure for service "BITS" in DLL "C:\Windows\system32\bitsperf.dll" failed. Performance data for th

  • PDWordFinder and PDETextGetText ,  How to get font, color... ?

    I use 2 methods to develop a plugin<br />1. PDWordFinder to extract text(Japanese & Chinese character), I can extract the text, but I donnot know how to get the text format information.<br />2. PDETextGetText to GetText, I know I can get format infor

  • How the heck to stop Illustrator from logging each session?

    Each time I open Illustrator CC a log builds up into the c:\Users\USERNAME\AppData\Roaming\Adobe\Logs\AIPerformance.log file. Now it's over 600MB in size. This is not good for my SSD!!! So please tell me how the hell to stop this stupid debugging pro

  • Errors by creating new logical Port

    Hy experts, i have a Problem with creating a logical port for an SAP standard Web- service. We need to use a web- service in our Projekt. Because this, i try to create a test-system, using webservice. The real webservice, i have to use, is still unde

  • I cannot access the Itunes store, but I can update my apps.

    I cannot access the Itunes store, but I can update my apps.  I have checked the following per Support: http://support.apple.com/kb/TS1368 These articles have helped other users resolve connection issues: Using MSCONFIG to troubleshoot conflicts in Wi