How to transfer a set of data from Excel spread sheet to an Access database

hi,
Can any one please tell me how to transfer a set of data from Excel spread sheet to an Access database using SQL query.I'm using java API currently. I have done all sorts of ODBC connection in administrative tools.The file is in correct location. I have done certain coding but with errors.Help me to get rid of these errors,
Coding:*
try
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection datacon=DriverManager.getConnection("jdbc:odbc:exdata","",""); *//For Excel driver*
Connection datacon1=DriverManager.getConnection("jdbc:odbc:stock1","",""); *// For mdb driver*
Statement datast=datacon.createStatement();
Statement datast1=datacon1.createStatement();
ResultSet excelrs=datast.executeQuery("select item_code,sdata,closing_stock from phy "); *//phy is the excel file*
while(excelrs.next())
String ic=excelrs.getString("item_code");
System.out.println(ic);
String d=excelrs.getString("sdate");
double cs=excelrs.getDouble("closing_stock");
int dbrs=datast1.executeUpdate("insert into second values('"+ic+"','"+d+"',"+cs+")"); *//second is the mdb*
excelrs.close();
}catch(Exception e)
System.out.println(e);
Error:*
java.sql.SQLException: [Microsoft][ODBC Excel Driver] The Microsoft Jet database engine could not find the object 'C:\JavaGreen\phy.xls'. Make sure the object exists and that you spell its name and the path name correctly.
thanks,
kumar.

JAVA_GREEN wrote:
No i haven't mixed up.But the file from where i have to retrieve the data is in csv format.Even though i created another csv driver.and tried but i cud not find a solution to load/transfer a set of records from one file(in Excel/csv format) to another file(in mdb format).plz help me.Is there any other methods for this data transfer.A csv file is NOT an excel file.
The fact that Excel can import a csv file doesn't make it an excel file.
If you have a csv file then you must use a csv driver or just use other code (not jdbc) to access it. There is, normally, a ODBC (nothing to do with java) text driver that can do that.

