How to close saved image?

hi 
I can't close the saving image after i created it. It becomes read only and  i get error  unless i exit from application when i want to create it again  i think it remains open.
Would you help me how i can solve problem?
 ofd.Filter = "Image Files|*.jpg;*.png;*.gif;*.bmp;|All Files (*.*)|*.*"
        If ofd.ShowDialog = Windows.Forms.DialogResult.OK Then
            TextBox1.Text = ofd.FileName
            Dim img As Image = Nothing
            Dim sfilename As New System.IO.FileInfo(ofd.FileName)
            Dim yol As New FileInfo(TextBox1.Text)
            Dim f As String = System.IO.Path.GetFileNameWithoutExtension(ofd.FileName)
            Dim path As String = yol.Directory.FullName & "\" & f & yol.Extension Dim fs As FileStream = sfilename.OpenRead()
Dim outputStream As Stream = New MemoryStream()
AddWatermark(fs, TextBox2.Text, outputStream)
fs.Close()
sfilename.Delete()
img = Image.FromStream(outputStream)
Using savingImage As New Bitmap(img.Width, img.Height, img.PixelFormat)
Using g As Graphics = Graphics.FromImage(savingImage)
g.DrawImage(img, New Point(0, 0))
End Using
savingImage.Save(path, ImageFormat.Jpeg)
PictureBox1.BackgroundImage = Image.FromFile(path)
End Using
outputStream.Close()
img.Dispose()Public Sub AddWatermark(ByVal fs As FileStream, ByVal watermarkText As String, ByVal outputStream As Stream)
        Dim img As Image = Image.FromStream(fs)
        Dim font As New Font("Verdana", 32, FontStyle.Bold, GraphicsUnit.Pixel)
        font = FontDialog1.Font
        'Adds a transparent watermark with an 100 alpha value.
        Dim color As Color = Color.FromArgb(100, 0, 0, 0)
        'The position where to draw the watermark on the image
        Dim pt As New Point(10, 30)
        Dim sbrush As New SolidBrush(color)
        Dim gr As Graphics = Nothing
        Try
            gr = Graphics.FromImage(img)
        Catch
            ' http://support.microsoft.com/Default.aspx?id=814675
            Dim img1 As Image = img
            img = New Bitmap(img.Width, img.Height)
            gr = Graphics.FromImage(img)
            gr.DrawImage(img1, New Rectangle(0, 0, img.Width, img.Height), 0, 0, img.Width, img.Height, GraphicsUnit.Pixel)
            img1.Dispose()
        End Try
        gr.DrawString(watermarkText, font, sbrush, pt)
        gr.Dispose()
        img.Save(outputStream, ImageFormat.Jpeg)
    End Sub
                                                  

Hi,
 Here is a small example that does the same thing as your code i believe and will overwrite the opened image with the watermarked image.  Perhaps you can arrange your code to follow these steps.
Imports System.Drawing.Imaging
Imports System.IO
Public Class Form1
Private Img As Bitmap
Private wmFont As New Font("Verdana", 32, FontStyle.Bold, GraphicsUnit.Pixel)
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Using ofd As New OpenFileDialog
ofd.Filter = "Image Files|*.jpg;*.png;*.gif;*.bmp;|All Files (*.*)|*.*"
If ofd.ShowDialog = Windows.Forms.DialogResult.OK Then
Dim frmt As ImageFormat
If Img IsNot Nothing Then Img.Dispose()
Using i As New Bitmap(ofd.FileName)
frmt = i.RawFormat
Using g As Graphics = Graphics.FromImage(i)
Using sb As New SolidBrush(Color.FromArgb(100, 0, 0, 0))
g.DrawString(TextBox2.Text, wmFont, sb, New Point(10, 30))
End Using
End Using
Img = New Bitmap(i)
End Using
Img.Save(ofd.FileName, frmt)
If PictureBox1.Image IsNot Nothing Then PictureBox1.Image.Dispose()
PictureBox1.Image = Img
End If
End Using
End Sub
End Class
If you say it can`t be done then i`ll try it

