Reading Large data files from client machine ( urgent)

Hi,
I want to know the best way for reading large data at about 75MB file from client machine and insert to the database.
Can anybody provide sample code for it.
Loading the file should be done at client machine and inserting into the database should be done at server side.
How should i load the file?
How should i transfer this file or data to server ?
How should i insert into the database ?
Thanks in advance.
regards
Kalyan

Like I said before you should be using your application server to serve files >from the server off the filesystem. The database should not store files this big >and should instead just have a reference to this file. I think u have not understood the problem corectly.
I will make it clear.
The requirement is as follows.
This is a j2ee based application.
Application server is oracle application server.
Database is oracle9i
it is thick client (swing based application)
User enters datasource like c:\turkey.data
This turkey.data file contains data
1@1@20050131@1@4306286000113@D00@32000002005511069941@@P@10@0@1@0@0@0@DK@70059420@4330654016574@1@51881100@51881100@@99@D@40235@0@0@1@430441800000000@@11@D@42389@20050201@28483@15@@@[email protected]@@20050208@20050307@0@@@@@@@@@0@@0@0@0@430443400000800@0@0@@0@@@29@0@@@EUR
like wise we may have more than 3 lacs rows in it.
We need to read this file and transfer this to the application server. Which are EJBS.
There we read this file each row in file is one row in the database for a table.
Like wise we need to insert 3 lacs records in the database.
We can use Jdbc to insert the data which is not a problem.
Only problem is how to transfer this data to server.
I can do it in one way. This is only a example
I can read all the data in StringBuffer and pass to server.
There again i get the data from StringBuffer and insert into database using jdbc.
This way if u do it. It is performance issue and takes long time to insert into the database.It even may give MemoryOutofBond exception.
just iam looking for the better way of doing this which may get good performace issue.
Hope u have understood the problem.

