How to save a .csv file to database server

Hi every body,
I need to upload a .csv file from the client machine and save it to a directory in a database sever.
I could do the uploading part. Can anyone tell me how to save the file?
Another option is save the file as a CLOB in a database column. But I'm not aware of doing that too.
Please guide me.
Thanks in advance.
Surangi.

See Steve Muench's Not Yet Documented Example #85 at http://radio.weblogs.com/0118231/stories/2004/09/23/notYetDocumentedAdfSampleApplications.html#85. While this is for 10.1.3, this is still relevant for 11g. Steve's example is for uploading to a BLOB - same thing for a CLOB. Once your data is in the database, you can use the DBMS_LOB package to write the file to a directory on the database server, if you like.
Also the Developers Guide is your friend - Chapter 9.9 in the Fusion Web User Interface Developers Guide for Oracle ADF 11g, or 19.6 in the ADF Developers Guide for Forms/4GL Developers for JDeveloper 10.1.3.

Similar Messages

  • How to Save a text file in the server?

    hello
    i just want to save an text file in the server.
    My idea is to load an xml text file maybe make some changes
    and then save it back to the server, so i can avoid all the
    database/php work because i know nothing about it.
    thank you

    hello
    i just want to save an text file in the server.
    My idea is to load an xml text file maybe make some changes
    and then save it back to the server, so i can avoid all the
    database/php work because i know nothing about it.
    thank you

  • How to save a csv file in a local directory

    I am trying to save a regular csv file in a local directory. Any suggestions of how I should approach it. And also I was wondering how I would email that csv file to multiple users

    Use a PrintWriter and a FileOutputStream. Look in javax.mail.* for API's to do mailing, or open a socket connection to a pop server and post it.
    Posting these kind of questions to "new to java" might be more appropriate...

  • 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

  • Any ideas how to execute a .sql file on database server from java?

    Any ideas how to execute a xyz.sql file (which is fisically on
    database server) from java?
    thanks

    Try
    sqlplus "sys/oracletest as sysdba" @bpk.sql
    Working locally, and having set the ORACLE_SID, you don't need to specify the SqlNet alias (@testdb).
    Remember to put an exit at the end of the bpk.sql script.

  • How to save MS Word file in Database

    hi everyone,
    I want to use MS Word in forms and then save word file in Oracle8i Database. PLease Tell me How to complete this task.
    Many THanks.
    Kashif

    Good luck using OLE to modify existing DB stored Word documents. There is a REAL nasty bug in 6i (#2615804) that causes the Forms runtime to crash. There is no bug fix availible, as yet, and it's severely affecting our planned migration to Forms 6i. This has the affect of not allowing us to migrate our DB to 9i since 4.5 is not supported against 9i. Sheesh! Request to Metalink for some type of resolution have been met with replies of "you should try storing your documents on the file system since OLE is not support in Forms 9i or web delivery of 6i.
    At this stage, we're looking into alternatives to storing Word documents in the DB. The problem is going to be converting the tens of thousands of documents we already have stored. If it's not too late for you, I'd reconsider storing Word documents in the database.
    My 2 cents,
    Ken Medlock

  • How to save CSV file in application server while making infospoke

    How to save CSV file in application server to be used as destination while making infospoke.
    Please give the steps.........

    Hi
    If you want to load your flatfile from Application server,then you need to trasfer your file from your desktop(Computer) to Application server by using FTP.
    Try using ARCHIVFILE_CLIENT_TO_SERVER Function module.
    You Just need to give thesource path and the target path
    goto SE37 t-code , which is Function module screen, give the function name ARCHIVFILE_CLIENT_TO_SERVER, on click F8 Execute button.
    for path variable give the file path where it resides like C:\users\xxx\desktop\test.csv
    for target path give the directory path on Application server: /data/bi_data
    remember the directory in Server starts with /.
    U have to where to place the file.
    Otherwise use 3rd party tools to connect to ur appl server like : Core FTP and Absolute FTP in google.
    Otherwise...
    Goto the T.code AL11. From there, you can find the directories available in the Application Server.
    For example, if you wanna save the file in the directory "DIR_HOME", then you can find the path of the directories in the nearby column. With the help of this, you can specify the target path. Specify the target path with directory name followed by the filename with .CSV extension.
    Hope this helps
    regards
    gaurav

  • How to import an .csv file into the database?

    and can we code the program in JSP to import the.csv file into the database.

    It is better to use Java class to read the CSV file and store the contents in the database.
    You can use JSP to upload the CSV file to the server if you want, but don't use it to perform database operations.
    JSPs are good for displaying information on the front-end, and for displaying HTML forms, there are other technologies more suitable for the middle layer, back end and the database layer.
    So break you application into
    1) Front end - JSPs to display input html forms and to display data retrieved from the database.
    2) Middle layer - Servlets and JavaBeans to interact with JSPs. The code that reads the CSV file to parse it's contents should be a Java Class in the middle layer. It makes use of Java File I/O
    3) Database layer - Connects to the database using JDBC (Java Database Connectivity), and then writes to the database with SQL insert statements.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Keeping the above concepts in mind, first build a simple JSP and get it to work,
    then research on Google , for Java File I/O , discover how to read a file,
    Then search on how to readh a CSV file using Java.
    After researching you should be able to read the CSV file line by line and store each line inside a Collection.
    Then research on Google, on how to write to the database using JDBC
    Write a simple program that inserts something to a dummy table in the database.
    Then, read the data stored in the Collection, and write insert statements for each records in the collection.

  • How to save a fmb in the database thru command prompt?

    Hi,
    How to save a fmb in the database thru command prompt?
    I have around 25 fmb template files which needs to be saved in the database.Every time when we apply the new dump , we need to resave the templates in the database to compile other application related fmb files.Its a time consuming process and Monotonous for me. Is there anyway to save the forms in the database thru batch file, so that just I have to execute the batch file every time.
    Expecting your earliest feedback.
    Thanks & Regards,
    G.S -
    [email protected] / [email protected]

    Hi Frank,
    Thanks for your feeback.
    I am using forms6i.Basically our application was migrated from 4.5 to 6i two years back. Due to some reasons our technical team members are insisting us to store the template FMB's into the database to do the coding activities at site.
    Once in a month we are receiving the live dump for test database.Hence the problem.
    Please suggest the easiest way to store the template FMBs in the database.
    Thanks & Regards,
    G.S

  • How to write a CSV file in OSB

    Hi All,
    can any one tell me How to write a CSV file in OSB?
    Thanks.

    Hey, I couldnot find any xsl usage inside pipeline pair in the links given by you. Do you have any links that gives a sample example.I could not find any links with examples. I will send you a simple config jar demonstrating the use of XSLT resources/transformations.
    secondly should MFL doc replicate the name(s)of the nodes of the source xsd:I'm not sure If I understood your question.Can you please explain?
    Ex: My database schema looks like:
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <xs:schema targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/db/top/AssetsPoll" xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/top/AssetsPoll" elementFormDefault="qualified" attributeFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="CountriesCollection" type="CountriesCollection"/>
    <xs:complexType name="CountriesCollection">
    <xs:sequence>
    <xs:element name="Countries" type="Countries" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="Countries">
    <xs:sequence>
    <xs:element name="countryId">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="2"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="countryName" minOccurs="0" nillable="true">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="40"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="regionId" type="xs:decimal" minOccurs="0" nillable="true"/>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    and the corresponding MFL that I have created gives this output
    <?xml version="1.0" encoding="windows-1252"?>
    <countriesCollection1>
    <Countries>
    <counrtyId>counrtyId</counrtyId>
    <country_name>country_name</country_name>
    <regionId>regionId</regionId>
    </Countries>
    <Countries>
    <counrtyId>counrtyId</counrtyId>
    <country_name>country_name</country_name>
    <regionId>regionId</regionId>
    </Countries>
    </countriesCollection1>
    Why I am asking this beacuse there is an error that i am getting:
    Jun 19, 2009 5:50:50 PM IST> <Error> <JCATransport> <BEA-381951> <JCA inbound r
    quest only invocation failed, exception: java.security.PrivilegedActionExceptio
    : com.bea.wli.sb.transports.TransportException: Binary to XML mfl transformatio
    failed for the MFL Resource Database-Jms-File/Database-File/MFLSample : null
    ava.security.PrivilegedActionException: com.bea.wli.sb.transports.TransportExce
    tion: Binary to XML mfl transformation failed for the MFL Resource Database-Jms
    File/Database-File/MFLSample : null..................................................
    Any help?
    Regards
    PS

  • Simple save as .csv file

    Hi,
    is it possible to simplyfie the save as .csv file dialog? etc. by using filedialog in vba?
    each time i save as .csv i need to say yes to save in older format, select wich map i want to use...
    if i in VBA could have som file dialog brosing to the file i want to use etc.:
    stringtosave = "c:\testfiles\test.csv"
    and then call:
    FileSaveAs Name:=stringtosave , FormatID:="MSProject.CSV", map:="MapiwillUse"
    Regards
    Toni

    Hello Toni,
    I haven't had time to test this myself (it's Saturday!), but i suspect if you bracket your FileSaveAs command turning the MS Project alerts off and back on again, the alert box you're seeing will be suppressed:
    Application.DisplayAlerts = False
    FileSaveAs Name:=stringtosave , FormatID:="MSProject.CSV", map:="MapiwillUse"
    Application.DisplayAlerts = True
    If you wanted to get a dialogue to browse for the folder, you'll need to use an API call. Chip Pearson has posted a how to guide on how to browse for a folder using the API call "SHBrowseForFolderA". His website focusses on MS Excel VBA, but I've
    used this code myself in MS Project and can confirm it works the same.
    http://www.cpearson.com/excel/browsefolder.aspx
    ####Update####
    Rereading your question after posting my response, I think you'll want to browse for a file rather than a folder, which is a different api call - "ahtCommonFileOpenSave".
    I did a quick google search and the clearest example I came across was this one - again, not written for MS Project, but the code is the same:
    http://access.mvps.org/access/api/api0001.htm
    Andrew

  • How to save Forms and Reports in Database ?

    How to save Forms and Reports in Database
    and
    Run from DataBase ?

    Saving forms in the database is no longer supported I am afraid. We only support the fmx file based format now.

  • Please can someone tell me how to save a MP3 file from my email on my iPad so I can put in on Facebook? Thankyou

    Please can someone tell me how to save a MP3 file from my email on my iPad so I can put it on Faceboo? I use hotmail and please tell me step by step as I am not a tech guru lol. Thankyou

    Hi jscher200,
    Thank you for your reply, sorry for the VERY late late response, but I have just figured out how to control this separate 'panel'. I find it really useful for monitoring Google Analytics in as it can just sit there running. It does have its limitations, as it's a limited size (you can't expand it to full screen view), so you can only ever see a vertical section of a website and need to scroll to look to the right or left, but I have the live view of people accessing my website running on there and if the numbers start racking up at any time, I can scroll to look and see what pages they are accessing, where they've been referred from, etc.
    To get it to work, you save a website address in the Bookmarks Toolbar and when you can see it sitting on the toolbar at the top of the screen with its little icon, right click on it then click 'properties', then tick the box 'Load this bookmark in the sidebar'. The next time you click on this bookmark to open the website, it will load in this sidebar, which looks like a separate 'window' but is immovable. You can only have one sidebar application running at a time, but can change it by right clicking on the bookmark you want to load in there and it will then change to that one next time you click on that bookmark.
    I hope this might be useful to others, as I asked for help with this on loads of forums and not one person knew that this existed - even really skilled techies!

  • How to create a CSV file in java

    how to create a CSV file in java

    this is the code that I have used in a hp project:
    private static final String DELIMIT = ",";
    StringBuffer buf = new StringBuffer();
    public void addString(String str){
    buf.append(toEscapedStringLiteral(str.replaceAll(" ","").trim())).append(DELIMIT);
    public void sendFile( String strData ,
                                String strTitle,
                                String strContType,
                                HttpServletResponse res ) throws IOException {
              byte[] _filedata=strData.getBytes();
              res.setContentType( strContType );
              res.setHeader( "Content-Disposition", "attachment;filename="+ strTitle );     
                     DataOutputStream out = new DataOutputStream( res.getOutputStream() );
              out.write( _filedata, 0, _filedata.length );
              out.close();
    public void addStringWhithReturn(String str){
              buf.append(toEscapedStringLiteral(str.replaceAll(" ","").trim()));
              buf.append( "\n" );
    private String toEscapedStringLiteral( String charSeq ) {
              if ( null == charSeq ) {
                   charSeq = "";
              return "\"" + charSeq + "\"";
    ....hope its help
    kou

  • Save a csv file on local host, executing a DTP Open hub in a Process chain?

    Hi All,
    my client has asked me to try if there is a way to save in the local host c:\  a .CSV file generated from an Open HUB executed by a DTP in a Process chain.
    when i execute my DTP it work correctly and it save the .csv file on my c:\ directory.
    my client doesn't want to give th users authtorization on RSA1 and want to try if there is a way to put the DTP in a process chain
    and when executing the process chain every user can have the file on his own local c:\ directory.
    i tried this solution but it doesn't work i get an error on executin the process chain:
    Runtime Errors         OBJECTS_OBJREF_NOT_ASSIGNED
    Except.                     CX_SY_REF_IS_INITIAL
    Error analysis
        An exception occurred that is explained in detail below.
        The exception, which is assigned to class 'CX_SY_REF_IS_INITIAL', was not
         caught in
        procedure "FILE_DELETE" "(METHOD)", nor was it propagated by a RAISING clause.
        Since the caller of the procedure could not have anticipated that the
        exception would occur, the current program is terminated.
        The reason for the exception is:
        You attempted to use a 'NULL' object reference (points to 'nothing')
        access a component (variable: "CL_GUI_FRONTEND_SERVICES=>HANDLE").
        An object reference must point to an object (an instance of a class)
        before it can be used to access components.
        Either the reference was never set or it was set to 'NULL' using the
        CLEAR statement.
    can you give some advices please?
    Thanks for All
    Bilal

    Hi Bilal,
    Unfortunately, DTPs belonging to Open Hubs wich are targeted to a local workstation file, can't be executed through a process chain. 
    The only way of including such DTP in a process chain is changing the Open Hub so that it writes the output file in the application server.  Then, you can retrieve the file -through FTP or any other means- from the application server to the local workstation.
    Hope this helps.
    King regards,
    Maximiliano

Maybe you are looking for