Similar Messages

  • How to prevent saving images

    Hi,
    I want to prevent users from (right click & save images) saving images in my website.How can i do this?Please help me.
    Thanks.

    Roopavathy wrote:
    Hi,
    I want to prevent users from (right click & save images) saving images in my website. How can i do this?
    Simple, you can't.
    The internet is based off of the idea of downloading files from remote servers into your browser for viewing (file sharing). If they can see your image, they have already downloaded it to their computer. The final steps of making that temporary file a permanent addition to their hard drive are simple and unavoidable.
    It would probably be much better (easier and less counter-intuitive for the end user) to examine "why" you are attempting to bar your viewers from saving the information your are presenting to them on your site and working on whether it actually makes sense to place that info on your site in the first place.
    If you want to protect content from "random internet bad guys" consider password protecting it so only those users who are given the username and password can access it. That's definitely not the way to present normal online info, but would make sense for things like photography sites (showing customers proofs of photos before they decide on packages to purchase) or similar.
    If password protection doesn't make sense for your site, the only way to keep viewers from copying your info is to keep it off the internet all together.

  • How to restore saved image to my SAS drive

    Hi all,
    I'm sure this has been discussed before but I haven't found an applicable thread yet.  
    I have Windows 7 Pro on a Thinkstation S20 with a SAS drive (not a SATA drive).  I am unable to restore my drive with my backup because the SAS drive is not detected.  What is the solution for this?  Any help is much appreciated.
    Thank you.
    Solved!
    Go to Solution.

    Ok, I found this (from you, when you helped someone else) and it worked!  Woohoo!
    1.  Download CDSAS09WS17.exe from the Lenovo site.  For your case, I would download it again and start completely fresh.  I downloaded directly to a USB key, and then ran the .exe from the key and extracted the contents to a folder on the key.
    2.  Boot your system to the win7 install disc, run through the prompts (make sure you're not choosing upgrade).
    3.  When you get to the drive selection screen, click "load driver".
    4.  Point windows to where you extraced the Marvell driver files on your key.  Note that for 64 bit you should point it to the "amd64" folder.  Click OK.
    5.  Allow windows to load the driver.  Once it's done, it should come up with mv64xx.inf file.  Make sure the "hide devices that are not compatible with this HW is checked".  This way only a single driver should show.  Click OK.
    6.  Let windows install the driver.  Your drives should now be accessible.

  • How do I stop Firefox from grabbing my saved images and coverting them to Firefox?

    I am working on images in Dreamweaver and Adobe Photoshop, and when I try to save them, Firefox coverts them into Firefox images with a Firefox icon and then I can't edit them properly in Photoshop or Dreamweaver. How do I stop Firefox from grabbing my saved images? in English

    I will try that, but it's pretty time consuming to have to check that for each of my images. I am a web designer and I work with a lot of images.
    Is there any way to set that globally for all of my saved images?

  • HT200285 I want to change my wallpaper to an image that was available before I upgraded to IOS 8.1.3 - a close-up image of long reedy  grasses with hazy light in the background. Greyish hues. Where can find the image & how do I get it back on my phone?

    I want to change my wallpaper to an image that was available
    before I upgraded to IOS 8.1.3 - a close-up image of long reedy  grasses with hazy light in the background.
    Greyish hues. Where can find the image & how do I get it back on my phone?

    I want to change my wallpaper to an image that was available
    before I upgraded to IOS 8.1.3 - a close-up image of long reedy  grasses with hazy light in the background.
    Greyish hues. Where can find the image & how do I get it back on my phone?

  • How do i save Images from the "Saved Photos" folder in my iPad

    I have no idea how to save the images that i save while surfing the net or emails.
    They are saved to a folder in my IMAGE build in app called "Saved Photos", but i don't know how to get them out of my iPad.
    Does anyone know how do do this?
    Thanks

    Very simple, open up my computer and the iPad icon should be displayed just like any other drive. When you open it up it will than say internal storage. then a folder, mine is labeled DCIM like many camera folder names, that is where all your saved photos are. i think you can only copy them from the folder to your hard drive, and you have to delete them on the iPad. i guess you can say it treats it like a huge flash drive but just with your saved photos

  • How can I keep people from saving images from my website?

    How can I keep people from saving images from my website?

    Hi,
    have a look at this thread
    http://discussions.apple.com/thread.jspa?messageID=5645821&tstart=0#5645821
    and the link I posted in that thread
    However there's no way to avoid that people grab photos from your website. Nevertheless there are ways for making it a little more difficult.
    Regards,
    Cédric

  • How do you keep images from saving as "unknown.ext"?

    When saving images, sometimes (but more often than I care to tolerate) the name defaults to "unknown.ext". Is there any solution outside of typing out a new name and extension type.

    Please uninstall older versions of plugins in order to avoid security issues:
    Shockwave Flash 16.0 r0
    Shockwave Flash 9.0 r45
    Sometimes a problem with Firefox may be a result of malware installed on your computer, that you may not be aware of.
    You can try these free programs to scan for malware, which work with your existing antivirus software:
    * [http://www.microsoft.com/security/scanner/default.aspx Microsoft Safety Scanner]
    * [http://www.malwarebytes.org/products/malwarebytes_free/ MalwareBytes' Anti-Malware]
    * [http://support.kaspersky.com/viruses/disinfection/5350 Anti-Rootkit Utility - TDSSKiller]
    * [http://general-changelog-team.fr/en/downloads/viewdownload/20-outils-de-xplode/2-adwcleaner AdwCleaner] (for more info, see this [http://www.bleepingcomputer.com/download/adwcleaner/ alternate AdwCleaner download page])
    * [http://www.surfright.nl/en/hitmanpro/ Hitman Pro]
    * [http://www.eset.com/us/online-scanner/ ESET Online Scanner]
    [http://windows.microsoft.com/MSE Microsoft Security Essentials] is a good permanent antivirus for Windows 7/Vista/XP if you don't already have one.
    Further information can be found in the [[Troubleshoot Firefox issues caused by malware]] article.
    Did this fix your problems? Please report back to us!

  • Saved image to SDCARD, wont show up in Gallery

    hello,
    i have written a code to save image from my application folder to mobile  sdcard download folder. the code is working perfectly fine but the  problem is the image saved from my app are not visible in gallery. but  other image which are there in "download" folder are visible in gallery.
    when i restart the phone then my app saved image are visible in gallery.
    here is the code i am writing
    var fl:File = File.documentsDirectory.
    resolvePath(’Download/’ + strFileName);
    var firstHalf:ByteArray=new ByteArray();
    firstHalf=<<BInaryfile Content of my app image>>
    copyFile=new FileStream();
    copyFile.open(fl,FileMode.WRITE);
    copyFile.writeBytes(firstHalf,0,firstHalf.length);
    copyFile.close(); 

    Bad news that worked to get it into recovery mode but half way through the update it stopped and gives me the same message again "Itunes coud not connect to the ipod "mikes i pod" because it is locked with a passcode. You must enter your passcode on the Ipod before it can be used with Itunes" how do I get by that?

  • Black background of saved image file.

    Hello All,
    My code is set up to create an image then save the image into a file in JPEG format. Everything works well except the background of the saved image is balck. How can I get a white background on the saved file?
    I have posted my code below. I have allocated 10 duke dollars for the person solves who this? Thank You!!!!
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import javax.swing.*;
    import com.sun.image.codec.jpeg.*;
    import java.io.*;
    import java.awt.image.BufferedImage;
    public class Test2 extends JApplet {
    public void init() {
    //Initialize drawing colors
    setBackground(Color.white);
    setForeground(Color.black);
    public void paint(Graphics g) {
    Graphics2D g2 = (Graphics2D) g;
    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    Dimension d = getSize();
    int gridWidth = d.width / 6;
    int gridHeight = d.height / 2;
    // fill Rectangle2D.Double (red)
    g2.setPaint(Color.red);
    g2.fill(new Rectangle2D.Double(100, 100, 100, 100));
    g2.setPaint(Color.black);
    g2.drawString("My Rectangle", 125, 85);
    public static void main(String s[]) {
    JFrame f = new JFrame("Test2");
    f.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {System.exit(0);}
    JApplet applet = new Test2();
    f.getContentPane().add("Center", applet);
    applet.init();
    f.pack();
    f.setSize(new Dimension(400,300));
    f.show();
    saveAsJPEG(applet, 1.0F, "myJPEG.jpg");
         public static void saveAsJPEG(Component component, float quality, String filename)     {
              try          {
                   Dimension d = component.getSize();
                   BufferedImage bimage = new BufferedImage(d.width, d.height, BufferedImage.TYPE_INT_RGB);
                   component.paint(bimage.createGraphics());
                   Graphics2D g = (Graphics2D)bimage.getGraphics();
                   g.setPaint(Color.white);
                   if(!filename.endsWith(".jpg"))
                        filename += ".jpg";
                   OutputStream out = new FileOutputStream(filename);
                   JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
                   // Create JPEG encoder
                   JPEGEncodeParam jpegParams = encoder.getDefaultJPEGEncodeParam(bimage);
                   jpegParams.setQuality(quality, false);
                   // Set quality to (quality*100)% for JPEG
                   encoder.setJPEGEncodeParam(jpegParams);
                   encoder.encode(bimage);
                   // Encode image to JPEG and send to browser
                   out.close();
              catch (Exception e)          {
                   System.out.println(e);
    }

    I've added 2 lines to your paint, it works now.
    public void paint(Graphics g) {
    Graphics2D g2 = (Graphics2D) g;
    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    Dimension d = getSize();
    int gridWidth = d.width / 6;
    int gridHeight = d.height / 2;
    // make a white background
    g2.setPaint(Color.white);
    g2.fill(new Rectangle2D.Double(0, 0, d.width, d.height));
    // fill Rectangle2D.Double (red)
    g2.setPaint(Color.red);
    g2.fill(new Rectangle2D.Double(100, 100, 100, 100));
    g2.setPaint(Color.black);
    g2.drawString("My Rectangle", 125, 85);
    }

  • "error while saving image"

    has anyone had the problem where, when they select option and tap an image (in my case i pulled one from my email using an image i uploaded from my drive) and gotten an error that says "there was an error saving image" and your only option is 'ok'? i've read other forums and understand that jpeg's are the ideal form, and this had a .jpg extension.
    any thougths anyone?
    so many thanks in advance.
    -wren
    Post relates to: Pixi Plus p121vzw (Verizon)

    hey thanks , but my jdbc pool and driver is fine. what may be the problem and I am not able to change the type to BlobDomain in eo. The type i Blob only may be this is the problem how can I change it to Blob Domain

  • Saving image to a folder not working on azure

    I am saving image
    files to a folder in my application and saving its path in database . Image uploads working fine when I am running locally
    and its path is also storing.When I deployed it on azure it
    gives an error that " An error occurred while processing your request ". I have two tables in my database . First one where text is saved is working fine on azure but image upload thrown this error.
    I am using this code
    to upload
    image and its works fine when I am running locally. Need help ?

    Hi,
    Have you made any progress ?
    May I ask what application is it that you are running ? You mentioned that it works locally but not when deploying to Azure. Have you checked the connections strings?
    If you are still having any difficulty in understanding the code, perhaps you could post it on the below blog.
    http://blogs.msdn.com/b/onecode/archive/2014/08/28/sample-of-aug-28-how-to-store-the-images-in-sql-azure.aspx
    Regards,
    Mekh.

  • How to upload an image in jsp page

    hi,
    I want to upload an image file with my jsp page, but i cannot do it,
    I have used Jakarta common file upload for this & i have also read following file. But my code isnot working properly? Can you give me any example how to upload an image & how to display it?
    Can u give me any source code? Please help me.
    http://jakarta.apache.org/commons/fileupload/using.htmlwith regards
    Bina

    Hi,
    But after writing the following code i have got following error? What's the problem of this code? please help me?
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    <%@ page import="org.apache.commons.fileupload.*" %>
    <%@ page import ="java.util.*" %>
    <%@ page import ="java.io.*" %>
    </head>
    <body>
    <%
    boolean isMultipart = FileUpload.isMultipartContent(request);
    DiskFileUpload upload = new DiskFileUpload();
    List items = upload.parseRequest(request);
    Iterator iter = items.iterator();
    while (iter.hasNext()) {
    FileItem item = (FileItem) iter.next();
    if (item.isFormField()) {
    String name = item.getFieldName();
    String value = item.getString();
    //ring name= request.getParameter("")
    %>
    <%= name %>:<%= value %>
    <%
    } else {
    %>
    <%
    InputStream stream = item.getInputStream();
    OutputStream bos =
         new FileOutputStream(getServletContext().getRealPath("/images"+"/"+ item.getName()));
    int bytesRead = 0;
    byte[] buffer = new byte[8192];
    while ((bytesRead = stream.read(buffer, 0, 8192)) != -1) {
    bos.write(buffer, 0, bytesRead);
    bos.close();
    stream.close();
    item.delete();
    %>
    </body>
    </html>Error is:
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 13 in the jsp file: /uploadfileC.jsp
    Generated servlet error:
    FileUpload cannot be resolved
    An error occurred at line: 13 in the jsp file: /uploadfileC.jsp
    Generated servlet error:
    DiskFileUpload cannot be resolved to a type
    An error occurred at line: 13 in the jsp file: /uploadfileC.jsp
    Generated servlet error:
    DiskFileUpload cannot be resolved to a type
    An error occurred at line: 13 in the jsp file: /uploadfileC.jsp
    Generated servlet error:
    FileItem cannot be resolved to a type
    An error occurred at line: 13 in the jsp file: /uploadfileC.jsp
    Generated servlet error:
    FileItem cannot be resolved to a type
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 13 in the jsp file: /uploadfileC.jsp
    Generated servlet error:
    FileUpload cannot be resolved
    An error occurred at line: 13 in the jsp file: /uploadfileC.jsp
    Generated servlet error:
    DiskFileUpload cannot be resolved to a type
    An error occurred at line: 13 in the jsp file: /uploadfileC.jsp
    Generated servlet error:
    DiskFileUpload cannot be resolved to a type
    An error occurred at line: 13 in the jsp file: /uploadfileC.jsp
    Generated servlet error:
    FileItem cannot be resolved to a type
    An error occurred at line: 13 in the jsp file: /uploadfileC.jsp
    Generated servlet error:
    FileItem cannot be resolved to a type
         org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
         org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:414)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:297)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)Please help me.
    With regards
    Bina

  • How do I make image backgrounds black and white while maintaining color in the foreground objects?

    I have a close up close-up image of an orchid with blurred background.  I am trying to make the background black and white while maintaining the foreground color on the petals, buds and stems.  Any ideas?

    Use the Blank & White Brick and either brush the effect onto the background or brush is away from the foreground.  "Detect Edges" will help control the edge of the mask.
    You might be interested in knowing that you can brush on/away masks of different strengths, and thus produce effects in between 0% and 100%.
    Search the forum -- there are several good posts detailing how to create this effect.
    Sample search.
    Message was edited by: Kirby Krieger -- added sample search.

  • How to insert a image file into oracle database

    hi all
    can anyone guide me how to insert a image file into oracle database now
    i have created table using
    create table imagestore(image blob);
    but when inserting i totally lost don't know what to do how to write query to insert image file

    Hi I don't have time to explain really, I did have to do this a while ago though so I will post a code snippet. This is using the commons file upload framework.
    Firstly you need a multi part form data (if you are using a web page). If you are not using a web page ignore this bit.
    out.println("<form name=\"imgFrm\" method=\"post\" enctype=\"multipart/form-data\" action=\"FileUploadServlet?thisPageAction=reloaded\" onSubmit=\"return submitForm();\"><input type=\"FILE\" name=\"imgSource\" size='60' class='smalltext' onKeyPress='return stopUserInput();' onKeyUp='stopUserInput();' onKeyDown='stopUserInput();' onMouseDown='noMouseDown(event);'>");
    out.println("   <input type='submit' name='submit' value='Submit' class='smalltext'>");
    out.println("</form>"); Import this once you have the jar file:
    import org.apache.commons.fileupload.*;Now a method I wrote to upload the file. I am not saying that this is correct, or its the best way to do this. I am just saying it works for me.
    private boolean uploadFile(HttpServletRequest request, HttpSession session) throws Exception {
            boolean result = true;
            String fileName = null;
            byte fileData[] = null;
            String fileUploadError = null;
            String imageType = "";
            String error = "";
            DiskFileUpload fb = new DiskFileUpload();
            List fileItems = fb.parseRequest(request);
            Iterator it = fileItems.iterator();
            while(it.hasNext()){
                FileItem fileItem = (FileItem)it.next();
                if (!fileItem.isFormField()) {
                    fileName = fileItem.getName();
                    fileData = fileItem.get();
                    // Get the imageType from the filename extension
                    if (fileName != null) {
                        int dotPos = fileName.indexOf('.');
                        if (dotPos >= 0 && dotPos != fileName.length()-1) {
                            imageType = fileName.substring(dotPos+1).toLowerCase();
                            if (imageType.equals("jpg")) {
                                imageType = "jpeg";
            String filePath = request.getParameter("FILE_PATH");
            session.setAttribute("filePath", filePath);
            session.setAttribute("fileData", fileData);
            session.setAttribute("fileName", fileName);
            session.setAttribute("imageType", imageType);
            return result;  
         } And now finally the method to actually write the file to the database:
    private int writeImageFile(byte[] fileData, String fileName, String imageType, String mode, Integer signatureIDIn, HttpServletRequest request) throws Exception {
            //If the previous code found a file that can be uploaded then
            //save it into the database via a pstmt
            String sql = "";
            UtilDBquery udbq = getUser(request).connectToDatabase();
            Connection con = null;
            int signatureID = 0;
            PreparedStatement pstmt = null;
            try {
                udbq.setUsePreparedStatements(true);
                con = udbq.getPooledConnection();
                con.setAutoCommit(false);
                if((!mode.equals("U")) || (mode.equals("U") && signatureIDIn == 0)) {
                    sql = "SELECT SEQ_SIGNATURE_ID.nextval FROM DUAL";
                    pstmt = con.prepareStatement(sql);
                    ResultSet rs = pstmt.executeQuery();
                    while(rs.next()) {
                       signatureID = rs.getInt(1);
                    if (fileName != null && imageType != null) {
                        sql = "INSERT INTO T_SIGNATURE (SIGNATURE_ID, SIGNATURE) values (?,?)";
                        InputStream is2 = new ByteArrayInputStream(fileData);
                        pstmt = con.prepareStatement(sql);
                        pstmt.setInt(1, signatureID);
                        pstmt.setBinaryStream(2, is2, (int)(fileData.length));
                        pstmt.executeUpdate();
                        pstmt.close();
                        con.commit();
                        con = null;
                if(mode.equals("U") && signatureIDIn != 0) {
                    signatureID = signatureIDIn.intValue();
                    if (fileName != null && imageType != null) {
                        sql = "UPDATE T_SIGNATURE SET SIGNATURE = ? WHERE SIGNATURE_ID = ?";
                        InputStream is2 = new ByteArrayInputStream(fileData);
                        pstmt = con.prepareStatement(sql);
                        pstmt.setBinaryStream(1, is2, (int)(fileData.length));
                        pstmt.setInt(2, signatureID);
                        pstmt.executeUpdate();
                        pstmt.close();
                        con.commit();
                        con = null;
            } catch (Exception e) {
                con = null;
                throw new Exception(e.toString());
            return signatureID;
       }

Maybe you are looking for

  • Urgent Internal Harddrive question

    Hey I have a Power Mac G5 Dual 2.3 i bought a second drive, a Seagate 300 gb internal drive that says on the package that it works with macs however, the ribbon cable types are different!!! am I doing something wrong?? This is a Ultra ATA/100 7200 RP

  • Problems attaching files to e-mails

    After installing Lyon, from my wife's user she can't attach files to an e-mail. The window opens but only shows folders and the folders can not be opened. I can do it from my user. What could be happening?

  • Urgent Problem with TraceFile

    Dear community. I've got an error with an trace file which is cold rfc327858_01286.trc and ist located in the folder /usr/sap/P50/DVEBMGS01/work: Trace file opened at 20061019 093916 DFT, SAP-REL 700,0,48 RFC-VER 3 815142 MT-SL *> RfcRegisterProgram

  • Telesales staff offering packages with terms not r...

    I was cold called 5 days ago and offered a free 12 month calls package with a 7 day cancellation period. This was additional to my existing line rental. I rang today to cancel but the BT advisor said there was no 7 day cancellation period.  What is g

  • Aperture RAW conversion colour noise with Canon 1D Mark II

    I'm using Aperture 2.1 and am wondering if anyone here is having this problem - basically highlights end up with false colour with this camera/RAW conversion combination. The problems appears to have been introduced with the 1.1 RAW converter as 1.0