Writing

Why doesn't the following work? When I execute the program, a blank, gray window displays.
import java.awt.*;
import javax.swing.*;
class MyPanel extends JPanel
     public void paintComponet(Graphics g)
          super.paintComponent(g);
          Graphics2D g2d = (Graphics2D) g;
          //g.setColor(currentTextColor);
          g2d.setPaint(Color.black);
          g2d.drawString("hello world", 50, 50);
public class DemoDrawing
     static JFrame aWindow = new JFrame("some title");
     public static void main(String[] args)
          //Toolkit kit =  aWindow.getToolkit();
          //Dimension size = kit.getScreenSize();
          //aWindow.setBounds(size.width/4, size.height/4, size.width/2, size.height/2);
          aWindow.setBounds(50, 50, 400, 300);
          aWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          MyPanel panel = new MyPanel();
          //panel.setBackground(Color.pink);
          Container cp = aWindow.getContentPane();
          cp.add(panel);
          aWindow.setVisible(true);
}

Hey, thanks for taking the time to look over my code and finding that typo. It was driving me crazy.

Similar Messages

  • Vi error on nfs mount; E212: Can't open file for writing

    Hi all,
    I've setup a umask of 0 for testing on both NFS client (Centos 5.2) and NFS server (OSX 10.5.5 server).
    I can create files as one user and edit/save out as another user w/o issue when directly logged into the server via ARD.
    However, when I attempt the same from an NFS mount on a client machine, even as root I get the following error using vi;
    "file" E212: Can't open file for writing
    Looking at the system.log file on the server, I see;
    kernel[0]: add_fsevent: no name hard-link! dropping the event. (event 2 vp == 0xa5db510 (-UNKNOWN-FILE)).
    This baffles me. My umask is 0 meaning files I create and attempt to edit as other users are 777, but I cannot save out edits unless I do a wq! in vi. At that point, the owner of the file changes to whomever did the vi.
    This isn't just a vi issue as it happens using any editor, but I like to use vi.
    Any help is greatly appreciated. Hey, beer is on me!

    Hi all,
    Thanks for the replies
    I've narrowed it down to a Centos client issue.
    Everything works fine using other Linux based OS's as clients.
    Since we have such a huge investment in Centos, I must figure out a workaround. Apple support wasn't much help as usual however they were very nice.
    There usual response is "its unsupported".
    If Apple really wants to play in the enterprise of business space, they really need to change there philosophy. I mean telling me that I shouldn't mount home directories via NFS is completely rediculus.
    What am I supposed to use then, Samba of AFP? No, I don't think so. No offense to Microsoft but why would I use a Windows based file sharing protocol to mount network shares in a Nix env???

  • Writing to file limiting system performanc​e

    Hello,
    I really could use some help with my VI in terms of writing data.  I’ve had a LOT of help optimizing my code and am trying to enhance the performance in terms of data acquisition.  However, it seems as though writing to a data file is really limiting the frequency I can sample at.  I’ve done some research and understand that writing data at every iteration of the while loop and the build array function slows things down.  How would I modify the code so that the array buffer would store maybe 5000 data points before writing to a file, then clearing the array?  That would keep the array size small, as well as reduce the number of times the program is performing the write to file function.  Is there a better way of doing this?  I’m open to any other ideas as well.    
    I am taking data from 14 channels, and would like to sample at 1 kHz each.  The task right now is created within Measurement and Automation Explorer, and the number of samples is at 100.  I also use a buffer indicator, which will generally grow out of control, no matter how much I modify the number of samples and the frequency.  The length of my test can last upwards to 6 hours, so it needs to work that long without crashing.     
    The code and attached subVI’s is attached.  Hopefully it's all there.
    Thanks for your help,
    Alex
    Attachments:
    Test Program.zip ‏295 KB

    Lynn,
    Yea, I'll have to keep on the block diagram size in the future.  Can get unwieldy.
    I tried incorporating the Recent History Buffer example into my code.  I did have a few hang ups, which are giving me some trouble.  Mostly, how do I connect my waveform data to the Buffer VI?  Will I be able to have all my channels connect to this?  Also, ultimately I will have two write to file VI's.  Can the buffer differentiate between which file to write?
    Thanks,
    Alex
    Attachments:
    Instrument Panel V1.1 (Labview 8.0).vi ‏159 KB

  • Error while updating DocumentDefinition AIP-11052:Writing following objects

    Hi All,
    I am getting this error while updating ecs in Document Definition. I was able to do it properly on the same environment a few weeks back but now its throwing an error:
    Error -: AIP-11052: Writing following objects: Document Definition failed due to following constraint violation: DOCUMENTDEFINITION. CAN NOT UPDATE UNVERSIONABLE OBJECT IN A VALIDATED CONFIGURATION
    I read in some of the OTN forums that this may be an environment issue. So i restarted the B2B server as suggested but the error seems to still exist.
    Kindly reply how to proceed. Its little critical.
    Thanks in advance.

    Make sure there is no agreement in deployed/validated state which is using this document definition. Retire and purge all existing configurations which are using this doc def and make sure there is no agreement in validated state. If there is an agreement in validated state and then change/just update anything in agreement and save it to bring it back into draft state.
    Regards,
    Anuj

  • Access denied error while writing a file to the file system - myfileupload.saveas() throws system.unauthorizedexception

    hi,
    as part of my requirement , i have to perform read and  write  operations of  few files [ using the file upload control in my custom visual web part] and on submit button click.
    but while writing these files - with the help of  fileupload control - and when i use  myfileupload.saveas(mylocation);
    - i am saving these files into my D:\ drive of my server , where i am executing my code -, am getting access denied error.
    it throws system.unauthorizedexception.
    i have given full control on that folder where i was trying to store my attached files. and also  after following asp.net forums,
    i have added  iusr group added and performed all those steps such that, the file is saved in my D:\ drive.
    but unfortunately  that didnt happen.
    also
    a) i am trying the code with runwithelevatedprivileges(delegate() )  code
    b) shared the drive within the  d :drive where i want o save the files.
    c) given the full privieleges for the app pool identity- in my case , its
    network service.
    the  other strange thing is that, the same code works perfectly in  other machine, where the same sp, vs 2012  etc were installed .
    would like to know, any other changes/ steps i need to make it on this  server, where i am getting the  error.
    help is  appreciated!

    vishnuS1984 wrote:
    Hi Friends,
    I have gone through scores of examples and i am failing to understand the right thing to be done to copy a file from one directory to another. Here is my class...So let's see... C:\GetMe1 is a directory on your machine, right? And this is what you are doing with that directory:
    public static void copyFiles(File src, File dest) throws IOException
    // dest is a 'File' object but represents the C:\GetMe1 directory, right?
    fout = new FileOutputStream (dest);If it's a directory, where in your code are you appending the source file name to the path, before trying to open an output stream on it? You're not.
    BTW, this is awful:
    catch (IOException e)
    IOException wrapper = new IOException("copyFiles: Unable to copy file: " +
    src.getAbsolutePath() + "to" + dest.getAbsolutePath()+".");
    wrapper.initCause(e);
    wrapper.setStackTrace(e.getStackTrace());
    throw wrapper;
    }1) You're hiding the original IOException and replacing it with your own? For what good purpose?
    2) Even if you had a good reason to do that, this would be simpler and better:
    throw new IOException("your custom message goes here", e);
    rather than explicitly invokign initCause and setStackTrace. Yuck!

  • To avoid writing database code in the front end

    Hello,
    I am working on a database application using 10g database as backend and dotnet as front end. I wish to execute only oracle stored procedure for all the select (to avoid hard parse and use of bind variable), DDL and DML operations; just to avoid writing database code in the front end. Can anyone please give me a little examples of :
    1.Select query's output to be return as resultset by stored procedure.
    2.DML example by stored procedure.
    3.Any DDL example by stored procedure.
    using scott.emp, so that i would just call the stored procedure, rather than giving select,DML and/or DDL commands in the front end. Even though i have read in the documentation, but a clear cut examples will help me to get into clear concept as well.
    Thanks & Regards
    Girish Sharma

    Hi...
    -->Select example
    create or replace procedure get_emp(rc out sys_refcursor)
    is
    begin
    open rc for select * from emp;
    end;
    -->DML example
    create or replace procedure do_dml_emp(pempid in number,
    pempname varchar2,
    result out number)
    is
    begin
    insert into emp(empid,empname) values(pempid,pempname) returning empid into result;
    exception
    when others then
    result:=-1;
    end;
    -->DDL example
    create or replace procedure ddl_emp(colname varchar2,
    coltype varchar2,
    result out number)
    is
    begin
    result:=-1;
    execute immediate 'alter table emp add column ' || colname || ' ' || coltype ;
    result:=1;
    end;

  • My disconnected external HDD is somehow writing itself to my internal HDD!

    Ok, so the other night I got a notification from OS X that I was almost out of disk space, which I found very odd, because the last time this happened was when I had my external hard drive connected, and it was somehow writing itself onto my internal hard drive (it is formatted so that I can use it for both my MBP and the Windows machine at home). You can understand my puzzlement when I got the message, as I did not have my external connected at the time, and had not had it connected since the day before. I had, however, noticed some significant lagging in Safari and Adium, which I found very odd as being the only things affected. As of writing this, I will have cleaned off what has been written to my hard drive twice now (each time 50+ GB!), and I am starting to get very frustrated, with finals and projects coming due very fast now. It appears that the writing starts after I leave Safari/Adium idle for a while, which is very odd, as I can't imagine why either of these programs being idle would initiate this unexplained writing.
    I have, however, noticed that there seems to be something invisible in the trash folder that will simply not delete, and has been there since I had the initial problem of my external writing to the internal drive. The Trash constantly tells me there is "1 item" in the trash, but nothing shows up. When I go to Secure Empty I get the little window that tells you the completion status on the emptying, and it always says "4 Items to delete." Even after showing all hidden files and folders, nothing shows up in the trash, despite there always being "1 Item" in there. My guess is that this could be what is causing the writes. What I don't understand is how in the world it managed to store my 100+ GB of stuff on my external in an invisible file that is taking up next to no space on my system, because when I do a scan using Grand Perspective, it doesn't show anything out of the ordinary files and folders that I know should be there. Certainly not 100+ GB of what I have on my external, as I know what I have where, and what are duplicates, and duplicates only show up after the external files have written themselves.
    Some additional details for consideration:
    Bootcamped hard drive, 15GB for my Windows partition, have only used it to play Roller Coaster Tycoon, and have only connected to the internet on Windows a total of 3 times, each time to download Firefox, iTunes, and Safari, no additional browsing.
    External HDD is a LaCie Firewire 400 drive, 320GB formatted for both Windows and Mac (HFS+, right?), haven't connected it in at least two days. Last time this happened it was actually connected, but this time has not been connected when the files have magically appeared on my internal HDD.
    There is an invisible file (or multiple files) somehow not showing up AT ALL that is hanging around in the trash. I believe this invisible file(s) to be the culprit, though I'm puzzled as to how. Each time the mysterious writes have happened, Safari/Adium have been idle and open.
    If you're wondering how in the world this is happening, don't worry. The first time this happened when my drive was actually connected, I took my MBP to the Apple Store in Indianapolis and totally stumped three employees, including the store manager. If he thought that was odd, wait until I tell him its now writing to my HDD without being connected!

    Each time the problem is in the /Volumes/LaCie folder, which is hidden. This leads me to believe its a ghost from my external HDD, rather than from my Bootcamp partition. The 50+ GB that it has written so far has not been duplicates of less than 10GB of information on my Windows partition, it is all files and folders from my approx. 130+GB of information on my external.
    In talking with a friend on my floor last night, he thinks it might be a ghost image, as some people have evidently gotten this problem in their email accounts here at the school lately. This ghost image is on my OS X partition, and I'm almost 100% certain it isn't a problem with my Bootcamp partition, as nothing appears in my trash on the Windows side. I have also never used my external with my Windows partition. Like I said, everything being written is from my external hard drive.
    Thanks for the link, checking it out now.

  • When I am writing an email, I get an alert message that says "The message could not be copied or moved to the drafts folder. Writing to the folder failed. To ga

    When I am writing an email, I get an alert message that says “The message could not be copied or moved to the drafts folder. Writing to the folder failed. To gain disc space, choose Empty Deleted and choose Compact Folders and try again.”
    If I do that, I get a message saying “There was an error copying to the Sent folder,, retry?”
    If I retry it sends the uncompleted email. All I can do is keep deleting the message and carry on. Then the whole business might repeat itself.
    Help!
    Frank

    Because the location for each song in your library is on your hard drive.  If the hard drive isn't there, how can iTunes play it?
    You'll have to move/copy the music from your hard drive to your computer's hard drive.
    Basically, EASIEST way to do all this, if you don't care about your play counts, etc...
    -Delete EVERYTHING from iTunes, so that your library is now empty.
    -Go to "Advanced" inside of the "Preferences" window, found in the "Edit" drop-down.  You can also access Preferences by pressing Ctrl+, (Press Ctrl and the comma key)
    -Change your iTunes Media Folder Location to something simple, but on your computer. I use C:/iTunes.  Make sure "Keep iTunes Media Folder Organized" and "Copy files to...." are both checked.  You can close Preferences now.
    -Now, drag and drop your music from your hard drive into your iTunes library.  iTunes will automatically add the music to your library, as you would expect, and also creates a copy of each file to place into that iTunes Media Folder you just created.
    Shouldn't have any more problems...

  • Adobe Media Encoder (Error compiling movie) Unknown error when writing to Isilon OneFS 6.5.5.18

    Adobe Media Encoder (Error compiling movie) Unknown error when writing to Isilon OneFS 6.5.5.18 while using Adobe Premiere Pro.
    Process:         Adobe Premiere Pro CC 2014
    Path: /Applications/Adobe Premiere Pro CC 2014/Adobe Premiere Pro CC 2014.app/Contents/MacOS/Adobe Premiere Pro CC 2014
    Identifier: com.adobe.AdobePremierePro
    Version:         8.1.0 (8.1.0)
    Code Type: X86-64 (Native)
    Parent Process: launchd [2538]
    Responsible:     Adobe Premiere Pro CC 2014
    Date/Time: 2015-01-06 14:04:23.500 -0700
    OS Version:      Mac OS X 10.9.2 (13C64)
    Report Version:  11
    Crashed Thread: 55  Dispatch queue: com.apple.root.default-priority
    Exception Type: EXC_BAD_ACCESS (SIGSEGV)
    Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000
    Customer created test export with 777 permissions and set mount parameters to the following:
    mount_nfs -o vers=3,tcp,rdirplus,intr,nolocks,async,rsize=32768,wsize=32768
      -- Original mount options:
         General mount flags: 0x40 async
         NFS parameters: vers=3,tcp,nolocks,rsize=32768,wsize=32768,rdirplus
      -- Current mount parameters:
         General mount flags: 0x4000058 async,nodev,nosuid multilabel
         NFS parameters: vers=3,tcp,port=2049,nomntudp,hard,nointr,noresvport,negnamecache,callumnt,nolocks,quota, rsize=32768,wsize=32768,readahead=16,dsize=32768,rdirplus,nodumbtimr,timeo=10,maxgroups=16 ,acregmin=5,acregmax=60,acdirmin=5,acdirmax=60,nomutejukebox,nonfc,sec=sys
    The pcap shows once the movie is created a lockup call is responded from Isilon with Error: NFS3ERR_NOENT
    478         V3 CREATE Call (Reply In 479), DH: 0xea5f731c/QBRSN-0-0-1.mov Mode: UNCHECKED
    479         V3 CREATE Reply (Call In 478)
    484         V3 LOOKUP Call (Reply In 485), DH: 0xea5f731c/._QBRSN-0-0-1.mov
    485        V3 LOOKUP Reply (Call In 484) Error: NFS3ERR_NOENT
    V3 LOOKUP Reply (Call In ....) Error: NFS3ERR_NOENT  -   This is by design of OneFS, we coalesce files and then flush them out to disk which is why the commit time is accurate but the file is not immediately available. however when an async option is used within the mount options this should be avoided if writing asynchronously to the cluster.  Has anyone else seen this behavior lately? (current workaround is to store locally and transfer to the cluster via Finder)

    That error can happen for many reasons...one of the reasons that I occassionaly get it is because I try exporting a movie to an external drive that has been formated in the old FAT32 instead of the NTSF standard.  FAT32 only allows for file sizes up to 2 gigs.  And as soon as it reaches that...I would get that error.  I don't know if that is why you are getting that error...but it would be easy to check.  1) are you generating a file that is over 2 gigs?  2) is your drive that you are exporting to FAT 32 (just right click the drive in My Computer and select "properties" then just look for what it says next to "file system".

  • Help needed for writing query

    help needed for writing query
    i have the following tables(with data) as mentioned below
    FK*-foregin key (SUBJECTS)
    FK**-foregin key (COMBINATION)
    1)SUBJECTS(table name)     
    SUB_ID(NUMBER) SUB_CODE(VARCHAR2) SUB_NAME (VARCHAR2)
    2           02           Computer Science
    3           03           Physics
    4           04           Chemistry
    5           05           Mathematics
    7           07           Commerce
    8           08           Computer Applications
    9           09           Biology
    2)COMBINATION
    COMB_ID(NUMBER) COMB_NAME(VARCHAR2) SUB_ID1(NUMBER(FK*)) SUB_ID2(NUMBER(FK*)) SUB_ID3(NUMBER(FK*)) SUBJ_ID4(NUMBER(FK*))
    383           S1      9           4           2           3
    384           S2      4           2           5           3
    ---------I actually designed the ABOVE table also like this
    3) a)COMBINATION
    COMB_ID(NUMBER) COMB_NAME(VARCHAR2)
    383           S1
    384           S2
    b)COMBINATION_DET
    COMBDET_ID(NUMBER) COMB_ID(FK**) SUB_ID(FK*)
    1               383          9
    2               383          4
    3               383          2
    4               383          3
    5               384          4
    6               384          2          
    7               384          5
    8               384          3
    Business rule: a combination consists of a maximum of 4 subjects (must contain)
    and the user is less relevant to a COMB_NAME(name of combinations) but user need
    the subjects contained in combinations
    i need the following output
    COMB_ID COMB_NAME SUBJECT1 SUBJECT2      SUBJECT3      SUBJECT4
    383     S1     Biology Chemistry      Computer Science Physics
    384     S2     Chemistry Computer Science Mathematics Physics
    or even this is enough(what i actually needed)
    COMB_ID     subjects
    383           Biology,Chemistry,Computer Science,Physics
    384           Chemistry,Computer Science,Mathematics,Physics
    you can use any of the COMBINATION table(either (2) or (3))
    and i want to know
    1)which design is good in this case
    (i think SUB_ID1,SUB_ID2,SUB_ID3,SUB_ID4 is not a
    good method to link with same table but if 4 subjects only(and must) comes
    detail table is not neccessary )
    now i am achieving the result by program-coding in C# after getting the rows from oracle
    i am using oracle 9i (also ODP.NET)
    i want to know how can i get the result in the stored procedure itsef.
    2)how it could be designed in any other way.
    any help/suggestion is welcome
    thanks for your time --Pradeesh

    Well I forgot the table-alias, here now with:
    SELECT C.COMB_ID
    , C.COMB_NAME
    , (SELECT SUB_NAME
    FROM SUBJECTS
    WHERE SUB_ID = C.SUB_ID1) AS SUBJECT_NAME1
    , (SELECT SUB_NAME
    FROM SUBJECTS
    WHERE SUB_ID = C.SUB_ID2) AS SUBJECT_NAME2
    , (SELECT SUB_NAME
    FROM SUBJECTS
    WHERE SUB_ID = C.SUB_ID3) AS SUBJECT_NAME3
    , (SELECT SUB_NAME
    FROM SUBJECTS
    WHERE SUB_ID = C.SUB_ID4) AS SUBJECT_NAME4
    FROM COMBINATION C;
    As you need exactly 4 subjects, the columns-solution is just fine I would say.

  • Getting errors while writing to a BLOB column using PrepareStatement

    Hello,
    I am getting the following errors when I am trying to insert in a BLOB in the oracle 9i database:
    java.sql.SQLException: ORA-00604: error occurred at recursive SQL level 1 ORA-06502: PL/SQL: numeric or value error ORA-06512: at line 205 ORA-22297: warning: Open LOBs exist at transaction commit time
    It gets inserted into the BLOB column correctly even after throwing exception.I am using the following code:
    String outputXML = outputXML //Some huge string having a length of 52k
    String pKey = "DATA-WORKATTACH-URL MELLONFINCORP-GSS-CPG E-444!20061130T211932.030 GMT";
    String createDateTime = "20061212T145931.448 GMT";
    String createOpName = "Haque, Nadeem";
    String createOperator = "ADCDTB6";
    String createSystemID = "WFE";
    String insName = "TESt INS";
    String objClass = "Data-WorkAttach-Note";
    String updateDateTime = "20061207T191900.510 GMT";
    String updateOpName = "Haque, Nadeem";
    String updateOperator = "ADCDTB6";
    String updateSystemID = "WFE";
    String label = "This is a test for label";
    String attachDate = "20061207T191900.510 GMT";
    String attachedBy = "Nadeem";
    String attachName = "Nadeem Haque";
    String note = "This is a test note";
    String refObjectKey = "E-438!20061130T211932.030";
    String replicationDate = "20061207T191900.510 GMT";
    try{
    java.sql.PreparedStatement pstmt = null;
    java.sql.Statement stmt = null;
    java.io.OutputStream tempBlobOStream = null;
    oracle.sql.BLOB tempBlob = null;
    javax.naming.Context ctx = new javax.naming.InitialContext();
    tools.findPage("tempWorkPage").putString ("testctx", ctx.toString());     
    javax.sql.DataSource ds = (javax.sql.DataSource)ctx.lookup("jdbc/gswWorkflowReportingData");
    tools.findPage("tempWorkPage").putString ("testds", ds.toString());
    java.sql.Connection conn = ds.getConnection();
    tools.findPage("tempWorkPage").putString ("testconn", conn.toString());
    java.sql.ResultSet lobDetails = null;
         try{
              byte [] ba = outputXML.getBytes();
              String query = "INSERT INTO GSW06U.pc_data_workattach(PZINSKEY,PXCREATEDATETIME,ATTACHDATE,PXUPDATEDATETIME,PXCREATEOPNAME,PXCREATEOPERATOR,PXCREATESYSTEMID,PXINSNAME,PXOBJCLASS,PXUPDATEOPNAME,PXUPDATEOPERATOR,PXUPDATESYSTEMID,PYLABEL,ATTACHEDBY,ATTACHNAME,NOTE,REFOBJECTKEY,ATTACHSTREAM) values(?,to_date(concat(substr(?,1,8),substr(?,10,6)),'YYYYMMDDHH24MISS'),to_date(concat(substr(?,1,8),substr(?,10,6)),'YYYYMMDDHH24MISS'),to_date(concat(substr(?,1,8),substr(?,10,6)),'YYYYMMDDHH24MISS'),?,?,?,?,?,?,?,?,?,?,?,?,?,EMPTY_BLOB())";
              tools.findPage("tempWorkPage").putString ("query", query);
              pstmt = conn.prepareStatement(query);
              pstmt.setString(1, pKey); // Bind PZINSKEY
              pstmt.setString(2, createDateTime); // Bind PZINSKEY
              pstmt.setString(3, createDateTime);
              pstmt.setString(4, attachDate);
              pstmt.setString(5, attachDate);
              pstmt.setString(6, updateDateTime);
              pstmt.setString(7, updateDateTime);
              pstmt.setString(8, createOpName);
              pstmt.setString(9, createOperator);
              pstmt.setString(10, createSystemID);
              pstmt.setString(11, insName);
              pstmt.setString(12, objClass);
              pstmt.setString(13, updateOpName);
              pstmt.setString(14, updateOperator);
              pstmt.setString(15, updateSystemID);
              pstmt.setString(16, label);
              pstmt.setString(17, attachedBy);
              pstmt.setString(18, attachName);
              pstmt.setString(19, note);
              pstmt.setString(20, refObjectKey);
              pstmt.execute(); // Execute SQL statement
              // Retrieve the row just inserted, and lock it for insertion of the LOB columns
              stmt = conn.createStatement();
              lobDetails = stmt.executeQuery("SELECT AttachStream FROM GSW06U.pc_data_workattach WHERE PZINSKEY = '" + pKey + "' FOR UPDATE");
              tools.findPage("tempWorkPage").putString ("idvalue", pKey);
              // Retrieve Blob streams for AttachStream column and load the sample XML
              if( lobDetails.next()) {
              //Get the CLOB from the resultset
              tempBlob = (oracle.sql.BLOB)lobDetails.getBlob(1);
              tools.findPage("tempWorkPage").putString ("pos1", "at pos1");
              // Open the temporary CLOB in readwrite mode, to enable writing
              tempBlob.open(oracle.sql.BLOB.MODE_READWRITE);
              tools.findPage("tempWorkPage").putString ("pos2", "at pos2");
              // Get the output stream to write
              tempBlobOStream = tempBlob.getBinaryOutputStream();
              tools.findPage("tempWorkPage").putString ("pos3", "at pos3");
              // Write the data into the temporary CLOB from the byte array
              tempBlobOStream.write(ba);
              // Flush and close the stream
              tempBlobOStream.flush();
              conn.commit();
              //Close everything
    tempBlobOStream.close();
              tempBlobOStream = null;
              tempBlob.close();
              tempBlob =null;
              lobDetails.close();
              lobDetails = null;
              stmt.close();
              stmt = null;
              pstmt.close();
              pstmt = null;
              conn.close(); // Return to connection pool
              conn = null; // Make sure we don't close it twice
         catch(java.sql.SQLException sqlexp) {
                   tempBlob.freeTemporary();
                   sqlexp.printStackTrace();
                   tools.findPage("tempWorkPage").putString ("SQLException", sqlexp.toString());
         catch(java.lang.Exception exp) {
                   tempBlob.freeTemporary();
                   tools.findPage("tempWorkPage").putString ("InnerException", exp.toString());
                   exp.printStackTrace();
         finally
              if (lobDetails != null) {
              try { lobDetails.close(); } catch (java.sql.SQLException e) { System.out.println(" Error while Freeing Result sets" + e.toString()); }
              lobDetails = null;
              if (stmt != null) {
              try { stmt.close(); } catch (java.sql.SQLException e) {System.out.println(" Error while Freeing java Statement" + e.toString()); }
              stmt = null;
              if (pstmt != null) {
              try { pstmt.close(); } catch (java.sql.SQLException e) {System.out.println(" Error while Freeing java PrepareStatement" + e.toString()); }
              pstmt = null;
              try{
              if (tempBlob != null) {
         // If the BLOB is open, close it
         if (tempBlob.isOpen()) {
         tempBlob.close();
         // Free the memory used by this BLOB
         tempBlob.freeTemporary();
              tempBlob = null;
              catch (Exception ex) { // Trap errors
              System.out.println(" Error while Freeing LOBs : " + ex.toString());
              if (conn != null) {
              try { conn.close(); } catch (java.sql.SQLException e) { System.out.println(" Error while Freeing Connection" + e.toString()); }
              conn = null;
    catch(java.lang.Exception e)
         tools.findPage("tempWorkPage").putString ("LangException", e.toString());
         e.printStackTrace();
    }

    Hello,
    I am getting the following errors when I am trying to
    insert in a BLOB in the oracle 9i database:
    java.sql.SQLException: ORA-00604: error occurred
    at recursive SQL level 1 ORA-06502: PL/SQL: numeric
    or value error ORA-06512: at line 205 ORA-22297:
    warning: Open LOBs exist at transaction commit
    time
    You're doing exactly what the error says, that is committing with an open LOB. Look at the following piece of code: you write in the LOB, you flush it and then commit. There is no closing of the LOB stream before committing.
    Try putting the tempBlobOStream.close() instruction before the commit.
    // Write the data into the temporary CLOB from the
    he byte array
              tempBlobOStream.write(ba);
              // Flush and close the stream
              tempBlobOStream.flush();
    nn.commit();
              //Close everything
    tempBlobOStream.close();

  • How to configure my Firefox thus allowing me to input Chinese characters into the search box by using PenPower writing pad while this problem doesn't exist when I am using Internet Explorer?

    I am using the electronic writing pad made by PENPOWER Inc. to input Chinese characters onto my PC programs (e.g. Winword, Internet Explorer, Excel, etc.) But I can not make it happened on Firefox, please advice what I have to do with the configuration of the Firefox or using any other method to make it work. Thanking you guys in advance for helping me to solve this problem.

    cor-el,
    Thank you very much for your advice. The new software of Penpower works rightaway after I installed it on my pc. Thanks again.
    十分感激你的幫忙!

  • Error reading/writing file "com.garageband.cs":`≤Ć». message

    Hey all! Don't know if anyone can help but I keep getting the message...
    " Error reading/writing file "com.garageband.cs":`≤Ć». " with a cancel button.
    If you click on it it does go away, but after a time playback starts skipping and stuff.
    Anyone help please?
    Thanks
    Righini

    first two things to try for “oddball” probs:
    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)

  • Error reading/writing file message when opening garageband and/or files

    I've been recently getting this message when I open garageband and files
    "Error reading/writing file\U201Ccom.apple.garageband.cs\U201D
    I've been in and repaired disk permissions and all that it says it is all fine, reinstall garageband and message still comes up, weird.
    not only is garageband being a nuisance, Mac OS X 10.6.2 is being a pain when shutting down telling me to restart the computer. This only happened since upgrading to 10.6. No one as yet knows this promble so I'm gonna have to ring apple and see what is going on here.
    and also my other problem is that mac doesn't seem as snappy anymore I noticed this before upgrading to 10.6 and made no difference when "cleanly" installing 10.6. I get a colour wheel popping up and i'm having to wait with simple tasks. iMac only 2 years old.

    i give up with this discussion forum no no one knows anything

  • Need Help in writing a UDF

    Hi,
    Please help in writing a UDF for these fields in mapping, which I need for the object Iu2019m doing currently.
    The fields are like this:
    1)         batch_no = "TRUNC((GetMaxObjid('x_txn_sap_parts')-POWER(2,28))/5000)+1",
    2)         lot_id = "TRUNC((GetMaxObjid('x_txn_sap_parts')-POWER(2,28))/500)+1",
    3)        How to use JDBC connection factory class in the UDF.
    Some logic I can provide which I know i.e. Power (2, 28) means 2 to the power of 28 (2 multiplied 28 times), Trunc means truncate, X_TXN_SAP_Parts is a database table.The Target fields are Batch_no, lot_id & Objid.Actually, objid is mapped initially to a source field i.e. Object ID and in this function it is only being used for the calculation of the batch_no.
    Thanks in Advance,
    Sreedhar.

    Hi,
    Following with my query I've tried to use this code but still I'm unable to execute the mapping.
    import java.util.*;
    import com.sap.aii.mapping.lookup.*;
    import com.sap.aii.mapping.lookup.*;
    DataBaseAccessor accessor = null;
    DataBaseResult JDBCOutPayload = null;
    String BusinessSystem="clarify_dev_bizsys";
    //give your business system having channel name
    String CommunicationChannel="JDBC_TO_CDEV";
    //give your channel name
    String InputPayload= " select X_TXN_PRE_SITE_XFACE.nextval from dual;";
    //give your sql query
    try {
    Channel channel =
    LookupService.getChannel(BusinessSystem,CommunicationChannel);
    accessor = LookupService.getDataBaseAccessor(channel);     
    DataBaseResult resultSet = accessor.execute(InputPayload);
         for(Iterator rows = resultSet.getRows();rows.hasNext();){  
         Map rowMap = (Map)rows.next();
         Object cValue = rowMap.get("batchno");
    //field name of field required , as in database
          catch (Exception e) {}
          finally {
                  if (accessor != null)
                  accessor.close();
           result.addValue((String)cValue);
    --> I don't know what are the parameters to be used and how to be used in the UDF because this is the first time I'm writing a UDF.
    --> The problem in using this query is that both OBJID & BatchNo. are on the target side and the value for the OBJID is retrieved by a SELECT query from the database.
    Kindly help me how to resolve this query of mine.
    Thanks in Advance.
    Sreedhar.

  • Reading the Blob and writing it to an external file in an xml tree format

    Hi,
    We have a table by name clarity_response_log and content of the column(Response_file) is BLOB and we have xml file or xml content in that column. Most probably the column or table may be having more than 5 records and hence we need to read the corresponding blob content and write to an external file.
    CREATE TABLE CLARITY_RESPONSE_LOG
      REQUEST_CODE   NUMBER,
      RESPONSE_FILE  BLOB,
      DATE_CRATED    DATE                           NOT NULL,
      CREATED_BY     NUMBER                         NOT NULL,
      UPDATED_BY     NUMBER                         DEFAULT 1,
      DATE_UPDATED   VARCHAR2(20 BYTE)              DEFAULT SYSDATE
    )The xml content in the insert statement is very small because of some reason and cannot be made public and indeed we have a very big xml file stored in the BLOB column or Response_File column
    Insert into CLARITY_RESPONSE_LOG
       (REQUEST_CODE, RESPONSE_FILE, DATE_CRATED, CREATED_BY, UPDATED_BY, DATE_UPDATED)
    Values
       (5, '<?xml version="1.0" encoding="UTF-8"?><xml-response><phone-number>1212121212</tracking-number></xml-response>', TO_DATE('09/23/2010 09:01:34', 'MM/DD/YYYY HH24:MI:SS'), 1, 1, '23-SEP-10');
    Insert into CLARITY_RESPONSE_LOG
       (REQUEST_CODE, RESPONSE_FILE, DATE_CRATED, CREATED_BY, UPDATED_BY, DATE_UPDATED)
    Values
       (6, '<?xml version="1.0" encoding="UTF-8"?><xml-response><phone-number>1212121212</tracking-number></xml-response>', TO_DATE('09/23/2010 09:01:34', 'MM/DD/YYYY HH24:MI:SS'), 1, 1, '23-SEP-10');
    Insert into CLARITY_RESPONSE_LOG
       (REQUEST_CODE, RESPONSE_FILE, DATE_CRATED, CREATED_BY, UPDATED_BY, DATE_UPDATED)
    Values
       (7, '<?xml version="1.0" encoding="UTF-8"?><xml-response><phone-number>1212121212</tracking-number></xml-response>', TO_DATE('09/23/2010 09:01:34', 'MM/DD/YYYY HH24:MI:SS'), 1, 1, '23-SEP-10');
    Insert into CLARITY_RESPONSE_LOG
       (REQUEST_CODE, RESPONSE_FILE, DATE_CRATED, CREATED_BY, UPDATED_BY, DATE_UPDATED)
    Values
       (8, '<?xml version="1.0" encoding="UTF-8"?><xml-response><phone-number>1212121212</tracking-number></xml-response>', TO_DATE('09/23/2010 09:01:34', 'MM/DD/YYYY HH24:MI:SS'), 1, 1, '23-SEP-10');
    Insert into CLARITY_RESPONSE_LOG
       (REQUEST_CODE, RESPONSE_FILE, DATE_CRATED, CREATED_BY, UPDATED_BY, DATE_UPDATED)
    Values
       (9, '<?xml version="1.0" encoding="UTF-8"?><xml-response><phone-number>1212121212</tracking-number></xml-response>', TO_DATE('09/23/2010 09:01:34', 'MM/DD/YYYY HH24:MI:SS'), 1, 1, '23-SEP-10');THe corresponding proc for reading the data and writing the data to an external file goes something like this
    SET serveroutput ON
    DECLARE
       vstart     NUMBER             := 1;
       bytelen    NUMBER             := 32000;
       len        NUMBER;
       my_vr      RAW (32000);
       x          NUMBER;
       l_output   UTL_FILE.FILE_TYPE;
    BEGIN
    -- define output directory
       l_output :=
          UTL_FILE.FOPEN ('CWFSTORE_RESPONCE_XML', 'extract500.txt', 'wb', 32760);
       vstart := 1;
       bytelen := 32000;
    ---get the Blob locator
       FOR rec IN (SELECT response_file vblob
                     FROM clarity_response_log
                    WHERE TRUNC (date_crated) = TRUNC (SYSDATE - 1))
       LOOP
    --get length of the blob
    len := DBMS_LOB.getlength (rec.vblob);
          DBMS_OUTPUT.PUT_LINE (len);
          x := len;
    ---- If small enough for a single write
    IF len < 32760
          THEN
             UTL_FILE.put_raw (l_output, rec.vblob);
             UTL_FILE.FFLUSH (l_output);
          ELSE  
    -------- write in pieces
             vstart := 1;
             WHILE vstart < len AND bytelen > 0
             LOOP
                DBMS_LOB.READ (rec.vblob, bytelen, vstart, my_vr);
                UTL_FILE.put_raw (l_output, my_vr);
                UTL_FILE.FFLUSH (l_output);
    ---------------- set the start position for the next cut
                vstart := vstart + bytelen;
    ---------- set the end position if less than 32000 bytes
                x := x - bytelen;
                IF x < 32000
                THEN
                   bytelen := x;
                END IF;
                UTL_FILE.NEW_LINE (l_output);
             END LOOP;
    ----------------- --- UTL_FILE.NEW_LINE(l_output);
          END IF;
       END LOOP;
       UTL_FILE.FCLOSE (l_output);
    END;The above code works well and all the records or xml contents are being written simultaneously adjacent to each other but we each records must be written to a new line or there must be a line gap or a blank line between any two records
    the code which I get is as follow all all xml data comes on a single line
    <?xml version="1.0" encoding="ISO-8859-1"?><emp><empno>7369</empno><ename>James</ename><job>Manager</job><salary>1000</salary></emp><?xml version="1.0" encoding="ISO-8859-1"?><emp><empno>7370</empno><ename>charles</ename><job>President</job><salary>500</salary></emp>But the code written to an external file has to be something like this.
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <emp>
      <empno>7369</empno>
      <ename>James</ename>
      <job>Manager</job>
      <salary>1000</salary>
    </emp>
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <emp>
    <empno>7370</empno>
    <ename>charles</ename>
    <job>President</job>
    <salary>500</salary>
    </emp>Please advice

    What was wrong with the previous answers given on your other thread:
    Export Blob data to text file(-29285-ORA-29285: file write error)
    If there's a continuing issue, stay with the same thread, don't just ask the same question again and again, it's really Pi**es people off and causes confusion as not everyone will be familiar with what answers you've already had. You're just wasting people's time by doing that.
    As already mentioned before, convert your BLOB to a CLOB and then to XMLTYPE where it can be treated as XML and written out to file in a variety of ways including the way I showed you on the other thread.
    You really seem to be struggling to get the worst possible way to work.

Maybe you are looking for

  • Adobe Premiere begins to open and then immediately closes.

    I installed Adobe Premiere CS6 through Creative Cloud. Everytime I attempt to open the program, it begins to loads and as soon as the program opens it closes. I have a brand new HP Pavillion dv7 w/ a Quad core processor, 8 GB of Ram, & an AMD Radeon

  • I have updated to iOS 6. All my files were lost. Help!

    Hello Fine Gentlemen! I am sorry to borrow your time, but this problem has made me mad recently. I have an iPad 3rd Gen, which I could no update (somehow) with the iPad itself. The same with my Mac. I kept getting error messages (although no code tho

  • Q10 USB not detected in Link or Blend

    Q10 SQN100-3 Rogers OS 10.3.1.1.1581 Link 1.2.4.27 Connects wirelessly by default when Link first installed.  Blackberry Device manager shows Y and Z drives. When wireless connections turned off in Link or turned off at device and USB connected: Wind

  • N9 AFTER FIRMWARE PR1.1 UPDATE

    Hi guys, would anyone of you out there want to share with me your experience after your N9 has been updated with PR1.1? (As of now PR1.1 is still not available in Malaysia) Like is it now a better phone than before? I'm still emotionally attached wit

  • Option GX0301 HSDPA/HSUPA PCMCIA Card

    Hello I really can not understand the problem that i have since yesterday. Yesterday it worked like a charm and now it only generates kernel traces. I have not updated my system/kernel or so, changed nothing on my system. Today i tested the git-kerne