Hi, how can i extract/download a Word (.doc) from mysql

Hi,
I have a facility where i can upload Word documents to a mysql table...
how can i download/extract these out of the table using mysql and jsp?
the code i currently have is
<%@ page language="java" import="java.sql.*,com.jspsmart.upload.*"%>
<jsp:useBean id="upload" scope="page" class="com.jspsmart.upload.SmartUpload" /><%
String id = request.getParameter("id");
String column = request.getParameter("column");
String table = request.getParameter("table");
     Class.forName("com.mysql.jdbc.Driver");
     Connection ConnDoc = DriverManager.getConnection ("jdbc:mysql://localhost:3306/firsttable?user=root&password=table"); 
     Statement StmtDoc = ConnDoc.createStatement();
     ResultSet RSDoc = StmtDoc.executeQuery("select "+column+" from "+table+" where id='"+id+"'");
     while (RSDoc.next())
          upload.initialize(pageContext);
          upload.downloadField(RSDoc,column,"application/msword","policy_"+id+".doc");
     RSDoc.close();
     StmtDoc.close();
     ConnDoc.close();
%>on the JSP page i have a link which calls the above code....
<a href='http://localhost/etisum/downloaddoc.jsp?id=2&table=pii&column=thecertificate'>DOCUMENT</a>Can anyone point me in the right direction or even towards a tutorial.
Thank you

So, you work for an insurance company?

