OCCI Clob.write problem

hi
i am new to occi
i have tested my application and insert data to my tables ;
I have a field in my table which its type is clob and a procedure for inserting in that table
when i test procedure with stmt.setString (for the clob field) I have no problem for inserting
but when using stmt->setClob , there is exception ora-22275
my code is like this:
Clob C(conn);
C.setEmpty();
C.write(4,"test",4);
stmt->setClob(1,C);
stmt->executeUpdate();
whats wrong?
error message is about problem in occi::clob::write

Hi,
Because LOBs use what are known as locators, you can't just create the clob in client code like that and insert it into the database.
The database won't "know about" the locator and will raise the ORA-22275 error (as you have discovered).
What you need to do is initialize the clob as noted in the Clob Class documentation notes. See here for example:
http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28390/reference009.htm#i1118691
An uninitialized CLOB object can be initialized by:
* The setEmpty() method. The CLOB can then be modified by inserting this CLOB into the table and retrieving it using SELECT ... FOR UPDATE....
< emphasis added >
So, essentially, you set the clob to empty, insert it into the table, then using "select for update" you get the clob (locator) back. You need to use "select for update" and not just a regular select. You can then modify the empty clob (be sure to commit when done).
For an example of this, see the Oracle 10g Release 1 Demos from here:
http://www.oracle.com/technology/sample_code/tech/occi/index.html
Regards,
Mark

