Ho to retrive error messge from data base

Dear,
i created one generic validation code in sample.java which is below i mentioned
public class sample implements Validator {
public sample() {
super();
@Override
public void validate(FacesContext facesContext,
UIComponent uIComponent, Object object) throws ValidatorException {
//String phone = object.toString();
System.out.println(".....object.."+object);
if(object == null || object.equals(""))
FacesMessage fm1;
fm1 = new FacesMessage("eghghgh");
throw new ValidatorException(fm1);
String phone = object.toString();
String numToken="[\\p{Digit}&&[123456789]]+";
if(phone.matches(numToken))
System.out.println(".........inside if condition...");
if (phone.length() < 9)
FacesMessage fm =
new FacesMessage("phonevalidator number should be at least 9 digits");
throw new ValidatorException(fm);
//System.out.println("you enter a VALID number format");
/*if (phone.length() < 9) {
FacesMessage fm =
new FacesMessage("phonevalidator number should be at least 9 digits");
throw new ValidatorException(fm);*/
}else{
FacesMessage fm3 =
new FacesMessage("Can accept only numbers");
throw new ValidatorException(fm3);
But my question is i dont want write this error message here(Can accept only numbers) .i have one table in database .this error message and error no are there .how i will populate from database?

Hi,
Always mention your JDev version and the technologies used.
Have you tried creating a VO based (assuming you are using BC) on the error messages table, get the message according to the number (you can have a method in that VO impl, that would take the error number and return text), and display it?
-Arun

Similar Messages

  • Where can get IDOC Error Message from Data base tables

    Hi ,
    i am automating idoc  checking process,in which i am getting control record from EDIDC tables,now i need to fetch Error message
    using this idoc no.
    How can fetch   error message text ?
    Thanks in advance.
    Regards
    sarath

    Hi its a structure, it doesnt store data.
    Take it from the table specified,
    Pass STAMID,STAMNO,STAPA1,STAPA2,STAPA3,STAPA4 to function module MESSAGE_PREPARE and you will get the message text.
    Also check the function module IDOC_READ_COMPLETELY

  • When to refresh Servlet data from Data Base

    Hello all,
    I have a servlet that retrive few hundreds thousands records from data base table.
    The data in data base table being updated once or twice in every week.
    Since same servlet instance serve all users, that access the servlet many times a day.
    I would like to avoid retriving the data from data base on each servlet access.
    and make the users use same data already retrieved and kept in servlet members.
    First, what is the best way to avoid data retrive from data base on each servlet access?
    and how could I have some kind of trigger that will refresh servlet data from data base every few days?
    Thanks in advance for every idea.
    Ami

    Java_A wrote:
    Thanks Saish for your reply.
    I'm not using DAO in my application but retrive the data from BI data base using a web service. response time querying the BI data base is not quick enuogh.
    Since, I wouldn't want to query the BI server on each servlet access.
    Because the data I retrived at the begining using the web service contains all required data for all servlet requests, I thought to store the data (~200K rows) once in the servlet which will be using for all requests.
    Why not store the results locally in your own database after you fetch them?
    This still leave me with the questions: in which event should I query the BI data, and also when or in which event should I update the data again from BI server?
    Query at startup, an user demand, when data becomes stale. It depends on your requirements.
    >
    Thanks
    Ami- Saish

  • Can't open aperture 3,  warning box comes up," warning there was an error opening the data base for the library /pictures/aperture library .aplibrary  Whats up?

    I have had Aperture 3 loaded on my computer for a while now. Never had any problems till tonight. Restarted my computer and went to open Aperture and a "warning" box poped up, There was an error opening the data base for the library /picture/aperture library ap library.   Then a "quit" button.
    What is going on and how can I open my aperture. I have pictures that need worked for clients.  Help!

    Have you run through the steps in Aperture 3: Troubleshooting Basics. If not that's always a good place to start.
    If that doesn;t resolve the problem when you post back describe your hardware and software setup.
    good luck

  • Util class to extract Data from Data base Table.

    Is there any Util class to extract all records from Data base table into DAT file.For example(get all amployees from EMPLOYEE table in to employee.DAT )

    What is a DAT file?
    Anyway, this can be achieved using a shot of JDBC [1] and some business logic [2] to populate/group/concat the data together in a DAT format and writing [3] it to that DAT file.
    [1] JDBC tutorial: http://www.google.com/search?q=jdbc+tutorial+site:sun.com
    [2] Use your brains and things you ever learnt in maths and basic Java tutorials/books.
    [3] I/O tutorial: http://www.google.com/search?q=io+tutorial+site:sun.com

  • Error while adjusting data base

    Hi All,
    while adjusting data base in SE14 i got an error in converting QCM8TAB to TAB so i unlock the table and continue. Actually in this process QCM8TAB is a temporary table its need to be deleted after adjusting. but because of the process was not completed QCM8TAB was not deleted.how to delete QCM8TAB.
    Thanks,
    Ananth

    Have u deleted the records in the table and then tried to delete the table from SE11? I think after u delete the records u can also delete the table from SE14.. Try it..
    Hope it may helps.
    Please reward if it helps.
    Thanks in advance,
    Phani

  • Error when saving data basis

    Dear Eugene
    I am on an implementation project. I copied 0BCS_C11 cube and modified the characteristics to my requirements the data stream generation is successful but when i save the data basis the system gives me the following error.
    Role Document Type is not yet allocated in data basis SB
    Role Period is not yet allocated in data basis SB
    Role Fiscal Year is not yet allocated in data basis SB
    Role Group Currency is not yet allocated in data basis SB
    Role Value in Group Crcy is not yet allocated in data basis SB
    Role Item is not yet allocated in data basis SB
    Role Partner Unit is not yet allocated in data basis SB
    Role Consolidation Group is not yet allocated in data basis SB
    Role Consolidation Unit is not yet allocated in data basis SB
    Role Version is not yet allocated in data basis SB
    I have assigned the roles to the characteristics. But still the error persists. Can i you please guide me.
    Thanks and Regards
    Maneesh Dhingra.

    Try using an alias for the column like this statement:
    select code as CODE from lm_code
    Thanks,
    Bipuser

  • Delete From Data Base

    Dear Experts
    How we can  delete the Planned order & also  Production order from the DATA base sothat they will not display again.
    i have already setup the deletion Flag on all production order And also planned order were also deleted from the Delete button.
    so i need to delete it from the Data Base sothat it will not appear in the data.
    Rgds
    Pankaj Agarwal

    Dear,
    What is error you are getting?
    See also SAP notes 540834
    CO78 is a one stop transaction for production order setting deletion flag, deletion indicator, archiving and finally deleting. Please follow these step,
    Generally we schedule the following programs in background in the sequence below,
    1. PPARCHP1 for Setting Deletion Flag
    2. PPARCHP1 for Setting Deletion Indicator (Once set cannot be revoked- so care should be taken in selection of orders)
    3. PPARCHA1 for archiving the production order with Deletion Indicator active. Basis should set the database/storage space for archiving/storing the records.
    4. PPARCHD1 for Deleting the records from SAP database.
    Regards,
    R.Brahmankar

  • Performance problem in select data from data base

    hello all,
    could you please suggest me which select statement is good for fetch data form data base if data base contain more than 10 lac records.
    i am using SELECT PACKAGE SIZE n statement,  but it's taking lot of time .
    with best regards
    srinivas rathod

    Hi Srinivas,
    if you have huge data and selecting ,you could decrease little bit time if you use better techniques.
    I do not think SELECT PACKAGE SIZE  will give good performance
    see the below examples :
    ABAP Code Samples for Simple Performance Tuning Techniques
    1. Query including select and sorting functionality
    tables: mara, mast.
        data: begin of itab_new occurs 0,
                 matnr like mara-matnr,
                 ernam like mara-ernam,
                 mtart like mara-mtart,
                 matkl like mara-matkl,
                 werks like mast-werks,
               aenam like mast-aenam,
    stlal like mast-stlal,
         end of itab_new.
    select fmatnr fernam fmtart fmatkl gwerks gaenam g~stlal
    into table itab_new from mara as f inner join mast as g on
    fmatnr = gmatnr where gstlal = '01' order by fernam.
    Code B
    tables: mara, mast.
    data: begin of itab_new occurs 0,
          matnr like mara-matnr,
          ernam like mara-ernam,
          mtart like mara-mtart,
          matkl like mara-matkl,
          werks like mast-werks,
          aenam like mast-aenam,
          stlal like mast-stlal,
    end of itab_new.
    select fmatnr fernam fmtart fmatkl gwerks gaenam g~stlal
    into table itab_new from mara as f inner join mast as g on f~matnr =
    gmatnr where gstlal = '01'.
    sort itab_new by ernam.
    Both the above codes essentially do the same function, but the execution time for code B is considerably lesser than that of Code A. Reason: The Order by clause associated with a select statement increases the execution time of the statement, so it is profitable to sort the internal table once after selecting the data.
    2. Performance Improvement Due to Identical Statements – Execution Plan
    Consider the below queries and their levels of efficiencies is saving the execution
    tables: mara, mast.
    data: begin of itab_new occurs 0,
          matnr like mara-matnr,
          ernam like mara-ernam,
          mtart like mara-mtart,
          matkl like mara-matkl,
          werks like mast-werks,
          aenam like mast-aenam,
          stlal like mast-stlal,
    end of itab_new.
    select fmatnr fernam fmtart fmatkl gwerks gaenam g~stlal
    into table itab_new from mara as f inner join mast as g on f~matnr =
    gmatnr where gstlal = '01' .
    sort itab_new.
    select fmatnr fernam
    fmtart fmatkl gwerks gaenam g~stlal
    into table itab_new from mara as
    f inner join mast as g on f~matnr =
    gmatnr where gstlal
    = '01' .
    Code D (Identical Select Statements)
    tables: mara, mast.
    data: begin of itab_new occurs 0,
          matnr like mara-matnr,
          ernam like mara-ernam,
          mtart like mara-mtart,
          matkl like mara-matkl,
          werks like mast-werks,
          aenam like mast-aenam,
          stlal like mast-stlal,
    end of itab_new.
    select fmatnr fernam fmtart fmatkl gwerks gaenam g~stlal
    into table itab_new from mara as f inner join mast as g on f~matnr =
    gmatnr where gstlal = '01' .
    sort itab_new.
    select fmatnr fernam fmtart fmatkl gwerks gaenam g~stlal
    into table itab_new from mara as f inner join mast as g on f~matnr =
    gmatnr where gstlal = '01' .
    Both the above codes essentially do the same function, but the execution time for code B is considerably lesser than that of Code A. Reason: Each SQL statement during the process of execution is converted into a series of database operation phases. In the second phase of conversion (Prepare phase) an “execution  plan” is determined for the current SQL statement and it is stored, if in the program any identical select statement is used, then the same execution plan is reused to save time. So retain the structure of the select statement as the same when it is used more than once in the program.
    3. Reducing Parse Time Using Aliasing
    A statement which does not have a cached execution plan should be parsed before execution; this parsing phase is a highly time and resource consuming, so parsing time for any sql query must include an alias name in it for the following reason.
    1.     Providing the alias name will enable the query engine to resolve the tables to which the specified fields belong to.
    2.     Providing a short alias name, (a single character alias name) is more efficient that providing a big alias name.
    Code E
    select jmatnr jernam jmtart jmatkl
    gwerks gaenam g~stlal into table itab_new from mara as
    j inner join mast as g on jmatnr = gmatnr where
                g~stlal = '01' .
    In the above code the alias name used is ‘ j ‘.
    4. Performance Tuning Using Order by Clause
    If in a SQL query you are going to  read a particular database record based on some key values mentioned in the select statement, then the read query can be very well optimized by ordering the fields in the same order in which we are going to read them in the read query.
    Code F
    tables: mara, mast.
    data: begin of itab_new occurs 0,
          matnr like mara-matnr,
          ernam like mara-ernam,
          mtart like mara-mtart,
          matkl like mara-matkl,
          end of itab_new.
    select MATNR ERNAM MTART MATKL from mara into table itab_new where
    MTART = 'HAWA' ORDER BY  MATNR ERNAM  MTART MATKL.
    read table itab_new with key MATNR = 'PAINT1'   ERNAM = 'RAMANUM'
    MTART = 'HAWA'   MATKL = 'OFFICE'.
    Code G
    tables: mara, mast.
    data: begin of itab_new occurs 0,
          matnr like mara-matnr,
          ernam like mara-ernam,
          mtart like mara-mtart,
          matkl like mara-matkl,
          end of itab_new.
    select MATNR ERNAM MTART MATKL from mara into table itab_new where
    MTART = 'HAWA' ORDER BY  ERNAM MATKL MATNR MTART.
    read table itab_new with key MATNR = 'PAINT1'   ERNAM = 'RAMANUM'
    MTART = 'HAWA'   MATKL = 'OFFICE'.
    In the above code F, the read statement following the select statement is having the order of the keys as MATNR, ERNAM, MTART, MATKL. So it is less time intensive if the internal table is ordered in the same order as that of the keys in the read statement.
    5. Performance Tuning Using Binary Search
    A very simple but useful method of fine tuning performance of a read statement is using ‘Binary search‘ addition to it. If the internal table consists of more than 20 entries then the traditional linear search method proves to be more time intensive.
    Code H
    select * from mara into corresponding fields of table intab.
    sort intab.     
    read table intab with key matnr = '11530' binary search.
    Code I
    select * from mara into corresponding fields of table intab.
    sort intab.     
    read table intab with key matnr = '11530'.
    Thanks
    Seshu

  • Create the file from data base

    iam trying to upload material master data using direct input method in lsmw. i want one input text file which contains the information about material master data.
    can any one pls help me how to create this material master txt file from the data base.
    thanks,
    pandu.

    I have used so many times below data for testing purpose :
    Keep the file data as comma delimter and use only basic data view.
    material  industrial sector  material type   material desc  Unit of meas   Matl group
    A004      M                      COUP             test A004        KG                01
    a005      M                      COUP             test a005         KG                01
    remove the header and basic data view - keep constant while mapping.
    Thanks
    Seshu

  • Call function from data base with clob input parameter.

    Hello,
    In this project I use Jdev 11g.
    I call function from database.
    create or replace function get_fa_list (
    p_fa_id_list in clob
    return sys_refcursor
    is
    vCursor sys_refcursor;
    begin
    put_msg ('begin');
    if p_fa_id_list is null then
    put_msg ('CLOB is null!');
    else
    put_msg ('size CLOB: ' || dbms_lob.getlength (p_fa_id_list));
    end if;
    put_msg ('Save');
    open vCursor for
    select rownum as id, s.*
    from (
    select f.latitude, f.longitude, count (distinct f.res_id) as res_count, count (*) as fa_count, 16711680 as color, res_concat_distinct (f.res_id) as station_list
    from mv_frequency_assignment f, table (SplitClob (p_fa_id_list, ',')) l
    where f.ext_system = 'BI' and
    f.ext_sys_id = l.column_value
    group by f.latitude, f.longitude
    ) s;
    put_msg ('Open and End');
    return vCursor;
    end get_fa_list;
    I use TopLink in ejb.
    i use follow code for call function and get result.
    public List<TmpResPoints> findAllPointsBI(String p_id){
    UnitOfWork uow = getSessionFactory().acquireUnitOfWork();
    uow.beginEarlyTransaction();
    StoredFunctionCall call = new StoredFunctionCall();
    call.setProcedureName("get_fa_list");
    call.useUnnamedCursorOutputAsResultSet();
    ClobDomain c = new ClobDomain(p_id);
    //System.out.println(c.toString());
    call.addNamedArgumentValue("p_fa_id_list", c);
    ReadAllQuery query = new ReadAllQuery();
    query.setReferenceClass(TmpResPoints.class);
    query.setCall(call);
    List<TmpResPoints> result = (List<TmpResPoints>)uow.executeQuery(query);
    uow.commit();
    uow.release();
    return result;
    But size parameter "p_fa_id_list" is 0. (geting from temp table in Data base). this code in function >>
    if p_fa_id_list is null then
    put_msg ('CLOB is null!');
    else
    put_msg ('size CLOB: ' || dbms_lob.getlength (p_fa_id_list));
    end if;)
    How I can call this function from dataBase and get result?
    thx,
    Demka.

    What is the SQL generated?
    The argument should just be the Clob value (a String) not the domain object.
    Also try addNamedArgument, and then pass the named argument to the query.
    James : http://www.eclipselink.org

  • Error to Access Data Base on SAP Netweaver 6.40 Sneak Preview SP14

    Hi guys,
    If someone could help me I'd be very grateful!
    I've installed the NW 6.40 Sneak preview SP 19 and it's working well, however I tried to access the Data Base by MaxDB. So I provided the configuration data, such as:
    Server: myServer like 192.168.0.12
    DataBase: J2E
    User: SAPJ2EDB
    Password: myPassword
    but when I try to connect on it, the system does not allow and display me the following message:
    24950 user authorization failed,
    I tryed to use the user Custom but it also didn't work! the system display me the following message:
    Invalid Session ID!
    PS: When I try to access my ConfigTool to change the SAPJ2EDB password the ConfigTool doesn't open and display me this message:
    Error occurred while working with Configuration (Scanning).
    Msg: Error while connecting to DB.
    In my opinion I suppose that I need to apply some note. What do u think about that? I suppose it coz I've installed the WAS and I didn't do anything more!
    beforehand, thanks for help!
    Cheers!
    Eduardo

    Hello Eduardo,
    1. Could you please check if you could connect to the database using dbmcli tool:
    Login as j2eadm user, run the following commands & update with outputs:
    dbmcli db_enum
    dbmcli u2013d J2E u2013u control,<pwd> db_state
    dbmcli u2013d J2E u2013u control,<pwd> user_getall
    2. What ist he database version?
    Thank you and best regards, Natalia Khlopina

  • Error messge during data extract from flatfile to sap bw using DataServices

    I am extracting data from flat file to SAP BW using Data Services tool. I am able to load all the data from flat file to SAP BW 3.x datasource successfully, but the request in in RED status with error message
    Error Encountered at RFC Server Please Check Parameter Setting at BW System.
    Can someone please help me how to resolve this issue?

    I would recommend to post your question here
    Data Services and Data Quality
    and close the current thread.
    Regards,
    Stratos

  • How to retrive images from data base

    I am facing problem to retriving image data from
    DATABASE
    and how can i so that retrived image into web page
    plz help me

    Look at the URL below:
    How to store/retrieve image to/from SQLServer
    http://www.java-tips.org/content/view/203/29/
    Example below fetch pdf doc from database and show in browser, in order to show image the only difference would be setting the content type to
    response.setContentType("image/jpeg");
    How to view XLS documents loaded from database in the web browser
    http://www.java-tips.org/content/view/844/29/

  • How to retrive dynamic directory structure from data base and show it

    i want to display a directory structur on jsp my problem is that i want to read it from a database how i can read
    a tree structure i found a function to read directry structur but if i use this function i am not able to find who the parent is ? this is the function i found cna any one help me ?
    public void iterate(File someDirectory) {
    Vector allFiles = new Vector();
    File[] dirContents = someDirectory.listFiles();
    for (File f : dirContents) {
    allFiles.add(f);
    for (int i = 0; i < allFiles.size(); i++) {
    File file = (File) allFiles.get(i);
    if (file.isDirectory()) {
    dirContents = file.listFiles();
    for (File f : dirContents) {
    allFiles.add(f);
    // Process 'file' or do whatever
    }

    Thanks for reply i am not actualy deling with files i am creating a web application in which i am having organize functionality
    user creat folders and put there document in that like out look user can creat folder inside folder
    i am storing tham in a database table my problem is how to retrive them so i can show them as a tree structur
    i am using this code to show on jsp
    {color:#808000}<table>
    <tr>
    <td >
    <ul class="flipMenu">
    <li><span class="menu">Folder</span>
    <ul>
    <c:forEach var="folderList1" items="${folderList}" >
    {color}
    {color:#808000}<li ><a class="submenu25" id='<c:out value="${folderList1.id}"/>' href="folderAgreement.htm?folderid=<c:out value="${folderList1.id}"/>" onmouseup="a('<c:out value="${folderList1.id}"/>');" ><span ><c:out value="${folderList1.name}" /> T</span></a>
    <ul>
    <li> <a href="# onclick="window.open('createSubFolder.htm?folderid=<c:out value="${folderList1.id"/>&agreetitle=<c:out value="${agreements.title}"/>', 'invite_wnd', 'height=700, width=800, status=no, menubar=no, toolbar=nu, location=400'); return false;">Add Folder
    </li>
    <li> <a href="folderDetail.htm?folderid=<c:out value=${folderList1.id"/>&flag=folder"><span class="submenu2">Detail</span>
    </li>
    <li> <a id="<c:out value="${folderList1.id}"/>" href="folderDelete.htm?folderid=<c:out value="${folderList1.id}"/>&flag=folder" onclick="conformDelete('<c:out value="${folderList1.id}"/>')" ><span class="submenu2">Delete Folder</span></a>
    </li>
    </ul>
    </li>
    </c:forEach>
    {color}
    {color:#808000}</ul>
    </li>
    </ul>
    </td>
    </tr>
    </table>{color}

Maybe you are looking for

  • CONVERTING ERROR MESSAGE TO WARNING MESSAGE

    HI GURUS,   CAN ANY ONE GIVE ME IDEA HOW TO CONVERT ERROR MESSAGE TO WARNING MESSAGE IN QM MODULE.WHEN I AM POSTING STOCK FROM QUALITY TO UNRESTRICTED. BECAUSE IAM GETTING ERROR WHEN IAM POSTING STOCK GIVING ERROR TRANSFER POSTING THROUGH QUALITY ONL

  • Please help - black screen blinking cursor 24" imac and XP home sp2

    Brand new 24" imac purchased yesterday from the apple store with a 4 gig ram upgrade (i.e. all the newest stuff/versions). All updates installed & current. Brand new (clean & scratchless) copy of Windows XP Home with SP2. I ran the bootcamp assistant

  • Satellite L500D - What kind of slot is under the battery?

    I have found a slot( i think it's memory slot) under battery in my satellite L500D. What kind of slot is that?(It looks like for MicroSD card, but sign says it's WIS slot - I have searched but I haven't found what does it means) Does it work in my la

  • Best mlb.tv settings?

    As I settle down to watch the Cardinals-Mets game on crappy, annoying mlb.tv, I was wondering if anyone knows the best settings? I am watching on a Mac Pro, with flip4mac. It's playing fine, but I know that on a PC I have the option of resizing the w

  • Can't download on my phone...huawei ideos c8150,android froyo 2.2

    its says 'not compatible with your device'