/*
    * MyH2GUI:                  program for easier LOBs testing
    *
    * Author:                   Michael Bissell
    * Date:                     4/19/2011
    * Version:                  3.0
    * -allows for BLOB & CLOB types
    *
    * Last Updated:     4/26/2011
    * Purpose:                  New users can see testing of LOBs faster
    *
    * Usage:                    If placed in org/h2/samples, files
    *                                   will overwrite same-named files in 
project home
   */

       private void createLOB() {
                /*
                 * Used in autoComplete, fill a file with 1MB, iterated
specified #times
                 */
                fileString = filename.getText();

            try{
                FileWriter fstr = new FileWriter(fileString);
                BufferedWriter outw = new BufferedWriter(fstr);

                if(timing){
                                //set up timing
                                startTime = System.currentTimeMillis();
                                writeData(outw);
                        timeResult = System.currentTimeMillis() - startTime;

                                fb.append("\n>" + fileString + " created... " +
userSize.getText() + "(MB)..."
                                                + timeResult + "ms");
                }
                else{
                        writeData(outw);
                        fb.append( "\n>" + fileString + " created..." +
userSize.getText() + "(MB)...");
                }
                outw.close();
            }
            catch (Exception ex){
                fb.append( ex.getMessage() );
            }
        }

        private void writeData(BufferedWriter bw){
                //Get specified #MBs and write to file
                long size = (long) (Double.parseDouble( userSize.getText() )
* 1048576);


                try {
                        for(int i = 0; i < size; i++)
                        {
                                bw.append('1');
                        }
                }catch (IOException ex){
                        fb.append( ex.getMessage() );
                }
        }

        private void autoComplete() {
                /*
                 * Creates & inserts LOBs according to specified # of objects
                 */
        }











On Apr 26, 7:07 pm, tuc70899 <[email protected]> wrote:
> Hello Thomas,
>
> That method for removing a row did not work in the first version of
> the gui.
>
> Here is the new implementation:
>         private void removeLOB(){
>
>                 try{
>                         fileString = filename.getText();
>
>                         pstmt = conn.prepareStatement("delete from LOBtable 
> where
> filename = ?");
>                         pstmt.setString(1, fileString);
>                         pstmt.execute();
>
>                         fb.append("\n>" + fileString + " removed...");
>
>                 }catch(Exception ex){
>                         fb.append("\n>Could not remove " + fileString + 
> "...");
>                         fb.append( ex.getMessage() );
>                 }
>
>         }
>
> If you are interested, I will be working on adding a radio button to
> specify CLOBs vs. LOBs, making large variable sized files, and adding
> buttons for timing in the feedback. I dunno, what do you think would
> be productive in a beginners tool like this?
>
> Cheers,
> Michael
>
> On Apr 22, 2:03 pm, Michael Bissell <[email protected]> wrote:
>
> > Hello,
>
> > Here is my H2 LOBs GUI for you. I suppose I will be adding to it in
> > the near future and was placing it in "org.h2.samplse" folder. At what
> > point should I try to patch?
>
> > Some functionality I wanted to add:
>
> > -Timing options
> > -Create LOBs
>
> > Thanks,
> > Michael B.
>
> >  MyH2GUI.java
> > 8KViewDownload

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to