Similar Messages

  • JDBC CLOB WRITER

    I do not know how to setup a Clob Writer - what is wrong with the following approach? (I'm getting a null pointeer exception?)
    - Tor
              Clob xmlClob = null;
              try {
                   db.open();
                   Connection c = db.getDbConnection();
                   ResultSet r = db
                             .sqlSELECT("select slm_xml_doc from slm for update ");
                   r.next();
                   ResultSetMetaData md = r.getMetaData();
                   System.out.println(" Col#: " + (1) + " Attribute: "
                             + md.getColumnName(1) + " DT: "
                             + md.getColumnTypeName(1));
                   Clob xmlclob = r.getClob(1);
              } catch (Exception s) {
                   System.out.println("DB or Clob Error: " + s.getMessage());
              try {
                   Writer writer = xmlClob.setCharacterStream(0);
              } catch (Exception s) {
                   System.out.println("Writer Error: " + s.getMessage());
    Output from unit test:
    INFO -Database connection is: oracle.jdbc.driver.T4CConnection@1172e08 (com.tor.sdmds.utilities.Database)
    Col#: 1 Attribute: SLM_XML_DOC DT: CLOB
    Writer Error: null

    FIXED - typo! Tor

  • Insert CLOB values problem with 9.2 drivers and not with 10

    Hi
    We are using Oracle 9.2.0.5. We need to insert values bigger than 4000bytes using thin connection, so we've decided to use CLOB fields. With the 9.2.0.5 driver we can't do it, obtaining the classical exception explaining the data is bigger than the supported size but with the 10g driver (and, of course, same java code) it worked. The problem is that we want to mantain the equivalence between the database and driver not using the 10g driver with the 9.2.0.5 version of the db.
    Here it's the test code we've used:
    Data generation:     
              String data = "";
              Random rnd = new Random();
              long cont = 10000;
              while (cont > 0){               
                   int result = rnd.nextInt(255);
                   data = data + result;
                   cont--;
              Integer id = new Integer(2);
    Data insertion:
                   String queryString="INSERT INTO TMP_BUG_ORACLE (ID, VALOR) VALUES (?,?)";
                   preparedStatement = connection.prepareStatement(queryString);
                   preparedStatement.setInt(1,1);
                   preparedStatement.setString(2,this.datos);
                   int numero = preparedStatement.executeUpdate();               
                   System.out.println("Items inserted: " + numero);
                   preparedStatement.close();
                   connection.close();
    Table structure
         Name:          Type:
         ID           NUMBER
         VALOR      CLOB
    Response (only with 9.2.0.5 driver):
    java.sql.SQLException: El tamaño de los datos es mayor que el tamaño máximo para este tipo: 25708 (Data size is bigger than the maximum for this type: 25708)
    Thank you very much for all

    Hi,
    I had exactly the same problem. on Oracle 9.2 I wanted to insert a template file bigger than 4K. with the ojdbc14.jar from Oracle 9.2 it was not possible.
    What I did was this:
    I have used a JDBCwrapper to fix this issue. I can send it to you, if you send me your email.
    When I use the ojdbc14.jar from Oracle 10, I cannot insert a bigger file.
    How did you code your programm to insert big size data into a CLOB field with ojdbc14.jar driver from 10?
    thank you for your response

  • New Mac with major permission and disk-write problems

    Right, so I'm pretty new to Mac, after getting my first Mac computer (a 17-inch MacBook Pro) at the end of January this year. It's been great so far and I love the thing, but I've suddenly encountered some crazy problems which I'm pulling my hair out over because I have tried everything to fix them, and have had no luck.
    I'll try to include as many details as possible, and I'm prepared to bear with anyone who asks me about something I've alrady tried, just so I can get this sorted.
    Okay, so first of all, the main problem seems to be with permissions, mostly with disk-write permissions. Any apps that I want to install that required keychain access will no longer install. I enter my keychain password, hit Return, and the dialog box closes without continuing. So I hit "Install" again and it becomes a never-ending cycle of entering my password to no avail. Now, this happens with ANY application that requires keychain access to install. It is not limited to any particular application. I know my password is right because the box closes, and if I enter it wrong, the dialog box shakes because it is incorrect.
    Furthermore, it seems keychain access is problematic in other apps. If I want to authenticate something, it will do the same thing as I mentioned before, meaning I get nowhere with the application.
    From here, it gets worse. If I download something (anything), then restart my computer, it is still there. As it should be. However, if I delete an APPLICATION (not just any file) OR change preferences for some programs (one in particular that I specifically don't want starting up on.... startup), including through System Preferences>Users & Groups>Login Items, they will not save. This is driving me insane. For instance, I downloaded some free apps from the Mac App Store to try out, but decided I didn't want them. I tried to deleted them from the app folder and succeeded. Emptied trash. Gone. Restart, and.... they're back? So I tried to uninstall them via the Mac App Store, once I found you could do that. Again, it didn't work. Any Login Items preference changes don't stay after a restart.
    Originally, none of this was a problem and everything was working fine. The first sign that something was wrong would be Apple Mail often asking for passwords, usually for my Hotmail accounts, saying that they were rejected by the server (but are correct passwords, I get the emails from the accounts, and the passwords are always accepted once I type them in, only to be asked for them some time later on for no apparent reason). At the time, I tried to repair the keychain, tried deleting and recreating the mail account entries and what not, but nothing helped. It still happens, but at the time, it was more of a niggly thing than an outright problem.
    I should also mention that I did use BootCamp to install Windows 8 on a small partition, but after I couldn't boot back into Mac (I didn't realise you had to use the Option key whilst booting), I found out that you had to hold the Option key to get back into Mac, then used BootCamp to get rid of Windows. Everything was fine so far. Until I decided to reinstall Windows 8 with BootCamp. This is where things started going wrong. I decided to install a bootloader to make it easier for me to boot between the two systems. I was tossing up between rEFIt and Chameleon, and decided that rEFIt would be the best for my needs. So I downloaded and installed it, which seemed to go fine. Until I restarted. Mac would endlessly load (the spinning grey dots with the Apple logo).
    Now, I actually managed to fix this, but I should probably go into more detail. First of all, holding the option key and selecting my Mac partition would allow me back into Mac, and same with Windows 8. At this point, I decided to uninstall Windows 8 to try fix my problems, except now BootCamp was giving me errors. I believe it was something about being unable to unmount the disc, but it may have been a different error. I don't entirely remember. So then I decided to try getting rid of rEFIt. I followed the instructions on the official site but it didn't work. So then I tried deleting the files with root (sudo) access through terminal. Which also failed....
    So to the Recovery partition. Booting into Disk Utilities, I repaired permissions, which worked fine, and repaired the disk. I believe I had run the disk repair a few times before to try to fix BootCamp when it stopped working. Anywaym it had worked before, but this time, it said that it was corrupted and could not be repaired. Something about needing to reinstall Mac OS X. With all my files on this computer and currently nothing to back it up with (eventually I will have something to do backups with, but it'll have to wait a few months), I'm not going to do that.
    Finally, I managed to delete the rEFIt files through Terminal within the Recovery partition. I ran permission repair and disk repair again to clean anything up. Disk repair gave me the same error, but now I could get back into Mac without holding the option key on every **** boot.
    Now more problems had presented themselves. I decided that the lock under Login Items was probably preventing me form successfully changing my startup items. Trying to unlock it did the same thing as I previously mentioned. Type in my password, keychain accepts it, then nothing happens. The keychain settings were already defaulted so that keychain would stay unlocked after authenticated, and all stuff like that. Using "Get Info" on anything has permissions locked and again, I cannot unlock to change them, although looking at a PDF file just now, whilst still locked, it would allow me to add or remove users, so maybe that's not completely accurate. I believe I tended to look at the system folders though, and my name wasn't under ownership, although I don't believe it was meant to be, but I was hoping that maybe that would fix the problem. I guess not.
    At this time, I still had my Windows 8 partition sitting around and couldn't get rid of it. I heard of the manual way to do it through Disk Utility. I tried this in Mac OS X, and through the Recovery partition, but neither worked. An error about being unable to unmount the drive. I finally found a way to remove it. Honestly, I don't completely remember how I did it, but I believe it was through a command line, uh.... command. Now I had free space that I couldn't use to expand my Macintosh HD partition back to full size, again with the unable to unmount error. Finally, I fixed this by booting from a Mac OS X installation disc that I happened to have, and using Disk Utility off of that. After that, Disk Utility no longer gave me errors for disk repair.
    However, my other problems all still remained. I had written a little list of things I found on the internet for fixing my problems. One solution was to use "resetpassword" through terminal under the Recovery partition, then select Macintosh HD and select "Reset Home Directory Permissions and ACLs". That didn't work until I tried it through the Disk Utility on the Mac OS X installation disc. That worked, and once I was back into Mac, Spotlight started indexing again. However, nothing else had happened.
    I should also mention that keychain access isn't completely non-existent for me. Setting up a new WiFi connection worked for me (that is, connecting to a new network), but now every time I connect to the network, I have to authenticate it. However, it does accept my keychain password and eventually connect.
    Now, another thing on my list to try was single-user mode, and using "/sbin/fsck -fy" until everything was okay. Well, the first time, it found a bunch of errors, then fixed itself up. Then it was all okay. But nothing had changed. So trying again, I this time used ?/sbin/mount -uw /" which I believe is meant to allow writing access to the drive. Now when running "/sbin/fsck -fy", I had an error. Specifically, "Journal need to be replayed but volume is read-only".
    So that's pretty much where I am up to at the moment. It seems to be a poblem with write permissions, possibly among other things. If it was Windows, I might be able to work it out easier, but being new to Mac, I'm still finding my way around. I guess this is a good learning experience, but it's not fun to have to deal with it so early on.
    If anyone can help me, I'd greatly appreciate it. I have tried many things, so if you suggest something that I have tried and possibly forgot to mention, I'll let you know, but any help is still helpful, even if only eliminating possible problems/causes/solutions.

    Actually you first post is so long that most people just glance at it and move on. To say the least you are very verbose.
    Your problem stems from something going wrong with permissions, as you know. How and why that happen is usually a user error of some type.
    You can try to repair permissions and see if that corrects it. If not I will leave other options to someone that may know more about the permission system on a Mac.

  • Windows 2008 R2 Folder assign permission "Read and Write" problem with *.doc file

    Hello All,
    I am a new one here,
    I am sorry for any mistakes and also my english is so poor.
    M Brother company runing Windows 2008 R2 as Active Directory...
    We have folder Name: Admin
    and in this folder, there are alot documents files as : *.doc, *.dwg, *.txt etc.....
    All user accesing to these files and they can open to edit and save...
    One day my brother want me to set Admin folder for all users just"Read and Write.." mean they still can open files to edit and save... but can't delete..
    I did success with this..
    But only one thing happen.. when they open *.doc file to edit and attempting to save, the message alert" access denide " and they can only "SAVE AS"...We don't want "Save as"
    Could you show me how can we fix error with *.doc file while they trying to save? because it allow only save as.. but other files as *.text file or *.dwg they can save without problem..
    Could expert here ever face this issues and fix by yourself, please share me with this..
    Please help me..
    Best regards,

    Hi,
    Office programs are specific. They will create a temp file when edit, then the temp file will be deleted when close. So Delete permission is needed for users to saving Office files like Excel/Word.
    For more detaile information, please refer to the thread below:
    Special Permissions - User cannot save files
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/721fb2f1-205b-46e5-a3dc-3029e5df9b5b/special-permissions-user-cannot-save-files
    Best Regards,
    Mandy 
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • Soap Attachment write problem

    Hello All,
    I'm seeing the error message given below. I'd been trying to write a soap attachment to a file output stream. I did the same thing in WSAD and it worked. But when I tried to work on unix box.. it wasnt supporting activation.jar and mail.jar resulting the error below. I'm urgently in need of help. Please help me. [java] at javax.activation.ObjectDataContentHandler.writeTo(Unknown Source)
    [java] at javax.activation.DataHandler.writeTo(Unknown Source)
    [java] at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1147) [java] at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:668)
    [java] at javax.mail.internet.MimeMultipart.writeTo(MimeMultipart.java:233) [java] at weblogic.webservice.core.soap.SOAPMessageImpl.writeMimeMessage(SOAPMessageImpl.java:589) [java] at weblogic.webservice.core.soap.SOAPMessageImpl.writeTo(SOAPMessageImpl.java:513) [java] at
    I think there is a problem with the activation.jar and mail.jar.
    Please let me know about this problem if you have any idea since it is very urgent.
    I'm using Weblogic server which is on the solaris box and it is not supporting the activation.jar and mail.jar. The same worked on WSAD.
    Please advise.
    Thanks in advance,
    Vamshi

    Hi Hasan,
      Please, try to implement next xslt mapping before message mapping.
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:stylesheet version="1.0" xmlns:ns0="http://www.w3.org/1999/XSL/Transform" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:ns2="https://onlineservice.creditreform.de/webservice/0400-0005">
       <ns0:template match="node() | @*">
          <ns0:copy>
             <ns0:apply-templates select="node() | @*"/>
          </ns0:copy>
       </ns0:template>
       <ns0:template match="xop:Include"/>
    </ns0:stylesheet>
    Regards, Dzmitry

  • Visa write problem

    hello,
    I am trying to control a Coherent Cube laser with labview 8.0 (RS232)
    I always get the response 'invalid cmd' from the laser.
    There is a software furnished by Coherent which works without any problem.
    I monitored the datas sent by this software and labview through the serial port but I did not notice any difference.
    Have you got an idea? (the baud rates is well configured)

    Hi,
    So your query works but your command doesn't, is this correct?
    (Query being the string which starts with ? eg "?S".      Command being "Command=<value>" eg CW=1)
    If this is correct then you haven't got a problem with your Write because the Query has to seed the "?..." charaters before you can perform the Read.
    Therefore the problem is on the exact syntax of the command string. There can't be any spaces between the command, the = and the <value> ie CW=1 not CW = 1.0.
    Hope this helps
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • Dvd writer problem

    my dvd writer fails to write dvd but can write cd.
    what is the problem

    Hi,
    Welcome to the HP Forum!
    Abhishek1996 wrote:
    my dvd writer fails to write dvd but can write cd.
    what is the problem
    Please identify your notebook/pc .
    Look at the base/rear/side of the notebook/pc at the barcoded sticker.
    Post item number 2 as seen on the following example of an HP notebook's barcoded sticker. The barcode on your HP product may be slightly different in appearance, but will still have the important information needed for us to help you.  
    ###Do not post the serial number of your product as it is personal information.###
    Post the installed operating system version (state whether it is 32 or 64-bit ) and the CPU as an AMD or Intel product
    Not posting all of the information as requested will delay our responses and slow troubleshooting of the issue that led you to author a thread.
    Is your notebook/PC still within its warranty period?
    Best regards,
    erico
    Kind regards,
    erico
    ****Please click on Accept As Solution if a suggestion solves your problem. It helps others facing the same problem to find a solution easily****
    2015 Microsoft MVP - Windows Experience Consumer

  • DVD Write problem

    I have previously burned DVD's on my Computer with no problem. Today I tried to burn a DVD and I've gone through 5 DVD and keep getting the same error when the disc is about 60% done burning. This is what console shows:
    Finder: Burn started, Tue Feb 14 22:33:53 2006
    Finder: Burning to DVD-R media with DAO strategy in MATSHITA DVD-R UJ-815 D0CB via ATAPI.
    Finder: Requested burn speed was 1x, actual burn speed is 1x.
    Finder: Burn underrun protection is supported, and enabled.
    Finder: Burn failed, Tue Feb 14 22:59:20 2006
    Finder: Burn sense: 4/03/00 Hardware Error, Peripheral device write fault
    Finder: Burn error: 0x80020022 The device failed to respond properly, unable to recover or retry.
    I also noticed a strange scratchy noise while burning it does not do it any other time even when reading other discs. Is this a hardware problem? Is there a DVD drive replacement that will fit that I can buy third party and install myself?

    I just wanted to add that I tried CD burning and it works fine. No funny noises, no problem. I reset the PMU and tried DVD burning again. Still doesn't work. Still makes a funny noise while writing data to the disc.

  • HD read-write problems recording more of 16 audio tracks

    I've a strange problem that i don't have in digital performer with rosetta!
    When i record more of 5-6 track...for example 16...when i stop the registration....logic is blocked for 30-40 seconds....and then it begin to create overview!
    in this time i've see the hd read and write at 5 mb/sec....
    It isn't normal!!! I've tried all the settings of audio driver and buffer....but nothing change
    anybody can help me?!?
    p.s. sorry for my bad english!

    1 : Waht sample Rate are u using -
    2 : I have disk Journaling on and record @ 96KHZ - and can do 64 tracks simoultaneously (split on 4 drives)
    3 : Is your recording drive very fragmented if so defragment it
    4 : Dont EVER record to your system drive - too much activity going on there
    5 : Set your Max Recording time to 10 minutes in the "Set record path" dialog in Logic ( If you have not set the max rec. time Logic will "Freeze" all available space on the disk for the recording and that can lead to problems especially if u aint using a dedicated hard drive to wirte your audio to
    6 : it is very important to have a dedicated drive to record audio to - being an internal SATA or Firewire 400/800 - as long as this drive is being used to record only...This has solved many problems for me...

  • Multithread read write problem.

    This is a producer consumer problem in a multi-threaded environment.
    Assume that i have multiple consumer (Multiple read threads) and a
    single producer(write thread).
    I have a common data structure (say an int variable), being read and written into.
    The write to the data sturcture happens occasionally (say at every 2 secs) but read happens contineously.
    Since the read operation is contineous and done by multiple threads, making the read method synchronized will add
    overhead(i.e read operation by one thread should not block the other read threads). But when ever write happens by
    the write thread, that time the read operations should not be allowed.
    Any ideas how to achive this ??

    Clearly the consumer has to wait for a value to become available and then take it's own copy of that value before allowing any other thread to access it. If it doesn't copy the value then only one consumer can act at any time (since if another value could be added while the consumer thread was accessing the common value then the value would change, affecting the consumer at random).
    In general what you're doing is using a queue, even in the special case where the maximum number of items queued is restricted to one the logic is the same.

  • Occi::Number compilation problem in Linux

    Hi,
    I got following error when I complile my application which uses OCCI (Oracle C++ Call Interface) shiped with Oracle 9.2. I added the compiler flag -Dlint .
    When I dont add the compiler flag I dont get following error. My machine is running RedHat linux 7.3
    /usr/bin/g++ -c -I/opt/ora9/product/9.2/rdbms/demo -I/opt/ora9/product/9.2/rdbms/public -I/opt/ora9/product/9.2/plsql/public -I/opt/ora9/product/9.2/network/public myapp.cpp -g -Wall -DLiS -Dlint -DORACLE -I../include -DQT_THREAD_SUPPORT
    In file included from /opt/ora9/product/9.2/rdbms/demo/occi.h:40,
    from ../include/DatabaseSupport.h:17,
    from myapp.cpp:4:
    /opt/ora9/product/9.2/rdbms/demo/occiData.h:374: `oracle::occi::Number::Number (char)' has already been
    declared in `oracle::occi::Number'
    /opt/ora9/product/9.2/rdbms/demo/occiData.h:408: `oracle::occi::Number::operator char () const' has
    already been declared in `oracle::occi::Number'
    If I dont compile my application with -Dlint compiler flag I cant run the application.
    I think this is a bug in occi::Number class
    Any solusion??
    Thanking in advance
    nkran

    Your code is faulty and has to be fixed.
    No compilation problem is present, the compiler correctly barfs.
    As this is not a support forum, kindly keep your non-issues out of this forum.
    Thank you!!!
    Sybrand Bakker
    Senior Oracle DBA

  • Print Writer problem

    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.PrintStream;
    import java.util.ArrayList;
    import java.util.Scanner;
    import java.io.PrintWriter;
    public class QuestionAireMain {
         public static void main(String args[]) throws IOException{
              int inputQuestionnAireNum = 0;
              int inputPostCode = 0;
              int inputGender = 0;
              int inputAge = 0;
              int inputResponse = 0;
              int inputQuestionNum = 0;
              int x=0;
              Scanner input = new Scanner(System.in);
              PrintWriter p = new PrintWriter( new FileOutputStream("tryout.txt", true));
              ArrayList<QuestionTemplate> questionArr =new ArrayList<QuestionTemplate> ();
              int rangeStore[];
              System.out.print("Enter Number of Question to create [ ]");
              inputQuestionNum = Integer.parseInt(input.nextLine());
              do{
                   System.out.print("1 new entry or 0 print");
                   x = Integer.parseInt(input.nextLine());  
                   if(x == 1){
                        //Questionnaire Number
                        System.out.print("Enter Questionnaire Number [ ] ");
                        inputQuestionnAireNum = Integer.parseInt(input.nextLine());
                        //Postal code
                        System.out.print("Enter Postal Code [ ] ");     
                        inputPostCode = Integer.parseInt(input.nextLine());
                        //Age
                        System.out.print("Enter Age [ ] ");
                        inputAge = Integer.parseInt(input.nextLine());
                        //Gender
                        System.out.print("Enter Gender '1' for Male and '2' for for female [ ] ");
                        inputGender = Integer.parseInt(input.nextLine());
                        rangeStore = new int[5];
                        //Response input
                        for(int j = 0; j<inputQuestionNum; j++) {
                             System.out.print("Input Response for Question " +(j+1) +" [ ] ");     
                             inputResponse = Integer.parseInt(input.nextLine());
                             rangeStore[j] = inputResponse;                                             
                        }//for response
                        QuestionTemplate qObject = new QuestionTemplate(inputQuestionnAireNum, inputPostCode, inputAge, inputGender, inputQuestionNum, rangeStore);
                        questionArr.add(qObject);
                        p.write(qObject.toString());
                        p.close();
                             } else {
                                           System.out.println("test");
                           } while(x != 0);
    } //Constructor
    public class QuestionTemplate{
         int questionnAireNum = 0;
         int postCode = 0;
         int age = 0;
         int gender = 0;
         int numOfQues = 0;
         int [] rangeStore;
         public QuestionTemplate (int questionnAireNum,  int postCode, int age, int gender, int numOfQues , int rangeStore[]){
              this.questionnAireNum = questionnAireNum;
              this.postCode = postCode;
              this.age = age;
              this.gender = gender;
              this.rangeStore = rangeStore;
         }//public
              //Questionnaire Number
              public int getQuestionnAireNum(){
                   return questionnAireNum;
              public void setQuestionnAireNum(int questionnAireNum){
                   this.questionnAireNum = questionnAireNum;
              //Postal Code
              public int getPostCode(){
                   return postCode;
              public void setPostCode(int postCode){
                   this.postCode = postCode;
              //Age
              public int getAge(){
                   return age;
              public void setAge(int age){
                   this.age = age;
              //Gender
              public int getGender(){
                   return gender;
              public void setGender(int gender){
                   this.gender = gender;
              //Array of response
              public int [] getRangeStore(){
                   return rangeStore;
              public void setRangeStore(int [] rangeStore){
                   this.rangeStore = rangeStore;
              //Print toString method
              public String toString(){
                    StringBuilder result = new StringBuilder();
                       result.append(questionnAireNum+", ");
                       result.append(postCode+", ");
                       result.append(age+", ");
                       result.append(gender+", ");                  
                      for(int i =0;i<numOfQues; i++){          
                             result.append(rangeStore);
                             if(i != numOfQues-1){
                             result.append(", ");
                             }     else{
                                       result.append(".\n");
                   return result.toString();
    }//class
    Enter Number of Question to create [ ]3
    1 new entry or 0 print1
    Enter Questionnaire Number [ ] 2
    Enter Postal Code [ ] 3
    Enter Age [ ] 4
    Enter Gender '1' for Male and '2' for for female [ ] 3
    Input Response for Question 1 [ ] 2
    Input Response for Question 2 [ ] 3
    Input Response for Question 3 [ ] 4
    1 new entry or 0 print1
    Enter Questionnaire Number [ ] 2
    Enter Postal Code [ ] 3
    Enter Age [ ] 4
    Enter Gender '1' for Male and '2' for for female [ ] 6
    Input Response for Question 1 [ ] 5
    Input Response for Question 2 [ ] 4
    Input Response for Question 3 [ ] 3
    1 new entry or 0 print0tryout.txt
    2, 3, 4, 3, 2, 3, 4.
    hi i am facing a problem now. I only manage to print the first entry record but the second record seems to be ignored. when i comment out p.close(); it will not print to my txt file at all. what happen ???                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    TimTheEnchantor wrote:
    As soon as a PrintWriter is closed, you cannot write to it anymore (e.g. write method has no effect -> only the first record is written)
    If you don't close it, it might never be flushed (e.g. it might be that nothing is written)
    What you should do is close it at the right moment.
    Moreover, I would suggest that you clearly separate the "printing" part from the "recording" part.hi i have tired placing close at other areas and the moment i separate the printing part it can`t seems work either, i can`t figure out why?

  • CLOB.getAsciiStream problem in 11gR2 with temp CLOB internal JVM

    Hello,
    i have a problem with using a termporary CLOB in PL/SQL that is going to be written with Java Code that runs inside Oracle Database (Internal JVM). The code works without problem in Oracle 11g R1 (11.1.0.7.0) but does not with Oracle 11g R2 (12.2.0.1.0). The example follows:
    <b>Table Description:</b>
    NAME Null? Type
    ID NOT NULL NUMBER(*,0)
    FILE_TYPE NOT NULL NUMBER(*,0)
    INSERT_DATE NOT NULL DATE
    PROCESSED NOT NULL NUMBER(*,0)
    LFIELD001 CLOB(4000)
    BFIELD001 BLOB(4000)
    FILE_NAME VARCHAR2(4000)
    <b>PL/SQL Example Run:</b>
    DECLARE
    clb CLOB;
    p_result NUMBER; p_err VARCHAR2(4000);
    t BLOB;
    BEGIN
    SELECT bfield001
    INTO t
    FROM file_data
    WHERE id = 200;
    clb := java_utils.clob_zipdecompress(t, 'BANKFILE_', p_result);
    -- Output the results
    dbms_output.put_line(SubStr('p_result = '||TO_CHAR(p_result), 1, 255));
    dbms_output.put_line(SubStr('p_err = '||p_err, 1, 255));
    dbms_output.put_line(SubStr('p_return_clob = '||SUBSTR(clb, 1,255), 1, 255));
    END;
    <b>Package example </b>
    PACKAGE JAVA_UTILS
    IS
    -- Decompress a BLOB in ZIP format to a CLOB and return it with specified contained filename
    FUNCTION clob_zipdecompress(p_blob IN BLOB, p_fname IN VARCHAR2, p_result OUT NUMBER)
    RETURN CLOB;
    END JAVA_UTILS;
    PACKAGE BODY JAVA_UTILS
    IS
    -- Decompress a BLOB in ZIP format to a CLOB and return it with specified contained filename
    FUNCTION clob_zipdecompress(p_blob IN BLOB, p_clob IN CLOB, p_fname IN VARCHAR2)
    RETURN NUMBER
    AS LANGUAGE JAVA NAME 'java_utils.Compress.ZipDecompress(oracle.sql.BLOB, oracle.sql.CLOB, java.lang.String) return int';
    FUNCTION clob_zipdecompress(p_blob IN BLOB, p_fname IN VARCHAR2, p_result OUT NUMBER)
    RETURN CLOB
    IS
    l_clob CLOB; l_result NUMBER;
    BEGIN
    IF p_blob IS NULL THEN
    RETURN NULL;
    END IF;
    DBMS_LOB.createtemporary(l_clob, TRUE);
    p_result := clob_zipdecompress(p_blob, l_clob, p_fname);
    RETURN l_clob;
    END clob_zipdecompress;
    END JAVA_UTILS;
    <b>Java Function Example simplified </b>
    package java_utils;
    import java.lang.*;
    import oracle.sql.*;
    import java.io.*;
    import java.util.zip.*;
    public class Compress
    * Decompresses the BLOB into CLOB
    * @param blob the source BLOB (compressed binary data)
    * @param clob the target CLOB (will hold plain text) it should be an empty CLOB retrieved for
    example with dbms_lob.createtemporary(l_clob,true);
    * @throws Exception mostly I/O exception if ever
    public static int ZipDecompress(BLOB blob, CLOB clob, String fname, String[] err)
    OutputStream out; ZipInputStream z; ZipEntry ze; String zeName; byte[] buffer; int cnt;
    boolean found = false;
    try {
    out = clob.setAsciiStream(0L); // Here it fails
    catch (Exception ex) { err[0] = ex.getMessage(); return -1; }
    return 0;
    The execution of the example works well in 11gR1 but in 11gR2 returns error : <b>Invalid argument(s) in call. </b>
    Any idea why this is happening?
    Any help will be appreciated.
    Dionyssis

    Hi Dionyssis:
    Replace:
    clob.setAsciiStream(0L); // Here it fails
    by:
    clob.setAsciiStream(1L);
    the CLOB Api was changed from early implementation of Oracle to the standard implementation.
    HTH, Marcelo.

  • Read and Write Problem

    Hello!
    I have a problem with the Data I/O in my program. The button "Animation" generates random numbers and saves them into a file. With the Button "Vergleich" i want to load the data and reproduce the data in the graph.
    When i push the button "Vergleich" i can choose the data, but the program don*t reproduces it!
    Coult anybody help me??
    TNKS
    Best regards,
    Peter
    Labview 7.1 on Windows 2000
    Attachments:
    program.vi ‏68 KB

    Here are two changes, one uses the write to spreadsheet and read from spreadsheet file functions, the other changes your "read file" to "read text file"
    P.M.
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion
    Attachments:
    program[1.x].zip ‏41 KB

Maybe you are looking for

  • Error during creation of info record for pipline material.(Urgent)

    Hi All, We are getting the following error during creation of Info record for pipeline material " Material XXXXX is not a pipline material" we have checked the material master  and found it is a pipeline material. Kindly advice on the same. Help in a

  • Step by step to disable Folder Redirection for a single user - Windows 7 and SBS 2011 Essentials

    OK...I got chewed (by someone I have a lot of respect for) for pounding on an old thread, so I'm starting a new one. I've got the Windows 7 Value Pack Plugin for SBS 2011 Essentials and Folder Redirection is working for everybody. What I'm looking fo

  • Task failed with unknow error

    Hi all, I made some changes in a mapping. I validated it and checked it in succesfully. When running the task in the dac, it gives me a unknow error. So i ran the workflow in the workflowmanager to see wich errors and warning he come up with. The map

  • Installing QuickTime in a Corporate Environment

    I apologize if this has already been asked, but I searched and couldn't find anything related. Hopefully someone can point me in the right direction. I need to deploy the latest version of QT in a corporate environment. Our users are locked down and

  • IWEB BLOG WEBSITE

    I created a blog website -- for the ease of changing items -- my website is thinteriorartdesign.com I'm trying to use this as a professional website as directed by a genius at the Apple Store. Here's my problem.... The images keep moving around on th