Similar Messages

  • JSP to Upload file from client machine to Web Server!

    Hi,
    I want to upload a file from client machine to web server in order to send it as email attachment, How can I do it? After uploading the file the class should give me the path where the file is stored on the web server and the file name in return!
    I know the HTML <file> field but dont know how to copy it on web server, HTML Part will be:
    <FORM ENCTYPE="multipart/form-data"
    method="POST" action="My.jsp">
    <INPUT TYPE="file" NAME="mptest">
    <INPUT TYPE="submit" VALUE="upload">
    </FORM>
    Please help!
    Thanks,
    - Rahul

    You can use cos.jar provided by O'Reilly from http://www.servlets.com/cos/. Take a look at com.oreilly.servlet.multipart.* classes.
    Package is provided with source, classes, documentation and, of course, ready-to-use jar file.
    It is really usefull and - ready!

  • How to upload file from client machine to  database in server machine?

    I am developing a web application. this application is suppose to take file from client machine and store that to database in the server side.
    My jsp form is of multi part type. but I am confused about what to write in servlet.
    Can any one help me ?
    Edited by: chinmaya_mishra on Feb 16, 2009 2:55 AM
    Edited by: chinmaya_mishra on Feb 16, 2009 2:58 AM

    http://www.google.com/search?q=jdbc+blob
    Blob processing varies between databases; see also examples for whatever database you are using, e.g.
    http://www.google.com/search?q=jdbc+blob+oracle
    If you are storing text data instead of binary data, replace "blob" by "clob" in the searches.

  • How to find out a file from client machine

    hi all,
    I want to read a file from client machine, like a outlook express file in which all the address are saved, using servlet. Initially i do not know the file path for that file, How i can read that file.
    plz help me
    thanx in advace
    Manish

    You have 2 possibilities. First, you might be able to mount the client's disk drive at the server; the servlet can then access that drive directly. Second, install a client program on the client machine and communicate with that program, and have it do the search (or whatever).
    Outside of Java, there are remote-access programs - like PCAnyWhere.

  • How to delete file from client machine

    Hi all,
    we are using the DataBase: oracle:10g,
    and forms/reports 10g(developer suite 10g-10.1.2.2).
    can anybody help me how to delete the file from client machine in specified location using webutil or any
    (i tried with webutil_host & client_host but it is working for application server only)
    thank you.

    hi
    check this not tested.
    PROCEDURE OPEN_FILE (V_ID_DOC IN VARCHAR2)
    IS
    -- Open a stored document --
    LC$Cmd Varchar2(1280) ;
    LC$Nom Varchar2(1000) ;
    LC$Fic Varchar2(1280);
    LC$Path Varchar2(1280);
    LC$Sep Varchar2(1) ;
    LN$But Pls_Integer ;
    LB$Ok Boolean ;
    -- Current Process ID --
    ret WEBUTIL_HOST.PROCESS_ID ;
    V_FICHERO VARCHAR2(500);
    COMILLA VARCHAR2(4) := '''';
    BOTON NUMBER;
    MODO VARCHAR2(50);
    URL VARCHAR2(500);
    Begin
    V_FICHERO := V_ID_DOC;
    LC$Sep := '\';--WEBUTIL_FILE.Get_File_Separator ; -- 10g
    LC$Nom := V_FICHERO;--Substr( V_FICHERO, instr( V_FICHERO, LC$Sep, -1 ) + 1, 100 ) ;
    --LC$Path := CLIENT_WIN_API_ENVIRONMENT.Get_Temp_Directory ;
    LC$Path := 'C:';
    LC$Fic := LC$Path || LC$Sep || LC$Nom ;
    If Not webutil_file_transfer.DB_To_Client
    LC$Fic,
    'TABLE_NAME',
    'ITEM_NAME',
    'WHERE'
    ) Then
    Raise Form_trigger_Failure ;
    End if ;
    LC$Cmd := 'cmd /c start "" /MAX /WAIT "' || LC$Fic || '"' ;
    Ret := WEBUTIL_HOST.blocking( LC$Cmd ) ;
    LN$But := WEBUTIL_HOST.Get_return_Code( Ret ) ;
    If LN$But 0 Then
    Set_Alert_Property( 'ALER_STOP_1', TITLE, 'Host() command' ) ;
    Set_Alert_Property( 'ALER_STOP_1', ALERT_MESSAGE_TEXT, 'Host() command error : ' || To_Char( LN$But ) ) ;
    LN$But := Show_Alert( 'ALER_STOP_1' ) ;
    LB$Ok := WEBUTIL_FILE.DELETE_FILE( LC$Fic ) ;
    Raise Form_Trigger_Failure ;
    End if ;
    If Not webutil_file_transfer.Client_To_DB
    LC$Fic,
    'TABLE_NAME',
    'ITEM_NAME',
    'WHERE'
    ) Then
    NULL;
    Else
    Commit ;
    End if ;
    LB$Ok := WEBUTIL_FILE.DELETE_FILE( LC$Fic ) ;
    Exception
    When Form_Trigger_Failure Then
    Raise ;
    End ;sarah

  • Reading files from clients machine through a browser

    if i have to access or use some files say C:\hello\myimage.jpg from client machine's local drive, how it can be done using some technology in Java eg applets or some other way. please read the following situation to have a better undertsanding of the problem,
    consider the following situation:
    a web application is running on client PC, and on click of a button, i have to generate a report in some format and insert some images in that report which are on clients local drive and their path is known to me say C:\ myimage.jpg.
    if the mages were on the server(where web application is hosted), then its not a prob.
    if there any other technology in java to read files from clients PC through a browser other than java

    Sign the applet.
    http://forum.java.sun.com/thread.jspa?forumID=63&threadID=524815
    second and last post

  • To upload a file from client machine to server machine

    Hi everybody!
    Could anyone plz help me. I am struck in a problem
    I want to transfer a file from client's machine to server but I am not able to upload
    It is tranferring the file only to the local machine
    I am using orielley package It is transferring files only to my local machine but not to the server .Can anyone correct it. It's very urgent
    how to write the relative path for server
    I am using this path and it is not uploading
    MultipartRequest multi = new MultipartRequest(request, "../<administrator>:<dev2daask>@dev2:C:/123data/", 5 * 1024 * 1024);
    Here is my code:
    <%@ page import="java.util.*" %>
    <%@ page import="javax.servlet.*" %>
    <%@ page import="javax.servlet.http.*" %>
    <%@ page import="java.io.*" %>
    <%@ page import="com.oreilly.servlet.MultipartRequest"%>
    <%
    try {
    // Blindly take it on faith this is a multipart/form-data request
    // Construct a MultipartRequest to help read the information.
    // Pass in the request, a directory to saves files to, and the
    // maximum POST size we should attempt to handle.
    // Here we (rudely) write to the server root and impose 5 Meg limit.
    MultipartRequest multi = new MultipartRequest(request, "../<administrator>:<dev2daask>@dev2:C:/123data/", 5 * 1024 * 1024);
    out.println("<HTML>");
    out.println("<HEAD><TITLE>UploadTest</TITLE></HEAD>");
    out.println("<BODY>");
    out.println("<H1>UploadTest</H1>");
    // Print the parameters we received
    out.println("<H3>Params:</H3>");
    out.println("<PRE>");
    Enumeration params = multi.getParameterNames();
    while (params.hasMoreElements()) {
    String name = (String)params.nextElement();
    String value = multi.getParameter(name);
    out.println(name + " = " + value);
    out.println("</PRE>");
    // Show which files we received
    out.println("<H3>Files:</H3>");
    out.println("<PRE>");
    Enumeration files = multi.getFileNames();
    while (files.hasMoreElements()) {
    String name = (String)files.nextElement();
    String filename = multi.getFilesystemName(name);
    String type = multi.getContentType(name);
    File f = multi.getFile(name);
    out.println("name: " + name);
    out.println("filename: " + filename);
    out.println("type: " + type);
    if (f != null) {
    out.println("length: " + f.length());
    out.println();
    out.println("</PRE>");
    catch (Exception e) {
    out.println("<PRE>");
    out.println("</PRE>");
    out.println("</BODY></HTML>");
    %>

    you have not understood my point
    how does this code will run on servlet when I want to upload a file from client's
    machine to server machine
    what I am doing is I am giving an option to the user that he/she can browse the file and then select any file and finally it's action is post in the jsp form for which I have sent the code
    All the computers are connected in LAN
    So how to upload a file from client's machine to server's machine
    Plz give me a solution

  • Copy file from client machine to unix db server

    Dear all,
    I have oracle form 10g, and data base server using 10 r 2,
    I have an oracle for to browse client XML file and return the name of the file including the path to TEXT item what I want to do after that is to copy the seelcted file from the client to DB server (hint this server over Unix operating system)
    I tried
    V_Cpy_Result := Webutil_File.Copy_File ('C:\File_Name.Xml', '/u01/oradata/odsuat/ssr_xml_dir/Outbound/File_Name.Xml');
    but this does't work, please provide me with the way or the command that I can copy the selected file from client to Unix DB server...

    Hello,
    If you want to transfer files between client machine and A.S. or database machine, use the Webutil file_transfer package's functions.
    Francois

  • How to FTP a file from client machine to database server using forms 10g

    Hi
    I want to ftp a file from a client machine to the database server machine using forms 10G (or PL/SQL).
    could you please tell me how can I do this
    Regards

    hi
    How to get up and running with WebUtil 1.06 included with Oracle Developer Suite 10.1.2.0.2 on a win32 platform
    Solution
    Assuming a fresh "Complete" install of Oracle Developer Suite 10.1.2.0.2,
    here are steps to get a small test form running, using WebUtil 1.06.
    Note: Oracle_Home is used as an alias for your real oDS ORACLE_HOME.
    Feel free to copy this note to a text editor, and do a global find/replace on
    Oracle_Home with your actual value (no trailing slash). Then it is easy to
    copy/paste actual commands to be executed from the note copy.
    1) Download http://prdownloads.sourceforge.net/jacob-project/jacob_18.zip
    and extract to a temporary staging area. Do not attempt to use 1.7 or 1.9.
    2) Copy or move jacob.jar and jacob.dll
    C:\webutile is the folder where you extracted Jacob, and will end in ...\jacob_18
    cd C:\webutile
    copy jacob.jar Oracle_Home\forms\java\.
    copy jacob.dll Oracle_Home\forms\webutil\.
    The Jacob staging area is no longer needed, and may be deleted.
    3) Sign frmwebutil.jar and jacob.jar
    Open a DOS command prompt.
    Add Oracle_Home\jdk\bin to the PATH:
    set PATH=Oracle_Home\jdk\bin;%PATH%
    Sign the files, and check the output for success:
    Oracle_Home\forms\webutil\sign_webutil Oracle_Home\forms\java\frmwebutil.jar
    Oracle_Home\forms\webutil\sign_webutil Oracle_Home\forms\java\jacob.jar
    4) If you already have a schema in your RDBMS which contains the WebUtil stored code,
    you may skip this step. Otherwise,
    Create a schema to hold the WebUtil stored code, and privileges needed to
    connect and create a stored package. Schema name "WEBUTIL" is recommended
    for no reason other than consistency over the user base.
    Open Oracle_Home\forms\create_webutil_db.sql in a text editor, and delete or comment
    out the EXIT statement, to be able to see whether the objects were created witout
    errors.
    Start SQL*Plus as SYSTEM, and issue:
    CREATE USER webutil IDENTIFIED BY [password]
    DEFAULT TABLESPACE users
    TEMPORARY TABLESPACE temp;
    GRANT CONNECT, CREATE PROCEDURE, CREATE PUBLIC SYNONYM TO webutil;
    CONNECT webutil/webutil@rcci
    @Oracle_Home\forms\create_webutil_db.sql
    -- Inspect SQL*Plus output for errors, and then
    CREATE PUBLIC SYNONYM webutil_db FOR webutil.webutil_db;
    Reconnect as SYSTEM, and issue:
    grant execute on webutil_db to public;
    5) Modify Oracle_Home\forms\server\default.env, and append Oracle_Home\jdk\jre\lib\rt.jar
    to the CLASSPATH entry.
    6) Modify Oracle_Home\forms\server\formsweb.cfg insde [default] add :
    archive_jini=frmall_jinit.jar,frmwebutil.jar,jacob.jar
    archive=frmall.jar
    also add :
    [webutil]
    WebUtilLogging=off
    WebUtilLoggingDetail=normal
    WebUtilErrorMode=Alert
    WebUtilDispatchMonitorInterval=5
    WebUtilTrustInternal=true
    WebUtilMaxTransferSize=16384
    baseHTMLjinitiator=webutiljini.htm
    baseHTMLjpi=webutiljpi.htm
    baseHTML=webutilbase.htm
    archive_jini=frmall_jinit.jar
    WebUtilArchive=frmwebutil.jar,jacob.jar,f90all.jar
    archive=frmwebutil.jar,f90all.jar
    lookAndFeel=oracle
    7) Modify Oracle_Home\forms\server\webutil.cfg and add :
    transfer.database.enabled=TRUE
    transfer.appsrv.enabled=TRUE
    8) Start the OC4J instance
    9) Start Forms Builder and connect to a schema in the RDBMS used in step (4).
    Open webutil.pll, do a "Compile ALL" (shift-Control-K), and generate to PLX (Control-T).
    It is important to generate the PLX, to avoid the FRM-40039 discussed in Note 303682.1
    If the PLX is not generated, the Webutil.pll library would have to be attached with
    full path information to all forms wishing to use WebUtil. This is NOT recommended.
    10) Create a new FMB.
    Open webutil.olb, and Subclass (not Copy) the Webutil object to the form.
    There is no need to Subclass the WebutilConfig object.
    Attach the Webutil.pll Library, and remove the path.
    Add an ON-LOGON trigger with the code
    NULL;
    to avoid having to connect to an RDBMS (optional).
    Create a new button on a new canvas, with the code
    show_webutil_information (TRUE);
    in a WHEN-BUTTON-PRESSED trigger.
    Compile the FMB to FMX, after doing a Compile-All (Shift-Control-K).
    11) Under Edit->Preferences->Runtime in Forms Builder, click on "Reset to Default" if
    the "Application Server URL" is empty.
    Then append "?config=webutil" at the end, so you end up with a URL of the form
    http://server:port/forms/frmservlet?config=webutil
    12) Run your form.

  • How do I restore 'Notes' data files from Time Machine?

    My wife accidentally (more or less) deleted 7 of her Note notations because they were duplicated and she thought one should be eliminated.  What happened is that when she deleted one, the system deleted both duplicates.  After doing this for 7 times, she saw what was happening and stopped.  We have both our iMacs backed up to a Time Machine and I have been searching these forums trying to find out the name of the data file for Notes so that I can restore it.  The best I saw was Library/Containers/com.apple.notes but I could not find this file anywhere in Finder or even on the Macintosh HD.  We did find out that if you delete something from Notes on your iMac, it also gets deleted in iCloud (I thought there was a backup in iCloud) iPhone, and iPad.  One of these notes is irreplacable as it is a daily diary of an event in my wife's life.  Can anyone please tell me where I can find the Notes data files so I can locate them on Time Machine and restore them?  (Note:  If I restore them from TM and they are not in iCloud will they be immediately deleted?  Sorry that may be a dumb question but I've done a bit of technical work with PCs and MobileMe and iCloud seem useless.  I'd just as soon plug my iPhone and iPad into my iMac to synch, you know.  Thanks for any help.  Gary

    Here is what I have tried:
    1. Finder>Go>(Option)Library>Address Book(highlighted)with files showing in right column. Opened Time Machine and Address Book folder is there. Tried to go back to several previous dates from several months ago. None will highlight in order for the Restore button to light up.
    2. Finder>Mac HD (under Devices)>(Option)Library>Address Book (same as above). Again, cannot go anywhere back in time to highlight a date for Restore button to light up.
    Note: I was able to use Time Machine to restore my Contacts with no problem. However, they are All Contacts only and did not restore my Groups. I do know how to make groups again and highlight and drag them back, but wanted to see if there was a way to restore the groups. I will post another question as to why my Time Machine won't let me restore the Address Book as well as the Contacts. Thank you for your time and patience.

  • FND function to create .csv data file on client machine?

    Hello All,
    I am trying to create a concurrent request which when run by the user's creates a .csv file with data. I created a procedure in the database which run's when they run the conc.request.
    However is there any FND function or anyother function available that creates the data file on the client machine (either in their 'C:\') or in a share drive etc?
    Currently through the procedure, I am able to write the .csv data file to a unix directory to which users do not have access.
    Thanks,
    Chiru

    Chiru,
    Several options for you to consider are :
    1. If you want to have the csv on client machine: Make the program to create the csv in server with a constant name, eg : test.csv and create a dos command in client's machine that is could FTP to server, rename the existing csv file in client's machine and get test.csv from server.
    2. If you want to do in share drive : As long as the share drive exists in PC that can be used for FTP, you can create unix host script that can FTP the file to the windows server. For instance, create a generic unix host script that accepts parameter such as filename, and server destination, destination folder, unix login ,password, etc. This program will run in a request set after your concurrent program. If you search google I'm sure you will find samples of unix script that does this kind of thing.
    3. As per what Kevin said ,another options is to send the csv file using email to the recipients.
    HTH

  • How to upload file from client machine to  server machine?

    i am developing one web application.I have one html file with browse option. client can browse any type of file. what ever file the client will browse it going to be stored in server machine. for storing the file want to use servlet. my html form is of multipart type.
    can any one send me the servlet code? i am using tomcat 5.5 as web server.

    [http://commons.apache.org/fileupload]
    Start reading 'User Guide' and 'Frequently Asked Questions'.
    Good luck :)

  • How to read LARGE .TXT FILES from server

    i m unable to read large .txt (>100kb) files from server.
    also is there any way to store the content in mobile phone.
    PLEASE HELP as iam in dire need and only few days are left.
    thanks

    Hi
    > i m unable to read large .txt (>100kb) files from server.
    What do you mean by that? Are you trying to display that amount of text and you get an error. Are you trying to read from the server and you get there an error?
    > also is there any way to store the content in mobile phone.
    Using RMS. But be aware of the size limit specific to every phone.
    Mihai

  • Opening  a file from client machine

    Hi All ,
    I have a requirement .I need to <b>integrate / Open </b> an .exe file in the portal and this exe file will reside on every on every client machine from which portal is accessed . Can you suggest me some methods . I have tried with URL iview , but it is not working .
    Thanks
    Aneez
    <b>P.S Guaranteed points for helpful answers</b>

    Hi Aneez,
    In the registry the URL(s) that you add are for the source, not target. So you will have something like;
    URL1=http://<portal>:<port>
    of course this would allow any code run from your portal to open exe files without a warning; so you can add the URLs of individual iViews to your registry if you want a bit more control from a security point of view.
    Where you launch the apps;
    javascript:launchApp('c:\windows\notepad.exe c:\autoexec.bat')"
    I think you can only launch one app at a time, here you pass one string containing the paths to two apps, pass one at a time to the launchApp function.
    Also, try adding four '\' characters each time instead of two, one an escape character for the Java compiler and one an escape character for the JavaScript in the browser.
    Temporarily add
    alert(strCmdLine);
    to your launchApp function to see the exact path that the function is trying to launch, make sure that this path contains one and only one '\' character at each point, eg "C:\Windows\notepad.exe". You can also put the
    obj.LaunchApplication(.....
    line in a try/catch block, put an alert in the catch and see if there's a problem with the JavaScript code trying to launch the app or if the problem is elsewhere.
    As far as using XP goes...... I've used LaunchInIE at a few customer sites but I don't think that any were using XP so I can't say that I've seen this working under XP. Perhaps on the WhirlyWiryWeb website you can find some info about whether or not you can expect this to work under XP.
    Perhaps, if there's another PC in or near your office that has access to your portal but doesn't have XP installed you can try it from there yourself and see if your code is working on that machine but not yours with XP installed.
    I hope this helps,
    Patrick.
    Edit.
    Of course if you're running this from some HTML file on your own harddisk and not from the portal for testing purposes then in your registry the URL that you need to add should be localhost, 127.0.0.1.
    Message was edited by: Patrick O'Neill

  • How to read a text file from other machine???

    I have a text file located in local machine. I use th e code below to retrieve data from that particular text file.
    String realPath     = (String)getServletContext().getRealPath("");
    BufferedReader holsFile = new BufferedReader(new FileReader(realPath + "/webpages/holidays.txt"));My question is , how could I retrieve the records from the tsxt file if the file is located in another machine or webserver?
    Thanks for advanced.

    It's ok to be new.
    The answer is yes. (But I'll let you look in the javadoc to see which package it's in).
    Also it may be worth understanding that there is no such thing as a "function" in java, operations are termed "methods". To go further, you should realise that URL is a class not a "function" or method. The parentheses mean you're calling the constructor.
    HTH
    /k1

Maybe you are looking for

  • Error in BO Webi using Authorization analysis in Bex with hierarchy display

    Hi Experts , When we run the WEBI report created on bex query which has 0comp_code restricted with characteristic variable  of processing type Authorization and Not ready for input. The hierarchy display is active in Bex (as we want to see L01, L02..

  • I can't download my Dark Knight digital copy.

    When I downloaed it for the first time it said that I have downloaded 1.67GB out of 1.67GB but the blue bar was still moving like it was still downloading, I went to my movies and couldn't play it. I then exited itunes to try again and I tried again

  • Performance Analysis Notes

    Hi, I want some "Performance Analysis Notes or material".. Plz give me some links or send me on my id: [email protected] Thanks...

  • Video FX problem

    I've used iMovie for a while and have never had any problems. Just recently though, when I try to apply a video effect it either doesn't add the effect or it adds the effect and then doesn't play the timeline properly. I have my clips laid out the wa

  • Using blank User ID in AE

    Hi all, Due to the fact that AE will overwrite an existing UserID if it already exists (see other threat), we try to change something in the workflow. It is still the target that AE will create the user account in the system by it self. Our idea was