Input file parsing to insert into DB

Hi,
I have a sample input file as follows:
++++++++++ 2009-09-28 15:10:58 ++++++++++++++
++++++++ DAILY SCORES +++++++++++++++++
2009-09-28 15:10:58|AAAA|0
2009-09-28 15:10:58|BBBBB|0
2009-09-28 15:10:58|ACCCC|0
++++++++ MONTHLY SCORES +++++++++++++++++
2009-09-28 15:10:58|AAAA|30
2009-09-28 15:10:58|BBBBB|50
2009-09-28 15:10:58|ACCCC|60
I should ignore first line and then look for "DAILY SCORES" or "MONTHLY SCORES"string. This determines which MySql table has to be used.
Then read the following lines delimited by pipe and insert them into MySql table
Table schema is as follows:
dateandtimestamp | program | score
Please suggest the best approach to do this.
Thanks,
Mona.

Thanks. I got it working till the point where I am able to split each line into separate tokens.
There is a separating line in the file +++++++++++ DAILY SCORES +++++++++++++++
The string in this line can differ based on what kind of data follows. Ex: Daily Scores, Monthly Scores etc...
How should I ignore all +++ symbols and search for string?
Here is my code so far:
public static void main(String[] args) {          
          try {
               File file = new File(FILENAME);
               BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
               String line = reader.readLine();
               if(line.startsWith("++++"))
                                            // Ignore +++ symbols and search for string                    
               while(line != null){     
                    dbRecordBuilder(line);
                    line = reader.readLine();                    
               reader.close();               
          } catch (IOException e) {               
               e.printStackTrace();
        public static void dbRecordBuilder(String line) throws IOException
          String[] recordData = line.split("\t");
          for(int i=0;i<recordData.length;i++)
          System.out.println(recordData);     
Edited by: IDForums on Sep 29, 2009 1:26 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • How do I reduce the MG size/compress file prior to inserting into word or excel?

    How do I reduce the MG size/compress file prior to inserting into word or excel?

    The Mac is (IMHO) - Excel is a MicroSoft product - therefore it needs MS support
    LN
    PS - you might give the Apple Numbers forum a try - more likely that someone there might know Excel details than here in the iPhoto forum
    LN

  • Reg: read excel column and insert into table.

    hi Friends,
          i wanted to read the data from Excel and insert into in my oracle tables.
          can you provide the link or example script.
        how to read the column value from excel and insert into table.
      please help.

    < unnecessary reference to personal blog removed by moderator >
    Here are the steps:
    1) First create a directory and grant read , write , execute to the user from where you want to access the flat files and load it.
    2) Write a generic function to load PIPE delimited flat files:
    CREATE OR REPLACE FUNCTION TABLE_LOAD ( p_table in varchar2,
    p_dir in varchar2 DEFAULT ‘YOUR_DIRECTORY_NAME’,
    P_FILENAME in varchar2,
    p_ignore_headerlines IN INTEGER DEFAULT 1,
    p_delimiter in varchar2 default ‘|’,
    p_optional_enclosed in varchar2 default ‘”‘ )
    return number
    is
    – FUNCTION TABLE_LOAD
    – PURPOSE: Load the flat files i.e. only text files to Oracle
    – tables.
    – This is a generic function which can be used for
    – importing any text flat files to oracle database.
    – PARAMETERS:
    – P_TABLE
    – Pass name of the table for which import has to be done.
    – P_DIR
    – Name of the directory where the file is been placed.
    – Note: The grant has to be given for the user to the directory
    – before executing the function
    – P_FILENAME
    – The name of the flat file(a text file)
    – P_IGNORE_HEADERLINES
    – By default we are passing 1 to skip the first line of the file
    – which are headers on the Flat files.
    – P_DELIMITER
    – Dafault “|” pipe is been passed.
    – P_OPTIONAL_ENCLOSED
    – Optionally enclosed by ‘ ” ‘ are been ignored.
    – AUTHOR:
    – Slobaray
    l_input utl_file.file_type;
    l_theCursor integer default dbms_sql.open_cursor;
    l_lastLine varchar2(4000);
    l_cnames varchar2(4000);
    l_bindvars varchar2(4000);
    l_status integer;
    l_cnt number default 0;
    l_rowCount number default 0;
    l_sep char(1) default NULL;
    L_ERRMSG varchar2(4000);
    V_EOF BOOLEAN := false;
    begin
    l_cnt := 1;
    for TAB_COLUMNS in (
    select column_name, data_type from user_tab_columns where table_name=p_table order by column_id
    ) loop
    l_cnames := l_cnames || tab_columns.column_name || ‘,’;
    l_bindvars := l_bindvars || case when tab_columns.data_type in (‘DATE’, ‘TIMESTAMP(6)’) then ‘to_date(:b’ || l_cnt || ‘,”YYYY-MM-DD HH24:MI:SS”),’ else ‘:b’|| l_cnt || ‘,’ end;
    l_cnt := l_cnt + 1;
    end loop;
    l_cnames := rtrim(l_cnames,’,');
    L_BINDVARS := RTRIM(L_BINDVARS,’,');
    L_INPUT := UTL_FILE.FOPEN( P_DIR, P_FILENAME, ‘r’ );
    IF p_ignore_headerlines > 0
    THEN
    BEGIN
    FOR i IN 1 .. p_ignore_headerlines
    LOOP
    UTL_FILE.get_line(l_input, l_lastLine);
    END LOOP;
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    v_eof := TRUE;
    end;
    END IF;
    if not v_eof then
    dbms_sql.parse( l_theCursor, ‘insert into ‘ || p_table || ‘(‘ || l_cnames || ‘) values (‘ || l_bindvars || ‘)’, dbms_sql.native );
    loop
    begin
    utl_file.get_line( l_input, l_lastLine );
    exception
    when NO_DATA_FOUND then
    exit;
    end;
    if length(l_lastLine) > 0 then
    for i in 1 .. l_cnt-1
    LOOP
    dbms_sql.bind_variable( l_theCursor, ‘:b’||i,
    ltrim(rtrim(rtrim(
    regexp_substr(l_lastLine,’([^|]*)(\||$)’,1,i),p_delimiter),p_optional_enclosed),p_optional_enclosed));
    end loop;
    begin
    l_status := dbms_sql.execute(l_theCursor);
    l_rowCount := l_rowCount + 1;
    exception
    when OTHERS then
    L_ERRMSG := SQLERRM;
    insert into BADLOG ( TABLE_NAME, ERRM, data, ERROR_DATE )
    values ( P_TABLE,l_errmsg, l_lastLine ,systimestamp );
    end;
    end if;
    end loop;
    dbms_sql.close_cursor(l_theCursor);
    utl_file.fclose( l_input );
    commit;
    end if;
    insert into IMPORT_HIST (FILENAME,TABLE_NAME,NUM_OF_REC,IMPORT_DATE)
    values ( P_FILENAME, P_TABLE,l_rowCount,sysdate );
    UTL_FILE.FRENAME(
    P_DIR,
    P_FILENAME,
    P_DIR,
    REPLACE(P_FILENAME,
    ‘.txt’,
    ‘_’ || TO_CHAR(SYSDATE, ‘DD_MON_RRRR_HH24_MI_SS_AM’) || ‘.txt’
    commit;
    RETURN L_ROWCOUNT;
    end TABLE_LOAD;
    Note: when you run the function then it will also modify the source flat file with timestamp , so that we can have the track like which file was loaded .
    3) Check if the user is having UTL_FILE privileges or not :
    SQL> SELECT OWNER,
    OBJECT_TYPE
    FROM ALL_OBJECTS
    WHERE OBJECT_NAME = ‘UTL_FILE’
    AND OWNER =<>;
    If the user is not having the privileges then grant “UTL_FILE” to user from SYS user:
    SQL> GRANT EXECUTE ON UTL_FILE TO <>;
    4) In the function I have used two tables like:
    import_hist table and badlog table to track the history of the load and another to check the bad log if it occurs while doing the load .
    Under the same user create an error log table to log the error out records while doing the import:
    SQL> CREATE TABLE badlog
    errm VARCHAR2(4000),
    data VARCHAR2(4000) ,
    error_date TIMESTAMP
    Under the same user create Load history table to log the details of the file and tables that are imported with a track of records loaded:
    SQL> create table IMPORT_HIST
    FILENAME varchar2(200),
    TABLE_NAME varchar2(200),
    NUM_OF_REC number,
    IMPORT_DATE DATE
    5) Finally run the PLSQL block and check if it is loading properly or not if not then check the badlog:
    Execute the PLSQL block to import the data from the USER:
    SQL> declare
    P_TABLE varchar2(200):=<>;
    P_DIR varchar2(200):=<>;
    P_FILENAME VARCHAR2(200):=<>;
    v_Return NUMBER;
    BEGIN
    v_Return := TABLE_LOAD(
    P_TABLE => P_TABLE,
    P_DIR => P_DIR,
    P_FILENAME => P_FILENAME,
    P_IGNORE_HEADERLINES => P_IGNORE_HEADERLINES,
    P_DELIMITER => P_DELIMITER,
    P_OPTIONAL_ENCLOSED => P_OPTIONAL_ENCLOSED
    DBMS_OUTPUT.PUT_LINE(‘v_Return = ‘ || v_Return);
    end;
    6) Once the PLSQL block is been executed then check for any error log table and also the target table if the records are been successfully imported or not.

  • How to execute an SSIS package on a scheduled basis from remote server and pass in input files

    I have an application server and a db server.  My db server has all things SQL Server stored on it (DBMS, SSRS, SSIS, etc.)  I have several nightly batch process SSIS packages (dtsx files currently) that will pickup an input file and import them
    into the database.  I would like to execute all batch processes from my application server as I have quite a few other ones as well that do other stuff outside of SQL Server via powershell.  My question is how to do this?  Is there away to execute
    them remotely via DTexec.exe, should I set them up as Agent jobs and somehow pass in the file names\location (how?), create and SSIS catalog, etc.?  
    I need to easily be able to see if the packages execute successfully or not and if not capture the detailed information of why they failed from the remote server so I can use that to drive my process flow logic in the batch processes.

    Hi Jason,
    According to your description, you want to execute a package on a schedule and receive notification when package ends with error in the job.
    After testing the issue in my environment, we can directly add the package in a step of a job, then add a schedule and set the Alert and Notification property in the job to achieve your requirement. For more details, please see:
    Create a Database Mail in the SSMS.
    Right-click the SQL Server Agent services to Enable mail profile, then select the appropriate Mail profile.
    Under the Operators folder, create an operator with the correct E-mail name.
    Right-click the Jobs folder to add a new job.
    In the Steps pane, New a step with SQL Server Integration Services Package Type to run the package.
    In the Schedules pane, New a schedule for the job.
    In the Alerts pane, New an alert with SQL Server event alert, then enable Notify operators option with an operator in the Response pane.
    In the Notifications pane, enable Email option with same operator and When the job fails selection.
    Then when the package fails, the job would be failed and we can receive the error message in the mailbox.
    Besides, please make sure the account that execute the job has correct permissions for the file, for the folder that contains the file, and for the database.
    References:
    Configure Database Mail – Send Email From SQL Database
    How to setup SQL Server alerts and email operator notifications
    Thanks,
    Katherine Xiong
    If you have any feedback on our support, please click
    here.
    Katherine Xiong
    TechNet Community Support

  • Urgent! How to insert into and query video from database in forms???

    In forms 6i demos CD, There is a demo form ocxvideo.fmb,
    but it just for video in file system.
    I want to read *.avi file from file system, and insert into
    database, and query from my forms.
    I create table with long raw, with default forms wizard,
    long raw for [image] item in forms.
    I change item type to ActiveX ,and right_click mouse
    ==>[Insert object]==>Oracle Veideo control.
    still can not insert avi data into database and query from my forms.
    Please give me some advice to solve this problem?
    Thank you very much!
    Ming-An
    [email protected]

    In forms 6i demos CD, There is a demo form ocxvideo.fmb,
    but it just for video in file system.
    I want to read *.avi file from file system, and insert into
    database, and query from my forms.
    I create table with long raw, with default forms wizard,
    long raw for [image] item in forms.
    I change item type to ActiveX ,and right_click mouse
    ==>[Insert object]==>Oracle Veideo control.
    still can not insert avi data into database and query from my forms.
    Please give me some advice to solve this problem?
    Thank you very much!
    Ming-An
    [email protected]

  • SSIS file iteration and insert in 2008

    we have a directory , which has around 10 files. I need to iterate the all the files in the directory and insert the file name, file count and other details into one of the table of the database. 
    Once the data/file name is inserted into the parent table , and id will be generated (auto generated value ) which need to be  inserted into the child table.
    please suggest the best possible optimum how can it be done in SSIS 2008.

    Break it into subtasks:
    " iterate the all the files" -- use a ForEach Loop with file iterator. Google/Bing on how to
    "insert the file name, file count and other details" capture the file name value from the iteration to a variable mapped to it, the count can be done via a Script Task with a simple iterator, again Bing;
    "id will be generated" -- id where , how? Not sure, but perhaps just do it via a trigger. I am asking because each records would not one per file unless you did something special
    Arthur My Blog

  • Splitting an input file using Transformation agent

    Hi, I am trying to use transformation agent (adobe output central pro v5.5) to take and input file and split it into many output files based on a text string in the file.
    However instead of splitting the file it, each output file containts all the input records upto the next file boundary. What I need is just the records between the file boundaries.
    Any ideas what I have got wrong, or could this be a feature of the Trans Agent?
    my TDF file is;
    O " N 1500 N N N N O
    F "^$PAGE 1" 1 8 -5
    E data1 * "" 1 0 * 1 60 0 0 ""
    #startscript Head
    ^job invoice_arch.pdf
    #endscript
    #startscript *
    #for data1
    @data1
    #endfor
    #endscript
    thanks in advance
    Stephen

    Hi there,
    If you are still interested in splitting a data file, please drop me a email and I will forward a document that I wrote to achive this.
    Andrew Purdy
    Enterprise Solutions
    [email protected]

  • C++ debugger can't find input file, regardless of location

    I have an input file that's turned into an ifstream object. When I run the program without debugging, it's found fine. I've put a copy of the file in every single folder within the project directory, starting at the folder that contains the solution file.
    The debugger still can't find it. Help me, please; I feel like I'm going insane.

    I have an input file that's turned into an ifstream object. When I run the program without debugging, it's found fine. I've put a copy of the file in every single folder within the project directory, starting at the folder that contains the solution
    file. The debugger still can't find it. Help me, please; I feel like I'm going insane.
    Hello,
    I will help you move this thread to C++ forum to get help to confirm whether this issue is related to
    using of ifstream .
    You could share the code with us to clarify this issue. If possible, you could share a simple sample which could reproduce this issue.
    Regards,
    Carl
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Newline inserted into CDATA section by parser

    I'm parsing an xml file with a CDATA value that contains xml content. After parsing the file, I display the CDATA value within a JTextArea. For some reason, this xml content ends up double-spaced (hex data 0D 0A 0D 0A, instead of just the original 0D 0A at the end of each line). A newlines are being inserted into my CDATA data. I thought the parser wasn't supposed to change this data.
    I'm extending the SAX DefaultHandler and don't implement the LexicalHandler. Am I supposed to implement the LexicalHandler interface when using CDATA?

    The character data within the CDATA section is being altered. Though I will admit that my original data was incorrect (see below).
    Below is an excerpt form my CDATA section:
    <Configuration>
      <BaseDeviceID>
    ...The hex character data that I see between these two tags (after the first ">" and before the second "<") at different stages is shown below.
    In the original XML file on disk, using a hex editor:
    0D 0A 20 20
    Input to the characters(...) method of my SAXEventHandler during parsing:
    0A 0A 20 20
    Copied from the displayed text in the JTextArea to the hex editor after parsing:
    0D 0A 0D 0A 20 20 (this is where my original data came from)
    It appears that the XML processor (parser?) is changing the carriage return (0D) to a linefeed (0A). This shouldn't happen even if section 2.11 of the spec applies.

  • XML Parser to insert values into a Table??

    Hi All,
    Bare with me I am new to xml technology, but apparently there's request to parse a xml file and store data in a oracle table.
    Appreciate if someone can help me to resolve this please??
    I am using Oracle 10g.
    This is the xml file which I need to parse.
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <PBOOKS>
    <BOOK>
    <KEY>0061319821</KEY>
    <ISBN>0-061-31982-1</ISBN>
    <![CDATA[<TTL>All Our Kin</TTL>]]>
    <![CDATA[<SUBTTL>Strategies For Survival In A Black Community</SUBTTL>]]>
    <![CDATA[<PAGES>192</PAGES>]]>
    </BOOK>
    </PBOOKS>
    I have a Oracle Table ( table name: Perseu ) to hold the values of this file:
    These are the fields:
    Key, ISBN, TTL, SUBTTL, Pages

    Due to the somewhat strange structure of the XML (Elements embedded inside the CDATA sections, do you have any idea why this is being done ?) the best I can come up with is
    SQL> drop table test
      2  /
    Table dropped.
    SQL> create table test of XMLType
      2  /
    Table created.
    SQL> insert into test values ( XMLTYPE(
      2  '<PBOOKS>
      3     <BOOK>
      4             <KEY>0061319821</KEY>
      5             <ISBN>0-061-31982-1</ISBN><![CDATA[<TTL>All Our Kin</TTL>]]><![CDATA[<SUBTTL>Strategies For Survival In A Black Community</S
    UBTTL>]]><![CDATA[<PAGES>192</PAGES>]]></BOOK>
      6  </PBOOKS>'))
      7  /
    1 row created.
    SQL> select BOOK, ISBN,
      2         extractValue(CDATA,'/CDATA/TTL') TTL,
      3         extractValue(CDATA,'/CDATA/SUBTTL') SUBTL,
      4         extractValue(CDATA,'/CDATA/PAGES') PAGES
      5    from (
      6           select extractValue(value(BOOK),'/BOOK/KEY') BOOK,
      7                  extractValue(value(BOOK),'/BOOK/ISBN') ISBN,
      8                  xmlType('<CDATA>' || extractValue(value(BOOK),'BOOK/text()') || '</CDATA>') CDATA
      9             from test,
    10                  table(xmlsequence(extract(object_value,'/PBOOKS/BOOK'))) book
    11         )
    12  /
    BOOK
    ISBN
    TTL
    SUBTL
    PAGES
    0061319821
    0-061-31982-1
    All Our Kin
    BOOK
    ISBN
    TTL
    SUBTL
    PAGES
    Strategies For Survival In A Black Community
    192
    SQL>
    SQL>
    SQL>

  • How to pass the chinese input insert into DB

    hi guys,
    i am the new one in developing the multilingual software.
    let me explain :
    the tools used are :
    Jboss 4.0.4 , MySQL, Eclipse.
    user key in the chinese or other languages[like greek] in the jsp page. then will uses <form .......... method="post" action="create_user_confirm.jsp"> to redirect the page to create_user_confirm.jsp . In this page request.getParameter is used to get those input and send them to java code to insert into DB.
    my difficulty now is from input jsp page to create_user_confirm.jsp page, i couldnt send the chinese word (greek or spanish) to the 2nd page by using request.getParameter("").it shows me the funny symbols below are some of code of my jsp pages.
    nput.jsp
    <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
    <%@ page import="java.util.Locale"%>
    <%@ page import="org.apache.commons.codec.binary.Base64"%>
    <%
         Locale.setDefault(Locale.SIMPLIFIED_CHINESE);
         try {
              %>
              <jsp:include page="/top.jsp" />
              <p class="headline"><%=mpmservice.getLang(user.getLang(), "create_user_title")%></p>
              <form name="operatordetails" id="operatordetails" method="post" action="create_user_confirm.jsp">
                   <input type=hidden name=s value="<%=request.getParameter("s")%>">
                   <table class="infotable" id="report">
                        <tr>
                             <td class="left"><%=mpmservice.getLang(user.getLang(), "create_user_label_name")%></td>
                             <td class="middle" colspan="2"><input class="middle" name="name" type="text" id="name" size="35" value="<%=name%>" /></td>
                        </tr>
                        <tr>
                             <td colspan="4" style="height: 23px">
                                  <p style="border-bottom: gray 1px solid;"> </p>
                             </td>
                        </tr>                    
                        <tr>
                             <td class="left"><%=mpmservice.getLang(user.getLang(), "create_user_label_description")%></td>
                             <td class="middle" colspan="2"><input class="middle" name="description" type="text" id="description" size="35" value="<%=description%>" /></td>
                        </tr>
                        <tr>
                             <td colspan="4" style="height: 23px">
                                  <p style="border-bottom: gray 1px solid;"> </p>
                             </td>
                        </tr>                    
                        <tr>
                             <td class="left"><%=mpmservice.getLang(user.getLang(), "create_user_label_phone_number")%></td>
                             <td class="middle" colspan="2"><input class="middle" name="phonenumber" type="text" id="phonenumber" size="35" value="<%=phonenumber %>" /></td>
                        </tr>     
                        <tr>
                             <td colspan="4" style="height: 23px">
                                  <p style="border-bottom: gray 1px solid;"> </p>
                             </td>
                        </tr>                    
                        <tr>
                             <td class="left"><%=mpmservice.getLang(user.getLang(), "create_user_label_password")%></td>
                             <td class="middle" colspan="2"><input class="middle"name="password1" type="password" id="password1" size="35" /></td>
                        </tr>
                        <tr>
                             <td colspan="4" style="height: 23px">
                                  <p style="border-bottom: gray 1px solid;"> </p>
                             </td>
                        </tr>                    
                        <tr>
                             <td class="left"><%=mpmservice.getLang(user.getLang(), "create_user_label_passwordrepeat")%></td>
                             <td class="middle" colspan="2"><input class="middle" name="password2" type="password" id="password2" size="35" /></td>
                        </tr>
                        <tr>
                             <td colspan="4" style="height: 23px">
                                  <p style="border-bottom: gray 1px solid;"> </p>
                             </td>
                        </tr>                    
                        <tr>
                             <td class="left"><%=mpmservice.getLang(user.getLang(), "create_user_label_privilege")%></td>
                             <td class="middle" colspan="2"><select class="middle" name="privilege" id="privilege">
                        <tr>
                             <td class="left"> </td>
                             <td class="halfmiddle">
                                  <input class="halfmiddle" name="Create" type="submit" id="Create" value="<%=mpmservice.getLang(user.getLang(), "create_user")%>" />
                             </td>
                             <td class="halfmiddle">
                                  <input class="halfmiddle" name="Cancel" type="button" id="Cancel" value="<%=mpmservice.getLang(user.getLang(), "cancel")%>" onClick="location='create_user.jsp?s=<%=request.getParameter("s")%>&msg=&name=&description=&phonenumber='" />
                             </td>
                             <td class="right"> </td>
                        </tr>
                   </table>
              </form>
              <jsp:include page="/bottom.jsp" />
         <% } %>
    create_user_confirm.jsp
    <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
    <%@ page import="javax.naming.Context"%>
    <%@ page import="javax.naming.InitialContext"%>
    <%@ page import="java.util.Locale"%>
    <%@ page import="org.apache.commons.codec.binary.Base64"%>
    <%
         Locale.setDefault(Locale.SIMPLIFIED_CHINESE);
         try {
         if (ok) {
             String name = request.getParameter("name");
             String description = request.getParameter("description");
             String phonenumber = request.getParameter("phonenumber");
             String password1 = request.getParameter("password1");
             String password2 = request.getParameter("password2");
             String[] privilege = request.getParameterValues("privilege");
             if (name == null)
                  name = "";
             if (description == null)
                  description = "";
             if (phonenumber == null)
                  phonenumber = "";
             if (password1 == null)
                  password1 = "";
             if (password2 == null)
                  password2 = "";
              LSUser user1 = null;
              %>          
              <jsp:include page="/top.jsp" />
              <p class="headline"><%=mpmservice.getLang(user.getLang(), "create_user_title")%></p>
              <form name="operatordetails" id="operatordetails" method="post" action="create_user_do.jsp">
                   <input type=hidden name=s value="<%=request.getParameter("s")%>">
                   <input type=hidden name=name value="<%=name%>">
                   <input type=hidden name=description value="<%=description%>">
                   <input type=hidden name=password1 value="<%=password1%>">
                   <input type=hidden name=phonenumber value="<%=phonenumber%>">
                   <input type=hidden name=msg value="<%=message%>">
                   <table class="infotable" id="report">
                        <tr>
                             <td class="left"><%=mpmservice.getLang(user.getLang(), "create_user_label_name")%></td>
                             <td class="middle" colspan="2"><%=name%></td>
                             <td class="right"> </td>
                        </tr>
                        <tr>
                             <td colspan="4" style="height: 23px">
                                  <p style="border-bottom: gray 1px solid;"> </p>
                             </td>
                        </tr>
                        <tr>
                             <td class="left"><%=mpmservice.getLang(user.getLang(), "create_user_label_description")%></td>
                             <td class="middle" colspan="2"><%=description%></td>
                             <td class="right"> </td>
                        </tr>
                        <tr>
                             <td colspan="4" style="height: 23px">
                                  <p style="border-bottom: gray 1px solid;"> </p>
                             </td>
                        </tr>
                        <% if(!phonenumber.equals("")) { %>
                             <tr>
                                  <td class="left"><%=mpmservice.getLang(user.getLang(), "create_user_label_phone_number")%></td>
                                  <td class="middle" colspan="2"><%=request.getParameter("phonenumber")%></td>
                                  <td class="right"> </td>
                             </tr>
                             <tr>
                                  <td colspan="4" style="height: 23px">
                                       <p style="border-bottom: gray 1px solid;"> </p>
                                  </td>
                             </tr>
                        <% } %>
                        <tr>
                             <td colspan="4" style="height: 23px">
                                  <p style="border-bottom: gray 1px solid;"> </p>
                             </td>
                        </tr>
                        <tr>
                             <td class="left"> </td>
                             <td class="halfmiddle">
                                  <input class="halfmiddle" name="Create" type="submit" id="Create" value="<%=mpmservice.getLang(user.getLang(), "create_user")%>" />
                             </td>
                             <td class="halfmiddle">
                                  <input class="halfmiddle" name="Cancel" type="button" id="Cancel" value="<%=mpmservice.getLang(user.getLang(), "cancel")%>" onClick="location='create_user.jsp?s=<%=request.getParameter("s")%>&msg=<%=message%>&name=<%=name%>&description=<%=description%>&phonenumber=<%=request.getParameter("phonenumber")%><%=privStr%>'" />
                             </td>
                             <td class="right"> </td>
                        </tr>
                   </table>
              </form>
              <jsp:include page="/bottom.jsp" />
         <% } %>
         i really appreciate whoever reply this post. thanks a lot.

    hi skalster,
    thanks for your reply. currently i use Jboss to make the connection and the configuration to mySQL. the code as such :
    <datasources>
      <local-tx-datasource>
        <jndi-name>RTA_DS</jndi-name>
        <connection-url>jdbc:mysql://localhost:3306/jbossdb</connection-url>
        <driver-class>com.mysql.jdbc.Driver</driver-class>
        <user-name>root</user-name>
        <password></password>   
        <min-pool-size>5</min-pool-size>
        <max-pool-size>20</max-pool-size>   
          <metadata>
             <type-mapping>mySQL</type-mapping>
          </metadata>
        </local-tx-datasource>
    </datasources>so whatever there is a insertion or retrieval, the system will call entity bean and there is no DB configuration on my code side. all done by Jboss. but now i am more concern on chinese word or other languages which are able to pass the chinese parameter within jsp pages. now i am facing the problem which user key in the chinese or other language's input,it is fail to pass to another jsp (create_user_confirm.jsp) to do the validation. it appears as those funny character from input.jsp to create_user_confirm.jsp by using request.getparameter(). any idea to solve this matter?the source code of the 2 jsp files are at the previous message. i really thanks for your reply.
    have a nice day

  • Read text file and insert into MySQL

    Dears,
    I need to read text file and then insert the data in the correct column in the MySQL database
    example
    I have the following text file:
    field1=1234 field2=56789 field3=444555
    field1=1333 field2=2222 field3=333555
    and so on and so forth ,,note that all rows are identical and just the filed value is changed(there is a dilemeter between fields)
    how can I read field1,field2 and field3 from text file and insert them in the correct table and column in the database.....
    any help?????
    thanks for your cooperation
    Best Regars

    Sure.
    Which part don't you understand?
    1. Reading a text file
    2. Parsing the text file contents.
    3. Relational databases and SQL.
    4. How to create a database.
    5. How to connect to a database in Java.
    6. How to insert records into the database in Java.
    7. How to map Java objects to records in a database.
    This is a pretty nice list. Solve complex problems by breaking them into smaller ones.
    %

  • Hi, extract data from xml file and insert into another exiting xml file

    i am searching code to extract data from xml file and insert into another exiting xml file by a java program. I understood it is easy to extract data from a xml file, and how ever without creating another xml file. We want to insert the extracted data into another exiting xml file. Suggestions?
    1st xml file which has two lines(text1.xml)
    <?xml version="1.0" encoding="iso-8859-1"?>
    <xs:PrintDataRequest xmlns:xs="http://com.unisys.com/Anid"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://com.unisys.com/Anid file:ANIDWS.xsd">
    <xs:Person>
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://com.unisys.com/Anid file:ANIDWS.xsd">
    These two lines has to be inserted in the existing another xml(text 2.xml) file(at line 3 and 4)
    Regards,
    bubbly

    Jadz_Core wrote:
    RandomAccessFile? If you know where you want to insert it.Are you sure about this? If using this, the receiving file would have to have bytes inserted that exactly match the number of bytes replaced. I'm thinking that you'll likely have to stream through the second XML with a SAX parser and copy information (or insert new information) as you stream with an XML writer of some sort.

  • Reading special characters from a flat file and inserting into DB

    I'm reading data with special characters like . etc from a flat file , assigning the data to variable in my anonymous block and inserting into my DB. But the show up as inverted ? s. Any clues about how to do this?
    If i try to do the insert directly it works. It seems like the error occurs when reading this data into a variable
    thanks for the help
    Lalit Bhatia

    lalit, this is probably an character set problem, the default on Database creation tends to be 7bit Ascii which does not support special characters, it's been a while since I set up a db in this way, but you need to change settings in oracle.ini. The db will need to be restarted for this. Also, to check current settings try:
    select * from NLS_DATABASE_PARAMETERS
    You want an 8bit, unicode or multibyte character set. Sorry I cannot remember moer off the top of my head, try searching on NLS or character set

  • Is there a way to create a .dmg file for a DVD inserted into the system

    I am wondering if Snow Leopard has integrated any tools that can create a .dmg file for the CD or DVD inserted into the system?
    If not, any recommendations for freeware 3rd party tools? Thanks

    Insert the disc you want to create the .dmg from, then choose the disc in the left hand pane of Disk Utility. From the File menu, choose New > Disk Image from (name of disc).
    EDIT: This is basically how it's done; however, there may be other steps involved, depending on the type of disc you're trying to copy and what your goals are with the .dmg. If you provide more details about what you're trying to achieve, maybe we can help you further.
    Message was edited by: Tuttle

Maybe you are looking for