How to insert a JPG file into a Table from a Form?

I create a Schema and a Table as follows:
SQL> create user myphoto identified by myphoto;
User created.
SQL> grant connect,resource to myphoto;
Grant succeeded.
SQL> create table myphoto.photo_table
2 (photo_id varchar2(10) primary key,
3 photo_content blob);
Table created.
I would like to build an Oracle Form with a Text Item to enter the full path and filename to be uploaded and inserted into the photo_table; and a Push Button to insert the jpg file into the photo_table.
Can any one give me details on how this could be done?

Hi,
have a look at webutil on otn.oracle.com/products/forms ---> Webutil
Webutil has the capability to load files into the database.
Frank

Similar Messages

  • How to insert a gif file into a table?

    Hi,
    I need to insert a gif file into a table. Can anyone tell me where I can find the information on how to create this kind of table, how to insert a gif file into a table and how to select?
    Thanks,
    Helen

    Hi Helen,
    You could read about that in the documentation which is available online.
    For a starter: BLOB. And I bet there are many examples to be found on the web.
    Good luck. :)
    Regards,
    Guido

  • How to insert a image file into oracle database

    hi all
    can anyone guide me how to insert a image file into oracle database now
    i have created table using
    create table imagestore(image blob);
    but when inserting i totally lost don't know what to do how to write query to insert image file

    Hi I don't have time to explain really, I did have to do this a while ago though so I will post a code snippet. This is using the commons file upload framework.
    Firstly you need a multi part form data (if you are using a web page). If you are not using a web page ignore this bit.
    out.println("<form name=\"imgFrm\" method=\"post\" enctype=\"multipart/form-data\" action=\"FileUploadServlet?thisPageAction=reloaded\" onSubmit=\"return submitForm();\"><input type=\"FILE\" name=\"imgSource\" size='60' class='smalltext' onKeyPress='return stopUserInput();' onKeyUp='stopUserInput();' onKeyDown='stopUserInput();' onMouseDown='noMouseDown(event);'>");
    out.println("   <input type='submit' name='submit' value='Submit' class='smalltext'>");
    out.println("</form>"); Import this once you have the jar file:
    import org.apache.commons.fileupload.*;Now a method I wrote to upload the file. I am not saying that this is correct, or its the best way to do this. I am just saying it works for me.
    private boolean uploadFile(HttpServletRequest request, HttpSession session) throws Exception {
            boolean result = true;
            String fileName = null;
            byte fileData[] = null;
            String fileUploadError = null;
            String imageType = "";
            String error = "";
            DiskFileUpload fb = new DiskFileUpload();
            List fileItems = fb.parseRequest(request);
            Iterator it = fileItems.iterator();
            while(it.hasNext()){
                FileItem fileItem = (FileItem)it.next();
                if (!fileItem.isFormField()) {
                    fileName = fileItem.getName();
                    fileData = fileItem.get();
                    // Get the imageType from the filename extension
                    if (fileName != null) {
                        int dotPos = fileName.indexOf('.');
                        if (dotPos >= 0 && dotPos != fileName.length()-1) {
                            imageType = fileName.substring(dotPos+1).toLowerCase();
                            if (imageType.equals("jpg")) {
                                imageType = "jpeg";
            String filePath = request.getParameter("FILE_PATH");
            session.setAttribute("filePath", filePath);
            session.setAttribute("fileData", fileData);
            session.setAttribute("fileName", fileName);
            session.setAttribute("imageType", imageType);
            return result;  
         } And now finally the method to actually write the file to the database:
    private int writeImageFile(byte[] fileData, String fileName, String imageType, String mode, Integer signatureIDIn, HttpServletRequest request) throws Exception {
            //If the previous code found a file that can be uploaded then
            //save it into the database via a pstmt
            String sql = "";
            UtilDBquery udbq = getUser(request).connectToDatabase();
            Connection con = null;
            int signatureID = 0;
            PreparedStatement pstmt = null;
            try {
                udbq.setUsePreparedStatements(true);
                con = udbq.getPooledConnection();
                con.setAutoCommit(false);
                if((!mode.equals("U")) || (mode.equals("U") && signatureIDIn == 0)) {
                    sql = "SELECT SEQ_SIGNATURE_ID.nextval FROM DUAL";
                    pstmt = con.prepareStatement(sql);
                    ResultSet rs = pstmt.executeQuery();
                    while(rs.next()) {
                       signatureID = rs.getInt(1);
                    if (fileName != null && imageType != null) {
                        sql = "INSERT INTO T_SIGNATURE (SIGNATURE_ID, SIGNATURE) values (?,?)";
                        InputStream is2 = new ByteArrayInputStream(fileData);
                        pstmt = con.prepareStatement(sql);
                        pstmt.setInt(1, signatureID);
                        pstmt.setBinaryStream(2, is2, (int)(fileData.length));
                        pstmt.executeUpdate();
                        pstmt.close();
                        con.commit();
                        con = null;
                if(mode.equals("U") && signatureIDIn != 0) {
                    signatureID = signatureIDIn.intValue();
                    if (fileName != null && imageType != null) {
                        sql = "UPDATE T_SIGNATURE SET SIGNATURE = ? WHERE SIGNATURE_ID = ?";
                        InputStream is2 = new ByteArrayInputStream(fileData);
                        pstmt = con.prepareStatement(sql);
                        pstmt.setBinaryStream(1, is2, (int)(fileData.length));
                        pstmt.setInt(2, signatureID);
                        pstmt.executeUpdate();
                        pstmt.close();
                        con.commit();
                        con = null;
            } catch (Exception e) {
                con = null;
                throw new Exception(e.toString());
            return signatureID;
       }

  • How to insert a JPG file from file system to Oracle 10g?

    I have developed a schema to store photos as BLOB which store the text description as CLOB original filename, file size.
    I also use ctxsys.context to index TEXT_DESCRIPTION in order to perform Oracle Text Search and it works.
    I would like to insert some JPG file from say C:\MYPHOTO\Photo1.jpg as a new record. How can I do this in SQL PLus and/or Loader?
    How can I retrieve the PHOTO_IMAGE back to the file system using SQL Plus and/or command line in DOS?
    See the following script:
    create user myphoto identified by myphoto;
    grant connect, resource, ctxapp to myphoto;
    connect myphoto/myphoto@orcl;
    PROMPT Creating Table PHOTOS
    CREATE TABLE PHOTOS
    (PHOTO_ID VARCHAR2(15) NOT NULL,
    PHOTO_IMAGE BLOB,
    TEXT_DESCRIPTION CLOB,
    FILENAME VARCHAR2(50),
    FILE_SIZE NUMBER NOT NULL,
    CONSTRAINT PK_PHOTOS PRIMARY KEY (PHOTO_ID)
    create index idx_photos_text_desc on
    PHOTOS(TEXT_DESCRIPTION) indextype is ctxsys.context;
    INSERT INTO PHOTOS VALUES
    ('P00000000000001', empty_blob(), empty_clob(),
    'SCGP1.JPG',100);
    INSERT INTO PHOTOS VALUES
    ('P00000000000002', empty_blob(), 'Cold Play with me at the concert in Melbourne 2005',
    'COLDPLAY1.JPG',200);
    INSERT INTO PHOTOS VALUES
    ('P00000000000003', empty_blob(), 'My parents in Melbourne 2001',
    'COLDPLAY1.JPG',200);
    EXEC CTX_DDL.SYNC_INDEX('idx_photos_text_desc');
    SELECT PHOTO_ID ,TEXT_DESCRIPTION
    FROM PHOTOS;
    SELECT score(1),PHOTO_ID ,TEXT_DESCRIPTION
    FROM PHOTOS
    WHERE CONTAINS(TEXT_DESCRIPTION,'parents',1)> 0
    ORDER BY score(1) DESC;
    SELECT score(1),PHOTO_ID ,TEXT_DESCRIPTION
    FROM PHOTOS
    WHERE CONTAINS(TEXT_DESCRIPTION,'cold play',1)> 0
    ORDER BY score(1) DESC;
    SELECT score(1),score(2), PHOTO_ID ,TEXT_DESCRIPTION
    FROM photos
    WHERE CONTAINS(TEXT_DESCRIPTION,'Melbourne',1)> 0
    AND CONTAINS(TEXT_DESCRIPTION,'2005',2)> 0
    ORDER BY score(1) DESC;

    Hi
    You can use the following to insert an image:
    create table imagetab(id number primary key,imagfile blob, fcol varchar2(10));
    create or replace directory imagefiles as 'c:\'
    declare
        v_bfile BFILE;
        v_blob  BLOB;
      begin
        insert into imagetab (id,imagfile,fcol)
        values (3,empty_blob(),'BINARY')
        return imagfile into v_blob;
        v_bfile := BFILENAME ('IMAGEFILES', 'MyImage.JPG');
        Dbms_Lob.fileopen (v_bfile, Dbms_Lob.File_Readonly);
        Dbms_Lob.Loadfromfile (v_blob, v_bfile, Dbms_Lob.Getlength(v_bfile));
        Dbms_Lob.Fileclose(v_bfile);
        commit;
      end;
    /

  • How can insert a MSWORD file into jdevloper form?

    Dear forums
    i am a user of jdevloper
    and working on client\swing.
    i want to insert a microsoft file into my form
    but i have no idea abt it.
    so plz help me....
    thanks

    You might want to read a little bit about Jakarta's POI and see if it can help you.
    http://jakarta.apache.org/poi/

  • How to load a XML file into a table

    Hi,
    I've been working on Oracle for many years but for the first time I was asked to load a XML file into a table.
    As an example, I've found this on the web, but it doesn't work
    Can someone tell me why? I hoped this example could help me.
    the file acct.xml is this:
    <?xml version="1.0"?>
    <ACCOUNT_HEADER_ACK>
    <HEADER>
    <STATUS_CODE>100</STATUS_CODE>
    <STATUS_REMARKS>check</STATUS_REMARKS>
    </HEADER>
    <DETAILS>
    <DETAIL>
    <SEGMENT_NUMBER>2</SEGMENT_NUMBER>
    <REMARKS>rp polytechnic</REMARKS>
    </DETAIL>
    <DETAIL>
    <SEGMENT_NUMBER>3</SEGMENT_NUMBER>
    <REMARKS>rp polytechnic administration</REMARKS>
    </DETAIL>
    <DETAIL>
    <SEGMENT_NUMBER>4</SEGMENT_NUMBER>
    <REMARKS>rp polytechnic finance</REMARKS>
    </DETAIL>
    <DETAIL>
    <SEGMENT_NUMBER>5</SEGMENT_NUMBER>
    <REMARKS>rp polytechnic logistics</REMARKS>
    </DETAIL>
    </DETAILS>
    <HEADER>
    <STATUS_CODE>500</STATUS_CODE>
    <STATUS_REMARKS>process exception</STATUS_REMARKS>
    </HEADER>
    <DETAILS>
    <DETAIL>
    <SEGMENT_NUMBER>20</SEGMENT_NUMBER>
    <REMARKS> base polytechnic</REMARKS>
    </DETAIL>
    <DETAIL>
    <SEGMENT_NUMBER>30</SEGMENT_NUMBER>
    </DETAIL>
    <DETAIL>
    <SEGMENT_NUMBER>40</SEGMENT_NUMBER>
    <REMARKS> base polytechnic finance</REMARKS>
    </DETAIL>
    <DETAIL>
    <SEGMENT_NUMBER>50</SEGMENT_NUMBER>
    <REMARKS> base polytechnic logistics</REMARKS>
    </DETAIL>
    </DETAILS>
    </ACCOUNT_HEADER_ACK>
    For the two tags HEADER and DETAILS I have the table:
    create table xxrp_acct_details(
    status_code number,
    status_remarks varchar2(100),
    segment_number number,
    remarks varchar2(100)
    before I've created a
    create directory test_dir as 'c:\esterno'; -- where I have my acct.xml
    and after, can you give me a script for loading data by using XMLTABLE?
    I've tried this but it doesn't work:
    DECLARE
    acct_doc xmltype := xmltype( bfilename('TEST_DIR','acct.xml'), nls_charset_id('AL32UTF8') );
    BEGIN
    insert into xxrp_acct_details (status_code, status_remarks, segment_number, remarks)
    select x1.status_code,
            x1.status_remarks,
            x2.segment_number,
            x2.remarks
    from xmltable(
      '/ACCOUNT_HEADER_ACK/HEADER'
      passing acct_doc
      columns header_no      for ordinality,
              status_code    number        path 'STATUS_CODE',
              status_remarks varchar2(100) path 'STATUS_REMARKS'
    ) x1,
    xmltable(
      '$d/ACCOUNT_HEADER_ACK/DETAILS[$hn]/DETAIL'
      passing acct_doc as "d",
              x1.header_no as "hn"
      columns segment_number number        path 'SEGMENT_NUMBER',
              remarks        varchar2(100) path 'REMARKS'
    ) x2
    END;
    This should allow me to get something like this:
    select * from xxrp_acct_details;
    Statuscode status remarks segement remarks
    100 check 2 rp polytechnic
    100 check 3 rp polytechnic administration
    100 check 4 rp polytechnic finance
    100 check 5 rp polytechnic logistics
    500 process exception 20 base polytechnic
    500 process exception 30
    500 process exception 40 base polytechnic finance
    500 process exception 50 base polytechnic logistics
    but I get:
    Error report:
    ORA-06550: line 19, column 11:
    PL/SQL: ORA-00932: inconsistent datatypes: expected - got NUMBER
    ORA-06550: line 4, column 2:
    PL/SQL: SQL Statement ignored
    06550. 00000 -  "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    and if I try to change the script without using the column HEADER_NO to keep track of the header rank inside the document:
    DECLARE
    acct_doc xmltype := xmltype( bfilename('TEST_DIR','acct.xml'), nls_charset_id('AL32UTF8') );
    BEGIN
    insert into xxrp_acct_details (status_code, status_remarks, segment_number, remarks)
    select x1.status_code,
            x1.status_remarks,
            x2.segment_number,
            x2.remarks
    from xmltable(
      '/ACCOUNT_HEADER_ACK/HEADER'
      passing acct_doc
      columns status_code    number        path 'STATUS_CODE',
              status_remarks varchar2(100) path 'STATUS_REMARKS'
    ) x1,
    xmltable(
      '/ACCOUNT_HEADER_ACK/DETAILS'
      passing acct_doc
      columns segment_number number        path 'SEGMENT_NUMBER',
              remarks        varchar2(100) path 'REMARKS'
    ) x2
    END;
    I get this message:
    Error report:
    ORA-19114: error during parsing the XQuery expression: 
    ORA-06550: line 1, column 13:
    PLS-00201: identifier 'SYS.DBMS_XQUERYINT' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    ORA-06512: at line 4
    19114. 00000 -  "error during parsing the XQuery expression: %s"
    *Cause:    An error occurred during the parsing of the XQuery expression.
    *Action:   Check the detailed error message for the possible causes.
    My oracle version is 10gR2 Express Edition
    I do need a script for loading xml files into a table as soon as possible, Give me please a simple example for understanding and that works on 10gR2 Express Edition
    Thanks in advance!

    The reason your first SQL statement
    select x1.status_code,
            x1.status_remarks,
            x2.segment_number,
            x2.remarks
    from xmltable(
      '/ACCOUNT_HEADER_ACK/HEADER'
      passing acct_doc
      columns header_no      for ordinality,
              status_code    number        path 'STATUS_CODE',
              status_remarks varchar2(100) path 'STATUS_REMARKS'
    ) x1,
    xmltable(
      '$d/ACCOUNT_HEADER_ACK/DETAILS[$hn]/DETAIL'
      passing acct_doc as "d",
              x1.header_no as "hn"
      columns segment_number number        path 'SEGMENT_NUMBER',
              remarks        varchar2(100) path 'REMARKS'
    ) x2
    returns the error you noticed
    PL/SQL: ORA-00932: inconsistent datatypes: expected - got NUMBER
    is because Oracle is expecting XML to be passed in.  At the moment I forget if it requires a certain format or not, but it is simply expecting the value to be wrapped in simple XML.
    Your query actually runs as is on 11.1 as Oracle changed how that functionality worked when 11.1 was released.  Your query runs slowly, but it does run.
    As you are dealing with groups, is there any way the input XML can be modified to be like
    <ACCOUNT_HEADER_ACK>
    <ACCOUNT_GROUP>
    <HEADER>....</HEADER>
    <DETAILS>....</DETAILS>
    </ACCOUNT_GROUP>
      <ACCOUNT_GROUP>
      <HEADER>....</HEADER>
      <DETAILS>....</DETAILS>
      </ACCOUNT_GROUP>
    </ACCOUNT_HEADER_ACK>
    so that it is easier to associate a HEADER/DETAILS combination?  If so, it would make parsing the XML much easier.
    Assuming the answer is no, here is one hack to accomplish your goal
    select x1.status_code,
            x1.status_remarks,
            x3.segment_number,
            x3.remarks
    from xmltable(
      '/ACCOUNT_HEADER_ACK/HEADER'
      passing acct_doc
      columns header_no      for ordinality,
              status_code    number        path 'STATUS_CODE',
              status_remarks varchar2(100) path 'STATUS_REMARKS'
    ) x1,
    xmltable(
      '$d/ACCOUNT_HEADER_ACK/DETAILS'
      passing acct_doc as "d",
      columns detail_no      for ordinality,
              detail_xml     xmltype       path 'DETAIL'
    ) x2,
    xmltable(
      'DETAIL'
      passing x2.detail_xml
      columns segment_number number        path 'SEGMENT_NUMBER',
              remarks        varchar2(100) path 'REMARKS') x3
    WHERE x1.header_no = x2.detail_no;
    This follows the approach you started with.  Table x1 creates a row for each HEADER node and table x2 creates a row for each DETAILS node.  It assumes there is always a one and only one association between the two.  I use table x3, which is joined to x2, to parse the many DETAIL nodes.  The WHERE clause then joins each header row to the corresponding details row and produces the eight rows you are seeking.
    There is another approach that I know of, and that would be using XQuery within the XMLTable.  It should require using only one XMLTable but I would have to spend some time coming up with that solution and I can't recall whether restrictions exist in 10gR2 Express Edition compared to what can run in 10.2 Enterprise Edition for XQuery.

  • How to load a XML file into a table using PL/SQL

    Hi Guru,
    I have a requirement, that i have to create a procedure or a package in PL/SQL to load  XML file into a table.
    How we can achive this.

    ODI_NewUser wrote:
    Hi Guru,
    I have a requirement, that i have to create a procedure or a package in PL/SQL to load  XML file into a table.
    How we can achive this.
    Not a perfectly framed question. How do you want to load the XML file? Hoping you want to parse the xml file and load it into a table you can do this.
    This is the xml file
    karthick% cat emp_details.xml
    <?xml version="1.0"?>
    <ROWSET>
    <ROW>
      <EMPNO>7782</EMPNO>
      <ENAME>CLARK</ENAME>
      <JOB>MANAGER</JOB>
      <MGR>7839</MGR>
      <HIREDATE>09-JUN-1981</HIREDATE>
      <SAL>2450</SAL>
      <COM>0</COM>
      <DEPTNO>10</DEPTNO>
    </ROW>
    <ROW>
      <EMPNO>7839</EMPNO>
      <ENAME>KING</ENAME>
      <JOB>PRESIDENT</JOB>
      <HIREDATE>17-NOV-1981</HIREDATE>
      <SAL>5000</SAL>
      <COM>0</COM>
      <DEPTNO>10</DEPTNO>
    </ROW>
    </ROWSET>
    You can write a query like this.
    SQL> select *
      2    from xmltable
      3         (
      4            '/ROWSET/ROW'  passing xmltype
      5            (
      6                 bfilename('SDAARBORDIRLOG', 'emp_details.xml')
      7               , nls_charset_id('AL32UTF8')
      8            )
      9            columns empno    number      path 'EMPNO'
    10                  , ename    varchar2(6) path 'ENAME'
    11                  , job      varchar2(9) path 'JOB'
    12                  , mgr      number      path 'MGR'
    13                  , hiredate varchar2(20)path 'HIREDATE'
    14                  , sal      number      path 'SAL'
    15                  , com      number      path 'COM'
    16                  , deptno   number      path 'DEPTNO'
    17         );
         EMPNO ENAME  JOB              MGR HIREDATE                    SAL        COM     DEPTNO
          7782 CLARK  MANAGER         7839 09-JUN-1981                2450          0         10
          7839 KING   PRESIDENT            17-NOV-1981                5000          0         10
    SQL>

  • How to show the pdf file into the UIWebView from iphone documents directory?

    Hi ,
         I am working on web services right now I am getting string into base64 format. After decoding that string into NSData i am saving that data as a pdf into Document directory of iphone. Now the problem is that when I want to show the pdf into UIwebView then it is showing blank page. But when I am checking into /Users/pareshkarnawat/Library/Application Support/iPhone Simulator/4.3.2/Applications/ the pdf file is correctly generated and working fine when I ope it.
       How to show that pdf file into UIwebview ? or is there any alernative for this.
    Any ideas on how I can go about this? I have looked at a few posts and still can't seem to figure it out.
    Any idea's appreciated, thanks

    The result is a UIWebView that displays a blank page. No errors occur in the UIWebView delegate method. The thing is that data has the correct length, in bytes, for the PDF I am trying to display, and I also get the pdf file in Library/Application Support/iPhone Simulator/4.3.2/Applications/ Does anyone have an idea as to what might be going wrong here or how I can better debug this problem?

  • How do I upload XML files into sap table?

    Dear all,
    I found some methods that upload xml into SAP,
    but there doesn’t work under 4.6c.
    Can someone tell me how to upload XML files into
    sap under 4.6c?
    THX!

    hi,
    You can convert XML to abap using transformations. Simple transformations is a proprietary SAP programming language that describes the transformation of ABAP data to XML (serialization) and from XML to ABAP data (deserialization).
    goto SE80->workbench->edit object(or other objects)->in object selection chose more tab and then choose the transformation radio button and write a name and click create new.
    Here you enter your transformation like
    <xsl:transform version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:sap="http://www.sap.com/sapxsl"
    >
    <xsl:strip-space elements="*"/>
    <xsl:template match="/">
      <xsl:copy-of select="."/>
    </xsl:template>
    </xsl:transform>
    You can use this transfomation in your program using call transformation. You can find more info on call transformation in help.
    Hope this helps.
    Regards,
    Richa

  • How can I import eex files into Applications EUL from the unix command line

    How can I import *.eex and *.dis files into an Applications EUL from the unix command line?
    Thanks

    Hi
    The simple answer is you either have to use the client tool DIS51ADM to import files using the command line (Discoverer Admin is a windows only client tool), or the Java command line which needs a browser.
    In theory if you have a browser running on your Unix box you may be able to use the Java command line to make this work.
    Best wishes
    Michael

  • How to upload an rtf file into a table? (without using UNIX box)

    Hi All,
    Our requirement is to upload a rtf file into table in database.
    Later that rtf is used to generate a report.
    Is it possible to upload the file directly into a table by using SQL developer?
    our requirement is to upload the files without placing them in a particular path in unix box.
    Thanks in advance
    Regards
    Sudeep

    If you are in EBS
    When you upload Template in Application
    I guess It'll get stored in apps.XDO_LOBS table, in FILE_DATA Column
    select * from apps.XDO_LOBS
    where lob_code=<'con. program short name'>
    and file_name= <'your.rtf'>
    Thanx
    Rahul

  • How can I open psd files into Potoshop CC from bridge

    PSD files will not open into Photoshop CC from Bridge CC. I get this error message...“Windows cannot find, C:\program files\adobe\adobe photoshop CS5 (64 Bit)\photoshop.exe.” I can open jpeg, tiff and raw.   I'm using Windows 7. I do not have CS5 on my computer. Help...

    You must have uninstalled CS5 after you installed CC.  Your registry is fouled up.  You can either uninstall CC, run the Script Cleaner and reinstall, or fix registry as below.
    After looking at a new user's registry HKEY_CURRENT_USER and comparing it to the one on the original user, I found a registry value which was not changed, and should have been.
    I found a key:
    HKEY_CURRENT_USER\Software\Classes\Applications\Photoshop.exe\shell\op en\command
    This key was set to the path for Photoshop CS6 when it should have been set to Photoshop CC.
    In other words, in my case, it was set to:
    "C:\Program Files\Adobe\Adobe Photoshop CS6 (64 Bit)\Photoshop.exe" "%1"
    When I changed the CS6 to a CC, in other words, so the whole key reads:
    "C:\Program Files\Adobe\Adobe Photoshop CC (64 Bit)\Photoshop.exe" "%1"

  • How to read the CSV Files into Database Table

    Hi
    Friends i have a Table called tblstudent this has the following fields Student ID, StudentName ,Class,Father_Name, Mother_Name.
    Now i have a CSV File with 1500 records with all These Fields. Now in my Program there is a need for me to read all these Records into this Table tblstudent.
    Note: I have got already 2000 records in the Table tblstudent now i would like to read all these CSV File records into the Table tblstudent.
    Please give me some examples to do this
    Thank your for your service
    Cheers
    Jofin

    1) Read the CSV file line by line using BufferedReader.
    2) Convert each line (record) to a List and add it to a parent List. If you know the columns before, you might use a List of DTO's.
    3) Finally save the two-dimensional List or the List of DTO's into the datatable using plain JDBC or any kind of ORM (Hibernate and so on).
    This article contains some useful code snippets to parse a CSV: http://balusc.xs4all.nl/srv/dev-jep-csv.html

  • How to insert a wma file into?

    I mean a wma into the iphone.
    Paul Weinstock
    http://theworld3rd.com/forum/

    Here is an article from the apple support website that might help out.
    http://support.apple.com/kb/HT1844

  • How to load a txt file into a table

    Hi,
    I have a txt file
    3 sample records:
    25     fff     fff     2012-03-08 13:42:31.0     2012-03-15 14:58:31.0
    26     ooo     ooo     null     null
    27     ooo     ooo     2012-03-22 10:39:49.0     null
    I have problems with the nulls:
    my ctl is like that:
    load data
    append
    into table table_name
    fields terminated by '\t'
    OPTIONALLY ENCLOSED BY '"' AND '"'
    trailing nullcols
    ( ID CHAR(4000),
    LITERAL CHAR(4000),
    DESCRIPTION_WEB CHAR(4000),
    FECHAALTA TIMESTAMP "YYYY-MM-DD HH24:MI:SS.FF1",
    FECHAMODIFICACION TIMESTAMP "YYYY-MM-DD HH24:MI:SS.FF1"
    I get the following error because of the null:
    Record 2: Rejected - Error on table MKT_WEB, column FECHAALTA.
    ORA-26041: DATETIME/INTERVAL datatype conversion error
    The table in the database:
    ID     NUMBER(10,0)
    LITERAL     VARCHAR2(40 CHAR)
    DESCRIPTION     VARCHAR2(255 CHAR)
    FECHAALTA     TIMESTAMP(0)
    FECHAMODIFICACION     TIMESTAMP(0)
    How can I say to the CTL about the nulls?
    Thanks in advance

    Try external table

Maybe you are looking for

  • Installing ML: locked partition missing after I erased it!

    I was into a clean install idea on macpro I made bootable 10.8 usb, then restart to cmd+r mode. I decided to erase my 1st partition before install ML. so I opened disk utility and tried to erase 1st partition. this partition was password protected, s

  • External drive icon not showing in finder

    Still trying to get an answer to this one. When I plug in a usb or other external drive to my Powerbook (recently upgraded to Leopard), nothing shows in the flinder window (a 'no name' icon usually appears under the 'hard drive' icon). When i remove

  • PO not synchronized from backend

    Hi experts, when a shopping cart is transfered to the backend system a purchase requisition is created, then a purchase order is created manually with reference to the purchase requisition. But the purchase order is not shown in the shopping cart fol

  • I am getting duplicate reminders in my IPhone when it syncs from my computer.

    I am havng problems with duplicate events on my IPhone calendarwhen it pulls over from my desktop calendar.

  • MDL1427 error when exporting

    Hi all, When exporting a project using the option Design -> Export -> Warehouse builder metada, I get many of these errors: Warning: MDL1427: Cannot export selected FUNCTION <RO_PRJ.RO_PRJ.PK_PRJ_RECON.PR_RECON_ICAP2PPFE_CORRECTDATA> because it does