How to create a file in memory and then store it in database

Hi Guys,
I'm wondering how could i create a file such a plain text or css styleshhet in runtime and then store this file in the database. I need to save them in the database cause the application doe not have write permission to filesystem.
Is that possible ? Can a file be created only in memory and saved in database instead of filesystem?
I'd appreciate your help on this.
Thanks a lot.

jack.black wrote:
What i really need is to save information as a stylesheet into db. These information is input in a form and sent to a servlet. You have a servlet and in there you are creating data, lets say the data is representable as a string.
You have a database layer (however it is implemented) which takes data (string) and stores it as a blob presumably.
That is two distinct and completely separate processes.
The second has nothing to do with the first because the second doesn't care how the data is created. And you should write the code for the second and test it completely independent from the first (just as all of the database layer should be handled.)
As for the first you can use StringWriter, perhaps wrapping it in PrintWriter if you wish. Do whatever you want to put data in there. Be sure to close it, extract the string and then use it.
The only limitation to processing like this is that if the data gets too large (individually or due to number of threads) it could adversely impact the application.

Similar Messages

  • How to create a file in memory and how to open it?

    Hi All,
    Warm greetings...
    I bundle a file in encrypted form with my project's distribution. User may need to see this file while working on it. I want to load this file in memory, decrypt it there and then display its content to user in read only form.
    Is there any way to do this.
    Best

    Christi wrote:
    I bundle a file in encrypted form with my project's distribution. User may need to see this file while working on it. I want to load this file in memory, decrypt it there and then display its content to user in read only form.
    And what happens if the OS swaps your application to hard drive while the user goes to lunch? Is that or is that not a problem?
    In some business domains that is a problem and in others it isn't.

  • How to create OEMS JMS In-Memory and File-Based Persistence?

    Anyone knows how to create OEMS JMS In-Memory and File-Based Persistence? Any help it is appreciated. I m working with Oracle BAM 11g TP4 and I want to test the capability of connecting directly to a JMS queue, and reading Oracle´s "complex" documentation I couldnt find the right way to make this happen.
    tks

    Hi Mario
    This is explained in the soa developer's guide. Chapter 43 "Enterprise message source"should help you. You will find how to connect OEMS or JMS in-memory/file based to your BAM data objects with or without xpath transformation.
    You can find sample of advanced XML formating in the 10g tech note: "Oracle BAM 10.1.3 configuration for BPEL 10.1.2 using JMS sensors" (useful even if you don't plan to use BPEL).
    Anyway, if you plan to use BPEL, forget JMS and use the BAM adapter (chapter 42), it's quicker & easier.
    Dominique

  • How to create OEMS JMS In-Memory and File-Based Persistence ? Anyone?

    Anyone knows how to create OEMS JMS In-Memory and File-Based Persistence? Any help it is appreciated. I m working with Oracle BAM 11g TP4 and I want to test the capability of connecting directly to a JMS queue, and reading Oracle´s "complex" documentation I couldnt find the right way to make this happen.
    tks

    Hi Mario
    This is explained in the soa developer's guide. Chapter 43 "Enterprise message source"should help you. You will find how to connect OEMS or JMS in-memory/file based to your BAM data objects with or without xpath transformation.
    You can find sample of advanced XML formating in the 10g tech note: "Oracle BAM 10.1.3 configuration for BPEL 10.1.2 using JMS sensors" (useful even if you don't plan to use BPEL).
    Anyway, if you plan to use BPEL, forget JMS and use the BAM adapter (chapter 42), it's quicker & easier.
    Dominique

  • How to create xml file from Oracle and sending the same xml file to an url

    How to create xml file from Oracle and sending the same xml file to an url

    SQL/XML (XMLElement, XMLForest, XMLAgg, etc) and UTL_HTTP.
    Whether that works for you with the version of Oracle you have, your requirements, and needs is another story. A little detail goes a long way.

  • When pressing the "R" on the keyboard to record the following pop up - "Beta-only warning message-not to be localized Can't create record files please report" and then this "error occurred Result= -48"  What does this mean?

    When pressing the "R" key on the keyboard to record the following pops up - "Beta-only warning message-not to be localized.  Can't create record file, Please Report"  I press O.K. and this pops up - "Error occurred Result= -48".  Can't figure out why.  First time I have every had problems>  What's up with this?

    a -48 error is a duplicate filename.
    the first things i'd try are the oddball problems fixes:
    http://www.bulletsandbones.com/GB/GBFAQ.html#oddballprobs
    (Let the page FULLY load. The link to your answer is at the top of your screen)

  • How to create a page that tests and then creates a valid DB LINK connection

    The problem is that I'd like to create a page that has all the necessary fields (name, host, port, etc) to create a database link just like the one in the SQL workshop - I'd prefer to have it done this way so as to limit the users from using SQL workshop. But i'd also like the DB Link tested before created.
    I've tinkered around a bit and was able to create the database link using a page process that calls an execute immediate statement to add the database link using items in the form section, however I'm confused as to how I would test the connection before hand.

    but rather the concept of a page that reads from table (maybe a "report?") to provide a result set of data which the user can click on a result to direct to another page.You are on the right track with the idea of an initial page with a report region listing your reports as links. Not sure from the provided information if this out of the box capability will meet your actual requirement, but try the Create Page wizard > New page > Form > Form on a Table with Report as a first approximation.
    instead of creating unique individual pages for each of the 100 Oracle Reports, featuring the report's attributes (parameters, etc), what do I need to do just have one APEX page that dynamically reads from the table and builds the Region and its Items based on what's in the table?If this can't be handled using the built-in Form on a Table with Report design pattern, it sounds like it will be possible using a dynamic form generated using the [APEX_ITEM API|http://download.oracle.com/docs/cd/B28359_01/appdev.111/b32258/api.htm#BGBHDGAI] either as another report region or a PL/SQL Dynamic Content region.
    Also, any reference books that you guys recommend on the ins/outs of APEX? [Pro Oracle Application Express|http://www.amazon.co.uk/gp/reader/159059827X/ref=sib_dp_pt#reader-link], the authors of which are active voices on this forum, is a good book. The forum itself is an unbelievable resource, as is the hosted service for learning and experiment at [apex.oracle.com|http://apex.oracle.com/i/index.html].

  • I am working in windows 7 and I am trying to enable the copy/paste and I can not find user.j file in the profile and I am not real sure how to create a file, I can create a folder .

    I am trying to copy text from a word document and paste it into my web builder and it says that firefox does not support copy/paste from clipboard. Went to your site and it tells me to open the user.j file in my profile. This file does not exist and I am not real sure how to create that file so I can paste the fix from your site into it.

    I went to that link and added to firefox add on but it still does not work. I went to the add on option button for this but it told me that my MYSIWG widget was disabled. Does this have something to do with it not working and if so how do you enable it.

  • How to keep XML file in memory for specified period ?

    How to keep XML file in memory for specified period or forever, I have 5 applications running on WebSphere I wants to use XML file for all the applications. I mean when one apllication is not using XML file still I wants to keep it in memory ...
    Thanx in advance ,

    Hello,you can create a DocumentManager class,
    here is my solution in the past...
    you can use static Hashtable save the xml's Document,if one application want get
    a appointed Document.first,you can find it from Hashtable,if can't find it ,you
    can create it and put into Hashtable,if the words fail to express the meaning,sorry,my english is limited
    package com.foresee.xfiles.util;
    import java.util.*;
    import org.w3c.dom.*;
    import org.apache.log4j.*;
    import com.foresee.xfiles.common.*;
    import com.foresee.xfiles.server.exception.*;
    import com.foresee.xfiles.util.*;
    * <p>Title: </p>
    * <p>Description: </p>
    * <p>Copyright: Copyright (c) 2002</p>
    * <p>Company: </p>
    * @author unascribed
    * @version 1.0
    public final class DocumentManager {
    private static Category m_log = Category.getInstance(DocumentManager.class.getName());
    static {
    PropertyConfigurator.configure(Configurator.getLCF());
    public DocumentManager() {
    //synchronized
    public static synchronized Document getTransitionDoc(String path) throws SchemaCheckOutException{
    Document m_TransitionDoc;
    m_TransitionDoc = (Document)TransitionDoc.get(path);
    if (m_TransitionDoc == null){
    XmlHelper m_xh = new XmlHelper();
    try{
    m_TransitionDoc = m_xh.getDocument(path);
    }catch (SchemaCheckOutException se){
    m_log.error("������������������������"+path+"����:"+se.getUserMsg());
    throw se;
    TransitionDoc.put(path,m_TransitionDoc);
    return m_TransitionDoc ;
    public static synchronized Document getLogicCheckDoc(String path) throws SchemaCheckOutException{
    Document m_LogicCheckDoc;
    m_LogicCheckDoc = (Document)LogicCheckDoc.get(path);
    if (m_LogicCheckDoc == null){
    XmlHelper m_xh = new XmlHelper();
    try{
    m_LogicCheckDoc = m_xh.getDocument(path);
    }catch (SchemaCheckOutException se){
    m_log.error("������������������������"+path+"����:"+se.getUserMsg());
    throw se;
    LogicCheckDoc.put(path,m_LogicCheckDoc);
    return m_LogicCheckDoc ;
    public static Hashtable TransitionDoc = new Hashtable();
    public static Hashtable LogicCheckDoc = new Hashtable();

  • How to Create a New Admin Account and Change Original to Standard Account?

    I have a single user admin account that I set up when I got my PowerBook. Now I want to have two accounts with the new one being the admin account. This way I can leave most of the data files, email accounts, etc. with the old account and use the new one for personal data and admininistration. Then I could give out the password for the original account without fear that a user could change permissions and get access to the new account with the personal data. Can I create a new admin account and then change the original account to "Standard" instead of "admin"? What problems will this create?
    PowerBook G4   Mac OS X (10.3.9)  

    i2:
    Not sure if you are asking if or how. Templeton has
    answered if. Here's how.
    Apple Menu > System Prefs > Accounts. Click on the +
    under User Options to create new account. Go to
    Security and check box at bottom to make account
    admin. You can take care of the other items, picture
    etc, login options etc.
    To make the other account Standard select the
    account, go to Security and deselect box "Allow User
    to Administer".
    Hope this answers your questions.
    Good luck.
    cornelius
    PismoG4 550,
    100GB 5400 Toshiba internal, 1 GB RAM; Pismo 500 OS
    (10.4.4)   Mac OS X (10.3.9)   Beige G3 OS
    8.6
    Thanks, I'm tying to find out if I will run into problems, such as not being able to use the new admin account to change permissions in the old.

  • How to create txt file in utf-8?

    Hi,
    if i create a txt file using vb in fdm, it is created with the ansi encoding. Is there any option how to create this file in utf-8?
    Thx

    Forms6i uses Oracle 8.0.6 client libraries. MetaLink Note 207303.1 lists supported client/server configurations, and the last database version supported with those libraries is Oracle 9.2. The only exception is made for e-Business Suite (Oracle Applications). Therefore, you configuration is not supported.
    Anyway, Oracle 8.0.6 does not support AL32UTF8 well. You should select UTF8 as the database character set (not national character set!). You need to select a check box on DBCA interface (possibly unavailable in fast/default installation path) which allows you to see non-recommended character sets.
    -- Sergiusz

  • How to create backup file on itunes for ipod touch 4g game apps data? Is there a way to do it? I want to try an app on my friend's computer, but you can't add apps on another computer without having your own ipod's data being deleted. Thx for any help!

    How to create backup file on itunes for ipod touch 4g game apps data? Is there a way to do it? I want to try an app on my friend's computer, but you can't add apps on another computer without having your own ipod's data being deleted. Thx for any help!
    I want to know how to create a backup file (because I'm pretty new with itunes, and it's hard to use it for me still), how to store my app data/media/videos, etc. And how I can retrieve them back when I'm done with the app I tried on my friend's computer.
    If anyone can help, it'd be great! Thank you so much!

    Sure-glad to help you. You will not lose any data by changing synching to MacBook Pro from imac. You have set up Time Machine, right? that's how you'd do your backup, so I was told, and how I do my backup on my mac.  You should be able to set a password for it. Save it.  Your stuff should be saved there. So if you want to make your MacBook Pro your primary computer,  I suppose,  back up your stuff with Time machine, turn off Time machine on the iMac, turn it on on the new MacBook Pro, select the hard drive in your Time Capsule, enter your password, and do a backup from there. It might work, and it might take a while, but it should go. As for clogging the hard drive, I can't say. Depends how much stuff you have, and the hard drive's capacity.  As for moving syncing from your iMac to your macbook pro, should be the same. Your phone uses iTunes to sync and so that data should be in the cloud. You can move your iTunes Library to your new Macbook pro
    you should be able to sync your phone on your new MacBook Pro. Don't know if you can move the older backups yet-maybe try someone else, anyways,
    This handy article from Apple explains how
    How to move your iTunes library to a new computer - Apple Support''
    don't forget to de-authorize your iMac if you don't want to play purchased stuff there
    and re-authorize your new macBook Pro
    time machine is an application, and should be found in the Applications folder. it is built in to OS X, so there is nothing else to buy. double click on it, get it going, choose the Hard drive in your Time capsule/Airport as your backup Time Machine  and go for it.  You should see a circle with an arrow on the top right hand of your screen (the Desktop), next to the bluetooth icon, and just after the wifi and eject key (looks sorta like a clock face). This will do automatic backups  of your stuff.

  • How to create a file in the server?

    Hi,
    I'm making a webservice that has to generate a XML file, sign it using another webservice and return this XML. The problem is that i don't know how to create the file in the server throught webservice.
    I use this code in the webservice to generate the XML and after I return the XML to client in a byte[]
         static void outputDocumentToFile(Document myDocument, String path) {
            //setup this like outputDocument
              try {
                   // XMLOutputter outputter = new XMLOutputter("  ", true);
                   XMLOutputter outputter = new XMLOutputter();
                   //output to a file
                   FileWriter writer = new FileWriter(path);
                   outputter.output(myDocument, writer);
                   writer.close();
              } catch(java.io.IOException e) {
                   e.printStackTrace();
        }But the file is generated in the client-side, how can I generate the file in the server-side?
    Thanks very much.

    Well the File object doesn't create a file it's simply an abstract representation of file and directory pathnames.
    You can try something like this:
    <%
    try
    // get the path to the web server root
    // I read somewhere not to use 'getRealPath' for some reason which I
    // can't seem to remember :S Hopefull someone can enlighten us :)
    String path = application.getRealPath("/project/jsp/demo.txt");
    File file = new File(path);
    PrintWriter writer = new PrintWriter(new BufferedWriter(new FileWriter(file)));
    writer.println("Hello World!");
    writer.close();
    catch (Exception e)
    System.err.println(e.getMessage());
    %>
    Hope this helps :)

  • How to create temp files in temp tablespace

    Dear all,
    Due to outage of our SAN, we our out of production for the
    last 3 days. By the grace of Almighty we have restored production by
    database recovery from our standby backup. Since temp tablespace and
    temp data files do not taken as backup for standby, now after recovery
    we are getting abap dumps asking for temp_1 and temp_2 datafiles.
    Please guide us how to create temp files. v$tablespace is showing tablespace PSAPTEMP but datafile are not there
    Abap dumps are giving these errors as mentioned below
    ====================================================
    The exception must either be prevented, caught within the procedure            
    "DATA_SELECTION"                                                              
    "(FORM)", or declared in the procedure's RAISING clause.                       
    To prevent the exception, note the following:                                  
    Database error text........: "ORA-01157: cannot identify/lock data file 256 -  
    see DBWR trace file#ORA-01110: data file 256:                                 
    '/oracle/SD1/sapdata4/temp_2/temp.data2'"                                     
    Internal call code.........: "[RSQL/FTCH/MARA ]"                               
    ===================================================
    another one asking for 
    '/oracle/SD1/sapdata3/temp_1/temp.data1'"
    Best Regards
    Waqas

    if you want to add a new tempfile to your TEMP Tablespace,you can do like that.
    <i>ALTER TABLESPACE</i> <<b><u>name of TEMP Tablespace</u></b>> ADD TEMPFILE <<b><u><b><u>pfad to the file_and_file name</u></b></u></b>> <b>SIZE</b> <size>;
    You can use also the options <i>REUS</i>E <i>autoextend off</i> or <i>on</i> .
    e.g:
    <i>alter tablespace</i> <u><b>PSAPTEMP</b></u> add <i>tempfile</i> <b><u>'/oracle/SD1/sapdata4/temp_2/temp.data2'</u></b> <i>SIZE 1000K</i> <i>REUSE</i>;
    The directory <b><u>temp_2</u></b> should exist.
    Or you can use the BR*Tools to create a new datafile. Enter brtools and follow the instructions or menu.
    More to TEMP Tablespaces see please following SAP notes:
    <u><b>659946</b></u> - FAQ: Temporary tablespaces
    <u><b>600513</b></u> - ORA-25153 after recovery due to missing tempfiles
    and the Oracle Note:
    <u><b>160426.1</b></u>: TEMPORARY Tablespaces : Tempfiles or Datafiles ?
    I hope it helps.

  • How to create IDX files

    Hi All,
    How to create IDX files, In pdf i have done full text index with catlog, i have got the pdx files.
    But i need the index files *.idx files.
    How to get these files.
    Please help me to solve this issue.
    Regards,
    Vinoth

    i have created the button on Acrobat X professional.
    Please find the below code for search the text
    // Test search text and only proceed if it’s not empty
    var cSearchTxt = this.getField("SearchText").value;
    if(!/^\s*$/.test(cSearchTxt))
       // Create first part of path to index file from this file
       var aPath = this.path.split("/");
       aPath.pop();
       var cPathRoot = aPath.join("/");
       // Determine Index to use with search
       var cIdxPath = "";
       var cCatagory = this.getField("Catagory").value;
       switch(cCatagory)
          case "P01":
             cIdxPath = cPathRoot + "/Catalogs/Paper01.pdx";
             break;
          case "P02":
             cIdxPath = cPathRoot + "/Catalogs/Paper02.pdx";
             break;
       // Setup Search Options
       //search.matchCase = this.getField("CaseSensitive").isBoxChecked(0);
       //search.matchWholeWord = this.getField("WholeWord").isBoxChecked(0);
       //search.wordMatching = this.getField("MatchOpts").value;
       //  Perform Search
       search.query(cSearchTxt, "Index", cIdxPath);
    Regards,
    Vinoth

Maybe you are looking for

  • HT1277 Can I sync a smart email folder to my wife's email app on our Mac?

    I set up a smart folder in Mail to hold all iTunes receipts and would like it to automatically sync to my wife's account so she can have copies of them. Is this possible to set up automatically or do I have to forward the receipts each time?

  • Can't log in to iMessages/FaceTime on Mac

    I am having trouble logging in to iMessages and FaceTime on my Mac. I read everything here and have tried a bunch of suggestions (if not all of them) in an attempt to rectify the problem. No luck. MBP 17 (late 2010), Mavericks 10.9.4 Here's what I've

  • Wishlist for next version

    Hi, I haven't seen this topic anywhere else, so I thought I would start it here. I wish ... • that I could bookmark or color-label tracks in iTunes. This could be a quick visual cue (rather than looking at the 'last played' date) when listening over

  • Does anyone know if the ZaggMate for iPad 1 will fit an iPad 2?

    Okay, so I didn't wait and bought my iPad in January (bought all my college texts as ebooks and they are on my iPad). I bought a Zaggmate keyboard/cover for it. http://www.zagg.com/accessories/zaggmate-ipad-case I was debating on upgrading to an iPad

  • Importing m2v-file: Error loading transcode preset

    Dear all, Just have Encore 1.51 a few weeks now (eBay). But sofar I couldn't get a project together. Only problems when importing (good) m2v files. Also on the forum almost no solutions. Once again I have an Error loading transcode preset. I just mad