Similar Messages

  • How to export data from a spread sheet which has multiple work sheets?

    How to export data from a spread sheet which has multiple work sheets to a single text file with fixed length fields?

    Hello s1,
    saving them as CSV will not give a fixed legth output but, as the naming says, a Character Separated Value file.
    Regards
    Marcus

  • Problem in writing data to excel spread sheet

    Hi Folks,
    I have developed a jdbc application that writes data to excel spread sheet.while trying to write data to excel, it could not write date values properly.it is writing 00.00.0 for all the date feilds.
    Can some one help here.
    Thanks in advance.

    You can try VistaJDBC at http://www.easyhr.com.au/software/easy_mdb_mde_compactor.htm .
    Otherwise you can write your code to csv/xml/dbase III format, since Excel can open those file format easily.

  • How to transfer BLOB type of data from SQL Server to Oracle

    Hi,
    Actually, I create a table with BLOB type data in SQL server. In fact, there is not exact BLOB type in SQL server, it will be separated to image and ntext types. But there is exact BLOB type in Oracle.
    I don't know how to transfer this "BLOB" type into Oracle with DTS or any other methods.
    Many Thanks for your any suggestions,
    Cathy

    JAVA_GREEN wrote:
    No i haven't mixed up.But the file from where i have to retrieve the data is in csv format.Even though i created another csv driver.and tried but i cud not find a solution to load/transfer a set of records from one file(in Excel/csv format) to another file(in mdb format).plz help me.Is there any other methods for this data transfer.A csv file is NOT an excel file.
    The fact that Excel can import a csv file doesn't make it an excel file.
    If you have a csv file then you must use a csv driver or just use other code (not jdbc) to access it. There is, normally, a ODBC (nothing to do with java) text driver that can do that.

  • Problem in writing data to excel spread sheet using jdbc

    Hi Friend,
    I have written a jdbc application ,that retrives data from oracle8i database and writes to excel spread sheet.
    Here I am facing a problem while writing date vales to the spread sheet.
    It is just writing 00.00.0 , instead of a date like 21/10/2005, where I am going wrong , can any one guide me.
    Thanks in advance.

    Don't cross-post!
    http://forum.java.sun.com/thread.jspa?threadID=643815&tstart=0
    Especially when you already got your answer in the other post jackass. If you don't understand the answer then say so there.

  • How to use a servlet to display an excel spread sheet onto a browser?

    Hi, I have a problem here, I couldn't display an excel spread sheet onto a browser..Can anybody enlighten me on how to go about it?
    Thanks

    Hi, I tried to refresh the 'application/vnd.ms-excel'
    page by calling it again from another frame...it give me a blank page.
    Does it means that the excel sheet cannot be reopen once it's open?
    thanks

  • How to transfer SOME apps + app data from one iPad to another

    I have an iPad1 that has tons of apps on it (I call it my app graveyard).
    I have an iPad2 that has my primary apps and this is the iPad that I use on a daily basis.
    I want to move an App and the Saved Data from the iPad1 to the iPad2. How do I do this?
    Again, I don't want to restore everything... just a couple of Apps + their SAVED data from my iPad1 to my iPad2.
    Any help would be greatly appreciated!

    When you restore from a backup - the process is an "all or nothing" deal. You restore all app data and settings. You cannot select just one set of app data to restore.
    You can download the one app only to the other iPad but you cannot restore the data from just one app. It's just not possible to do.

  • Can somebody tell me how to transfer iPhone/iPod backup data from my old computer to a new one?

    Is it possible for me to transfer the backup data of my iPod touch and iPhone from my old computer to a new one? I don't own any Macs, only PCs. My backup data are saved on a PC (desktop) which has Windows XP SP2 as its OS and I am planning to transfer my iPod/iPhone backup data to a laptop with Windows 7 as its OS. Is it possible? If so, can someone tell me the step-by-step procedure on how to do this, including how to find the folder where my backup data is stored. I would be very much grateful. Thanks a lot for those who may be able to help me with this matter.  ^_^
    P.S. I am planning to use an external hard disk to transfer my backup data to the new computer.
    Message was edited by: Angeal_Hewley03

    Ah, I see. In that case your life will be much easier if you convert your library back into a portable format before you attempt to migrate it.
    The normal location for the iTunes Library.itl file is the iTunes folder at <User's Music>\iTunes though it is possible that you have previously moved the library separately from moving the media folder, or you could have your media stored outside the designated iTunes Media folder.
    Here are the typical layouts for the iTunes folders:
    In the layout above, with the media folder (everything in the red box) inside the library folder, the library is considered to be portable. You can rearrange things to make a split library portable by taking a number of small steps which don't break the library.
    Before you start any media files that are outside of the designated media folder will need to be consolidated. N.b. Your iTunes Media folder location should be on the target drive that you are going to build the portable library on. If you have the bulk of your library is stored in a folder on an external drive that is not currently designated as the iTunes Media folder then change this property (Edit > Preferences > Advanced) before consolidating.
    If the library is in the old style layout then it should ideally be be upgraded to iTunes Media Organisation (Library > Organise Library > Rearrange files in the folder <Media Folder>) to ensure that iPod Games, Mobile Applications etc. are brought inside the media folder.
    The basic non-fatal manipulations are:
    You can connect to an alternate set of library files by holding down Shift (Win) or Option (Mac) when starting iTunes.
    You can move the library files to a new location as long as the media stays put.
    You can move the library files and the media together if the media folder is a direct subfolder of the library folder.
    If you have already moved/copied the media content from a subfolder of the library folder to a different location then you only need to copy the library files for it to appear as if you have moved the entire library in the way allowed above. I.e. just copy the library files into the parent folder of the media folder.
    You can rename the media folder to iTunes Media (if it isn't already) if the media folder is inside the library folder.
    iTunes uses the name of the folder holding the library files as the window title. Having made a library "portable" you may need to take a final step of renaming the library folder to iTunes or, if the library files have ended up at the root of a drive, moving all of the library files and content folders into a new folder called iTunes.
    After each change you need to open, test and close the relevant library before attempting another change. If a change broke the library, undo it or revert to using the previous set of library files.
    In essence all you need to do to make your library portable is copy the library files into the parent folder of the media folder on the external/secondary drive and use the hold-down-shift/option-when-starting-iTunes method to connect to it. Other manipulations may be required to normalize the library so that the library and media folders have standard names.
    tt2

  • How to transfer iTunes Library/iPhone data from PC to Mac?

    Hi,
    I have just started using my Mac Mini. This is my first mac.
    I need to copy my iTunes Library from my PC to Mac.
    I searched for a solution and most of them advise to simply copy the iTunes folder to my Mac.
    The problem is I am not sure if this approach will preserve my album ratings/playlist/playcounts/album art.
    Most important, I wonder if this will transfer my iPhone data as well or not.
    My contacts and stuff on iPhone are crucial to me. I need to be able to plug in my iPhone to my Mac and not be worried about losing my previous data.
    Any suggestions?
    I am running leopard and am on wifi. I can transfer files over wifi.

    The Apple store will do this for you.
    You can call Apple Support and they will walk you through it.
    You can type "move itunes library from pc to mac" into the google search bar.

  • How to Get and Set personalization data from Iview with Java Webdynpro ?

    Hi All,
    I'm trying to get Iview properties from an Iview in the portal, did anyone knows how to do this?
    sample caode?
    Thanks,
    AmitY

    You can use PCD API to access iView properties
    Check this link
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/314ae7a5-0c01-0010-c198-9c7c5e8cee46
    /people/daniel.wroblewski/blog/2006/08/15/pcd-ii-creating-portal-objects

  • How to generate web page from Excel spread sheet?

    I have a spreadsheet containing a long string of HTML text.  It can be viewied below and each line needs to be one web page.  I also have the same file in a flat text file.
    Header 1
    Header 2
    Header 3
    <h3 style="text-align:center;">Minutes of the Annual Meetings of the Brethren: 1778 - 1917</h3>
    <p style="text-align: center;"><a href="images/books/001/220.png" title="Page 220 — Minutes of the Annual Meetings of the Brethren" rel="rokbox[600 905](demo)"><img src="images/books/001/220.png" border="0" alt="Page 220 — Minutes of the Annual Meetings of the Brethren [Click for larger image]" title="Page 220 — Minutes of the Annual Meetings of the Brethren [Click for larger image]" width="500" height="754" /></a><span style="text-align: center; display: block; margin-top: 6px;">Page 220</span></p>
    <p style="display:none;"> </p>
    <h3 style="text-align:center;">Minutes of the Annual Meetings of the Brethren: 1778 - 1917</h3>
    <p style="text-align: center;"><a href="images/books/001/221.png" title="Page 221 — Minutes of the Annual Meetings of the Brethren" rel="rokbox[600 905](demo)"><img src="images/books/001/221.png" border="0" alt="Page 221 — Minutes of the Annual Meetings of the Brethren [Click for larger image]" title="Page 221 — Minutes of the Annual Meetings of the Brethren [Click for larger image]" width="500" height="754" /></a><span style="text-align: center; display: block; margin-top: 6px;">Page 221</span></p>
    <p style="display:none;"> </p>
    I need Dreamweaver CS4 to take this spreadsheet and generate a series of web pages.  The head section will be the same for all the generated HTML files.  A sample page can be viewed here.
    If I can locate a script that will do this then I can take an extension for a Joomla web site and pass along the series of page to it.  The Joomla extension will then create my articles for me.
    Cordially,
    Wayne

    Thanks for the thought, but that generates one large page with each row an item on the page.  What I need is for DW to take each row and create a page of that row.  Even then, in Excel you have to insert rows before my first row of data.  Into thos rows you paste the head information doctype, metadata, the closing head, etc., etc.  Then you have to add a row at the end closing the body and html statements.
    I'll have to try this with something else.  For something so simple you'd figure there was a script to do it.
    Cordially,
    Wayne

  • Return set of data from function

    Dear All
    How can i return set of data from from funtion into database?
    Thanks

    http://asktom.oracle.com/tkyte/ResultSets/index.html
    http://www.oracle-base.com/articles/8i/UsingRefCursorsToReturnRecordsets.php

  • How do I transfer my applications and data from one Mac to another?

    I am buying a new Macbook, anyone know how do I transfer my applications and data from old MacBook to New one?

    Or you can be guided bt this 'officail' Apple support document:
    http://support.apple.com/kb/PH4441
    Ciao.
    Csound 1 greetings:  Nothing wrong with a little plagiarism.

  • How can we transfer huge amount of data from database server to xml format

    hi guru
    how can we transfer huge amount of data from database server to xml format.
    regards
    subhasis.

    Create ABAP coding
    At first we create the internal table TYPES and DATA definition, we want to fill with the XML data. I have declared the table "it_airplus" like the structure from XML file definition for a better overview, because it is a long XML Definition (see the XSD file in the sample ZIP container by airplus.com)
    *the declaration
    TYPES: BEGIN OF t_sum_vat_sum,
              a_rate(5),
              net_value(15),
              vat_value(15),
             END OF t_sum_vat_sum.
    TYPES: BEGIN OF t_sum_total_sale,
            a_currency(3),
            net_total(15),
            vat_total(15),
            vat_sum TYPE REF TO t_sum_vat_sum,
           END OF t_sum_total_sale.
    TYPES: BEGIN OF t_sum_total_bill,
            net_total(15),
            vat_total(15),
            vat_sum TYPE t_sum_vat_sum,
            add_ins_val(15),
            total_bill_amount(15),
           END OF t_sum_total_bill.TYPES: BEGIN OF t_ap_summary,
            a_num_inv_det(5),
            total_sale_values TYPE t_sum_total_sale,
            total_bill_values TYPE t_sum_total_bill,
           END OF t_ap_summary.TYPES: BEGIN OF t_ap,
            head    TYPE t_ap_head,
            details TYPE t_ap_details,
            summary TYPE t_ap_summary,
           END OF t_ap.DATA: it_airplus TYPE STANDARD TABLE OF t_ap
    *call the transformation
    CALL TRANSFORMATION ZFI_AIRPLUS
         SOURCE xml l_xml_x1
         RESULT xml_output = it_airplus
         .see the complete report: Read data from XML file via XSLT program
    Create XSLT program
    There are two options to create a XSLT program:
    Tcode: SE80 -> create/choose packet -> right click on it | Create -> Others -> XSL Transformation
    Tcode: XSLT_TOOL
    For a quick overview you can watch at the SXSLTDEMO* programs.
    In this example we already use the three XSLT options explained later.
    As you can see we define a XSL and ASX (ABAP) tags to handle the ABAP and XML variables/tags. After "

  • HT1688 how do I transfer apps, messaging, and data from my old iphone to my new iphone

    how do I transfer apps, messaging, and data from my old iphone to my new iphone

    firstly sync your old iphone,then connect your new iphone and sync from backup.

Maybe you are looking for

  • J1INQEFILE - Quarterly TDS Returns

    Hi Experts, When I am excuting the quaterly returns, we are not getting all the documents in the list. Reason: Challan number (J_1IINTCHLN) is not updated in the with_item table. But already accounting document is cleared. How to update this challan

  • How Can we improve the report performance..?

    Hi exports, I am learning the Business Objects XIR2, Please let me know How Can we improve the report performance..? Please give the answer in detailed way.

  • Ajax autocomplete on a tabular column

    Hello, Is it possible to add the autocomplete functionm of denes on a tabular column and how can i do that? Thanks for your help I think the problem resides in referencing the item in the register function how can I pass the id of the object in the t

  • Edit a downloaded document

    I downloaded a lease/rental form off the internet and wish to be able to edit it.  Not sure how to make the document editable.  Thanks  Using OS X 10.6.8

  • How can i records with date format using web services?

    Hello I can't record date records using web services. I get no message errors. I can import string values but no dates (YYYY-MM-DD). Do you have any clue about that? Regards Arturo