Similar Messages

  • How can I re-download previously purchased songs from itunes?

    How can I re-download previously purchased songs from itunes?

    You only get one download.  It is your responsibility to backup your purchases.
    UNLESS, you are in the U.S, then you can use the Beta version of icloud.  Open itunes store, click Purchased, under Quick links

  • How can I extract a piece of video from a DVD ?

    Dear all,
    I recorded a DVD of a TV broadcast. I'd like to get an extract from it and use it in a presentation later (such as powerpoint).
    How can I extract the piece of video ?
    Is is possible to record it with quicktime (for example) or any other application ?
    thanks for your help
    Didier

    MPEG Streamclip and the Apple MPEG-2 component will allow you to edit the VOB files off the DVD and export to MPEG-4. Searching here will provide this answer several hundred times as it is asked a LOT. More so for iPod users. You cannot export or edit and then export MPEG1/2 with Quicktime unless you do not need the audio as there won't be any.

  • How can i extract using while the time from the string ?

    First time how can i extract the time as string ?
    And second how can i extract the time as DateTime.Now ?
    public static void ExtractDateTime()
    htmltoextract = new Uri("http://test.com");
    client = new WebClient();
    f = client.DownloadString(htmltoextract);
    client.Dispose();
    int index = 0;
    while (index != -1)
    int t = f.IndexOf(firstTag);
    int g = f.IndexOf(lastTag);
    a = f.Substring(t + firstTag.Length, g - t - 8);
    The string look like this: thisisateststring201309202145andthenextimeinthestringis201309202130andthelastofthisexampletimeinthisstringis201309202115
    What i need to do is first time to extract the time as string to a List<string> like this:
    index 0 201309202145
    index 1 201309202130
    index 2 201309202115
    The second time to extract the times as this time format: YYYYMMDDhhmm and also to add the times to a List.
    First time and second time i mean first example and second example. To use my code but first time to extract it as strings second example as the format of YYYYMMDDhhmm
    And i need to use the while and indexof and substring in this cases.

    Is the region always going to be "eu" or are you going to have more than one region.  Since you are reading a string DateTime from different timezone than the computer you are reading the data you have to convert to a different timezone. 
    It looks like you have at least 'is' and 'eu' for regions.  I don't know what offsets you need so try something like this.
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Text.RegularExpressions;
    using System.Globalization;
    using System.IO;
    namespace ConsoleApplication1
    class Program
    static void Main(string[] args)
    string input = File.ReadAllText(@"c:\temp\test.txt");
    string pattern1 = @"imageUrls = \[[^\]]*\]";
    Regex ex1 = new Regex(pattern1, RegexOptions.Singleline);
    string pattern2 = @"region=(?'region'[^&]*)&time=(?'time'\d{12})";
    Match match1 = ex1.Match(input);
    Regex ex2 = new Regex(pattern2, RegexOptions.Singleline);
    MatchCollection matches2 = ex2.Matches(match1.Value);
    IFormatProvider provider = CultureInfo.InvariantCulture;
    List<DateTime> dateTime = new List<DateTime>();
    foreach (Match match2 in matches2)
    string region = match2.Groups["region"].Value;
    DateTime dt = DateTime.ParseExact(match2.Groups["time"].Value, "yyyyMMddHHmm", provider);
    switch (region)
    case "eu" :
    dt.AddHours(1);
    break;
    case "is":
    dt.AddHours(-1);
    break;
    dateTime.Add(dt);

  • I apply to jobs online and need to provide my resume, which is in Word on Dropbox, but when I hit "Browse" to find Dropbox or any other repository all I can pull are photos. How can I get to my Word doc?

    I need to attach a Word doc when online forms require it.  When I Browse for a file, all the iPad and the iPhone allows are photos or videos. I have these docs in Dropbox and Skybox but I cannot get to them from Browse. How can I do this?

    Take a look at the iCab Mobile browser for the iPad. It allows document uploads if you configure it properly in the settings. iCab Mobile also works with DropBox.
    You may have to download the documents to the iPad and upload from there, but it might be worth a look here.
    https://itunes.apple.com/us/app/icab-mobile-web-browser/id308111628?mt=8
    This is copied from their website.
    How can I upload any file (not only photos) under iOS 6?
    Unlike the web engine of iOS 5.x and older, the web engine of iOS 6 has now basic upload support as well. But it only supports uploading photos and videos from the photo album. And this will only work under iOS 6.
    The upload capability of iCab Mobile works under all iOS releases and supports uploading photos videos and all other file types. It can even scale down photos before uploading to save bandwidth.
    But iCab's own custom upload capability has the disadvantage, that because of several iOS restrictions, it can not work on all web pages. Therefore under iOS 6, iCab Mobile provides a switch in the settings where the user can choose, if iCab should use the upload capability from the iOS (only photos, works with some more web pages) or the capabilities of iCab (photos and all other files, can't work on all web pages).
    So if you need to upload other files than just photos, make sure that you set the option "Upload files via" in the settings to "iCab Mobile".
    This is a link to the FAQ on the site.
    http://www.icab-mobile.de/faq.html

  • How do I get a MS Word doc from my mail's inbox to Pages so I can change it?

    How do I get a MS Word (or MS Excel) doc from my mail inbox on the iPAD to the Pages (or Numbers) app so it can be changed or modified?

    From the iPad manual (http://support.apple.com/manuals/#ipad) :
    Open an attached file: Tap the attachment to download it to iPad and then open it. If iPad doesn’t support the format of an attached file, you can see the name of the file but you can’t open it.
    Open an attached file with a different app: Touch and hold the attachment, then choose an app. If you don’t have any apps that can open the attachment, you can view it, provided it’s a file type that iPad supports.

  • How can I get back my Word docs now that Pages will not open them?

    How can I retrieve my Word docs now that Pages will not open them in Mavericks.  I have a brand new iMac with my evolving manuscript for a book transsferred from my now defunct MacBook Pro by external drive.  Pages tells me that "PowerPC apps are "no longer supported" and Mavericks will not open Microsoft Office, though it is still in Applications.  Would really appreciate ANY help!

    You will have to have an app that will open them first, you can upgrade to Office for Mac 2011 which is an Intel based app then open the docs and retry. Your docs were created with extremely old version of Office for Mac, version 2004!
    Another possiblity is  using a web based compatible MS Office for Mac app and see if it will open your doc and then save it, then attempt to re-open in Pages.

  • How can I extract the create preference script from database

    I have 10.2.0.3 database. I have a schema that has text schema indexes. I need to load the data to another user.
    Here is my steps:
    1. create a new user dev.
    2. expdp user prod
    3. impdp prod to dev META_DATA_ONLY
    4. drop schema indexex, otherwise, there is error.
    5. recreate schema index.
    My problem is when I recreate the indexes. I got this error
    ERROR at line 1:
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-20000: Oracle Text error:
    DRG-10700: preference does not exist: OCS_IDCCOLL1_LEXER
    ORA-06512: at "CTXSYS.DRUE", line 160
    ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 364
    I ran
    select pre_name from CTX_PREFERENCES wehre pre_owner='PROD'
    OCS_IDCCOLL1_LEXER
    How can I recreate the OCS_IDCCOLL1_LEXER for user dev?
    Thanks a lot!

    Try running CTX_REPORT.CREATE_INDEX_SCRIPT: see http://download.oracle.com/docs/cd/B14117_01/text.101/b10729/admin.htm#CACFCCDA.

  • How can I open a 2003 word doc on my ipad?

    My Ipad is not recognizing my word docs.

    Have a look at the following:
    http://itunes.apple.com/sg/app/quickoffice-pro-hd-edit-office/id376212724?mt=8&l s=1
    http://itunes.apple.com/sg/app/office2-hd/id364361728?mt=8&ls=1
    http://itunes.apple.com/sg/app/documents-to-go-premium-office/id317107309?mt=8&l s=1
    http://itunes.apple.com/sg/app/polaris-office/id513188658?mt=8&ls=1

  • How can I extract a file name / path from a local path variable in TestStand?

    I have local TestStand string variable, call it 'locals.path', that contains a path to a file including the file name (c:\inputs\input.txt). I need to be able to split up the path (c:\input) and the file name (input.txt) and save them into 2 local variables. What is the best way to do this?
    After reading through some of the other forums, it looks like there are some built-in functions that can accomplish this, but I am unable to find how to use them anywhere on the NI web site. One forum said to use the File I/O>Strip Path.file function. How is this called? Is this function in a DLL?
    I know that there are a number of DLLs that are installed with TestStand into the c:\windows\system32 directory. One forum made note of CVI_OpenFile / CVI_ReadFIle functions in the cvirt.dll that I used to solve a problem that I had in the past. The problem is that I had no idea that that these functions even existed and would have never known unless a similar question had been posted previously. Is there some place that these DLL function interfaces are defined or documented? Is there a function that can extract the file name out of a string for me?
    Thanks,
    Mike

    Hi,
    There sound like functions in say LabVIEW or CVI.
    I have attached a small example which may help. (I have not allowed for any error trapping, if say you dont find the file and cancel)
    Regards
    Ray Farmer
    Message Edited by Ray Farmer on 10-16-2006 10:04 PM
    Regards
    Ray Farmer
    Attachments:
    Sequence File1.seq ‏33 KB

  • Why can't i download microsoft word files from laptop onto my iphone using teamviwer

    I'm trying to transfer word documents on my iphone and it won't download to iphone i'm using teamwiewer

    You should probably contact the makers of Teamviewer

  • Once I've saved a doc in Pages, how can I then save a word.doc copy of it?

    So, I started working on a document on my desktop - dropboxed it to my Macbook - carried on working on it now can't open it on desktop, as it was saved as Pages, and my desktop doesn't have pages . . . . anyone got any ideas please? WHat am I missing?
    thanks,

    You need Pages to open a Pages document.

  • Download MS word doc from an HTML page link

    Hi can someone please tell me how to do this.
    I have created the page and inserted <!--Download the large documentinto the region source but when I run the page and click on the link nothing happens.
    I am a newbie please be simple but elaborate in what needs to be done.

    user2446549 wrote:
    Hi can someone please tell me how to do this.
    I have created the page and inserted <!--Download the large document
    You cannot access the files on you pc, it needs to be available on the web server or in a database table(blob)
    I am a newbie please be simple but elaborate in what needs to be done.What are you trying to achieve?

  • Can't convert an originally Word doc from PDF back to Word

    I'm running Windows 7 and MS Office 2010. I edited a 65 pages long doc, which I was recommended to convert to a PDF. Said and done. However now i want to make changes in that doc. I've tried to convert it back to Word but I don't succeed in doing it in spite of all your different advice.
    And, as a matter of fact, I'm rather inexperienced in computing.

    Hi bernd, I've succeeded in converting from PDF to something - Word perhaps - but it's impossible to edit anything in this converted doc. The cursor just twinkle beside the word I want to edit.

  • How can I extract the two channels from a stereo track?

    Hi,
    I am writing a class that is able to draw an audio signal. It seems to be working well but I have a question. If I load a mono audio file I am able to draw it on a graph by using the byte[] array and everything is ok until now. That's the code:
    void Draw(byte[] x)
                Graphics g=getGraphics();
                Graphics2D g2=(Graphics2D)g;
                g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,                     RenderingHints.VALUE_ANTIALIAS_ON);
                for(int i=0; i<x.length-6; i++)
                    g2.draw(new Line2D.Float(((i*(getWidth()-6))/x.length)+5, (getHeight()/2)-          ((x*(getWidth()-6))/x.length), (((i+1)*(getWidth()-6))/x.length)+5, (getHeight()/2)-     ((x[i+1]*(getWidth()-6))/x.length)));
    The results is correct only if I have a mono track. Obviously when I get a stereo track the array becomes very large so here the question. How can I extract the two audio channels from a stereo track?
    Thanks in advance.
    Maurizio Di Vitto                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    A mono audio stream is stored [sample, sample, sample, sample], so just a list of samples in an array.
    A stereo sample is interleaved in the same manner, so you get [left-sample, right-sample, left-sample, right-sample]
    So every nth sample is the 1st channel, every nth+1 is the 2nd channel...

Maybe you are looking for