Using Ms-Excel sheet as a Database.

Hi,
I want to use MS-Excell spread sheet as a data source and insert and retrive records from it.
I want to use the spread sheet for Inserting rows and deleting rows from Java application. Can I use it from Java.sql package and use the factory methods as DriverManager and get the connetion Interface.
Can any one please help in this regrard.
Thanks in advance.
Vamshi

--you can try this!
try {
              Connection con=null;
              ResultSet rs=null;
              Statement stat=null;
              Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
               String myDB = "jdbc:odbc:Driver={Microsoft Excel Driver (*.xls)};DBQ=d:/tangofox/prac/book1.xls;"+
                               "DriverID=22;READONLY=true";
               con=DriverManager.getConnection(myDB, "", "");
               stat=con.createStatement();
               rs=stat.executeQuery("Select * from `Sheet1$`");//[Sheet1$]
               while(rs.next())
                  System.out.println (rs.getString(1));
               stat.executeUpdate("Insert into 'Sheet1$' values ('yes!')");
          rs.close();
          stat.close();
          con.close();
         catch (Exception err) {
         }

Similar Messages

  • How to use a excel sheet as a database.

    Using JSP i have to use a Excel sheet as a database.ie, i have to store and fetch data into or from a Excel Sheet and execute SQL Queries. Is it possible?
    If possible please give a sample code for that if anybody have the sample code.

    Hi Louis,
    [Here|http://img125.imageshack.us/my.php?image=exceltestlo7.jpg] is the result of your data.  I downloaded your excel sheet and created a simulated service in 7.1.1 and it works fine.
    Below are the steps:
    1. Go to Tools -> service component wizard
    2. The popup opens : Step1 :  Enter the name of your service component
    3. Go to Excel spreadsheet Copy the data for which the service needs to be created.
    4. Step 2 : Paste the copied Excel data in the popup
    5. Step 3 : Define Input -> just click next
    6. Step 4: Define Conditions -> just click finish.
    Let me know if it helps.
    Good Luck,
    Dharmi

  • How to store an excel sheet in oracle database

    How can I store excel sheet into oracle.

    Or you could use Heterogenous Services to treat Excel as an external database:
    1- Go to Control Panel>Administrative Tools>Data Sources (ODBC)>System DSN and create a data source with appropriate driver. Name it EXCL.
    2- In %ORACLE_HOME%\Network\Admin\Tnsnames.ora fie add entry:
    EXCL =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.12.0.24)(PORT = 1521))
    (CONNECT_DATA =
    (SID = EXCL)
    (HS = OK)
    Here SID is the name of data source that you have just created.
    3- In %ORACLE_HOME%\Network\Admin\Listener.ora file add:
    (SID_DESC =
    (PROGRAM = hsodbc)
    (SID_NAME = <hs_sid>)
    (ORACLE_HOME = <oracle home>)
    under SID_LIST_LISTENER like:
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = d:\ORA9DB)
    (PROGRAM = extproc)
    (SID_DESC =
    (GLOBAL_DBNAME = ORA9DB)
    (ORACLE_HOME = d:\ORA9DB)
    (SID_NAME = ORA9DB)
    (SID_DESC =
    (PROGRAM = hsodbc)
    (SID_NAME = EXCL)
    (ORACLE_HOME = D:\ora9db)
    Dont forget to reload the listener
    c:\> lsnrctl reload
    4- In %ORACLE_HOME%\hs\admin create init<HS_SID>.ora. For our sid EXCL we create file initexcl.ora.
    In this file set following two parameters:
    HS_FDS_CONNECT_INFO = excl
    HS_FDS_TRACE_LEVEL = 0
    5- Now connect to Oracle database and create database link with following command:
    SQL> CREATE DATABASE LINK excl
    2 USING 'excl'
    3 /
    Database link created.
    Now you can perform query against this database like you would for any remote database.
    SQL> SELECT table_name FROM all_tables@excl;
    TABLE_NAME
    DEPT
    EMP

  • Store objects like word files, excel sheet, pics in database

    Hi guys,
    I want to store objects like word files, excel sheet, pics in one of my column in a table.
    what shud be the datatype of my column if i am using oracle 9i release 1.
    and how to store these files in database????? how is it possible thru forms.
    regards,
    Imran Baig

    On OTN is a demo File Upload Utility for Forms 9i/10g
    The demo for 6i can be found here

  • Xcelcius using updated excel sheets?

    Hello,
    My excel sheet looks something like this
    A1         A2         A3        A4         A5
    10          20         30      <null>     <null>
    I have created a column chart using the values from A1 to A5, and supressing null values using the properties of the chart. And i have exported this as a flash file. Now the flash file displays 3 bars in the column chart, as expected.
    My requirement is that when the values A4 and A5 are updated in the excel sheet, I want the flash file column chart also to display these values immediately without having to re-create the column chart in xcelcius.
    Is this possible? If so, could you pls provide some pointers?
    Regards,
    Suraj.

    Hello Suraj,
    If I understand it correctly, you just have to import the new excel-file in Xcelsius, than the column-chart takes the new values in A4 and A5 automatically. And now you have to create a new flash-file.
    Precondition: you have selected A1 until A5 in the column-chart and you have selected "Ignore blank cells" in "Behaviour" of column chart.
    Hope, it helps
    Regards, Larissa

  • Uploading Data From Excel Sheet to SAP Database Tables

    Dear Friends,
    We are having an Excel Sheet with 90 different columns. Now we want only 2 of the columns to be uploaded in the database tables. So, Plz tell me which function module will be suitable for this. And plz help me with the code also.
    Thanks,
    Nishant Jain

    Hi Nishu,
    A sample for the same..
    data it_excel like table of ALSMEX_TABLINE with header line.
    here we retrieve only 2 cols directly..
    now itab will contain only 2 cols of all rows seperated by comma ..
    data str(1000).
    data itab like table of str with  header line.
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      EXPORTING
        filename                      = 'C:sample1.xls'
        i_begin_col                   = 1
        i_begin_row                   = 1
        i_end_col                     = 2
        i_end_row                     = 100
      tables
        intern                        =  it_excel
      LOOP AT it_excel.
        AT NEW row.
          CLEAR itab.
        ENDAT.
        IF itab IS INITIAL.
          MOVE it_excel-value TO itab.
        ELSE.
          CONCATENATE itab ',' it_excel-value INTO itab.
        ENDIF.
        AT END OF row.
          APPEND itab.
        ENDAT.
      ENDLOOP.
    regards
    satesh

  • Report using excel sheet as data source not working when deployed to production.

    I have a set of SSRS reports that use an excel sheet as a datasource.
    Now when I preview the reports or run them in the Visual Studio IDE on my local machine i.e
    the development machine, the reports run fine & display all correct results.
    However, when we deploy the reports to the Production machine which is on a separate server,
    the following error message is displayed :
    "The current action cannot be completed. The user data source credentials do not meet the requirements to run this report. Either the user data source credentials are not stored in the report server database, or the user data source is configured not to
    require credentials but the unattended execution account is not specified. (rsInvalidDataSourceCredentialSetting)"
    I've copy pasted the connection string used for connecting to the excel file as reference :
    Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\MyFolder\CurrentFile.xlsx;Extended Properties="Excel 12.0;HDR=Yes;";
    The excel file has also been uploaded to the machine housing the reporting server (i.e to C:\MyFolder location)

    Hi Aaakar,
    From the error message, please try to change the setting of Credential type for the data source on report manager as follows:
    Go to the Data Sources properties page.
    For the Connect Using option, select Credentials stored securely in the report server.
    In User Name and Password, type credentials that can be used to access the database. If you are using SQL Server as the data source, the user name must be valid for both logging on to the server and for accessing the database that contains the data for
    the report.
    If the user name and password are credentials for a Windows account, select Use as Windows Credentials.
    If you want the report server to pass the credentials of the user accessing the report to the server hosting the external data source, click Windows Integrated Security. In this case, the user is not prompted to type a user name or password.
    For more details about Configure Data Source Properties, please see:
    http://technet.microsoft.com/en-us/library/ms155882.aspx
    Hope this helps.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Data Migration from MS   Excel Sheet to Oracle 9i Database

    Can anyone please help me to perform a data migration from MS excel sheet to Oracle 9i Database. I have an excel sheet from which i need to move data to the database. One of the columns in the sheet posseses multiple new line characters, and which causes a problem while migrating data with the help of SQL Loader. I would like to know whether any utility is available to migrate data directly from MS Excel sheet to the database, or it would he really helpfull for me , if anyone provide me with an alternate solution.

    I think Christian's suggestion will work for easily and quickly.
    1) create table link of Oracle target table in MS Office's ACCESS thru ODBC;
    2) from Access screen, you may easily dump the excel data into the linked table.
    This is very easy and feasible ways. Don't bother to find other ways. The other ways will need you to clear the unwanted carriage return signs first.

  • Urgent - Migrate data from Excel sheets

    Hello all..
    I want to move data from excel sheets into oracle9i Database
    I have a bout 50 table with average of 5000 row per table
    How could I do it
    I will be so obligated if you could detail it for me
    Thanks in advance

    I want to insert data using loader in the table Tablename
    Name Type
    CL_CL_CODE NUMBER(3)
    SUBCL_CODE VARCHAR2(50)
    SUBCL_NAME NUMBER(2)
    P_CODE_LENTH NUMBER(3)
    SCE_NAME VARCHAR2(50)
    I use this statement:
    load data
    infile 'D:\Sqlldr\load.dat'
    replace
    into table subclasses
    FIELDS TERMINATED BY ";" OPTIONALLY ENCLOSED BY '"'
    (CL_CL_CODE,SUBCL_CODE,SUBCL_NAME,P_CODE_LENTH SCE_NAME)
    I need to use default value for the column SCE_NAME,P_CODE_LENTH
    what is the formula for this
    Thanks

  • How to develope application for converting excel data into oracle database

    I am very new to the oracle world. I want to develop application for converting excel sheet into oracle database using oracle forms. I have basic knowldge of oracle but i am totally new to the forms. Can anybody tel me step by step procedure to do this task? Please help me out in this problem.
    Thanx in advance.

    Hello,
    just do a "Search" in this forum with words "excell to oracle"... and you could find lot of posts about that, i.e.:
    Re: How to load excel-csv file into oracle database
    Jose L

  • Displaying an excel sheet in iframe

    hai all,
         I need the step by step process to display excel sheet in iframe UI element.
    I have the excel sheet stored in database as text object.All i need to do is get the excel sheet displayed in iframe on click of a button.
    Plz help me with codings and steps involved for this.
    Thanks n Regards
    Sharanya.R

    Hi sharnya,
    Refer
    Re: Read excel in webdynpro without using odbc (points awarded!)
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/edc2f3c2-0401-0010-8898-acd5b6a94353
    Regards,
    P.Manivannan

  • Issue with downloaing from ALV to Excel sheet

    Hi All,
    When we download the ALV Report to excel sheet, the first line/first column (A11) of excel sheet will have today's date.
    Since my customer uses the excel sheet for further processing into a non-SAP system, we need to provide the excel sheet with the cell A11 (First line's firls column) as blank.
    How can we deliver this requirement?
    Your help will be sincerely appreciated....
    Regards
    Pavan

    One option is there
    Give him 1 push button on toolbar other wise you can write below function module in
    start of selection code also.
    1 ) modify u r internal table according to requirement.
    2) after that call WS_DOWNLOAD function module.
    Check below code for u r reff.
    *Modify itab according to u r requirement.
         Loop at IST_DWN.
            IST_DWN-KUNNR2_DESC = SPACE.
            IST_DWN-KUNNR3_DESC = W_ZPPCSR-KUNNR3_DESC .
            APPEND IST_DWN.
            CLEAR DATE.
          ENDLOOP.
    *F4 Help for file menu
    CALL FUNCTION 'F4_FILENAME'
            IMPORTING
              FILE_NAME = PATH.
          RLGRAP-FILETYPE = 'DAT'.
    Download fm
          CALL FUNCTION 'WS_DOWNLOAD'
            EXPORTING
              FILENAME         = PATH
              FILETYPE         = RLGRAP-FILETYPE
              MODE             = XMODE
            IMPORTING
              FILELENGTH       = L_FILELENGTH
            TABLES
              DATA_TAB         = IST_DWN
            EXCEPTIONS
              FILE_OPEN_ERROR  = 1
              FILE_WRITE_ERROR = 2
              OTHERS           = 3.
    Salil ...

  • If data in Excel sheet Refreshes will it reflect in Xcelsius (html view)

    I have created one excel sheet which has data from 2 excel sheets. I have created this excel sheet using excel macros. I am using this excel sheet as input for the xcelsius. Everything is working fine.
    But when the data in thr excel sheet is modified it is not getting reflected in Xcelsius.
    I have gone through the online material available. But that asks for xml source. I am not using xml as the source for my excel sheet. I am using excel sheet as the source.
    Is it possible to update the data in any version of Xcelsius (4.5 or 2008)?

    There is an article that can explain how Xcelsius Engage 2008 and higher (not Present) can use XML to update your presentations from a modified Excel spreadsheet. View it  [here|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/502f3f56-f17d-2b10-a5bf-a85f12a9c30a]. Another useful tutorial on how it's done is available here [Part 1|http://datapigtechnologies.com/flashfiles/xxmlpart1.html] and [Part 2|http://datapigtechnologies.com/flashfiles/xxmlpart2.html].

  • Field length shows more in excel sheet which is sent via email

    I am sending excel sheet through email. I have data in internal table which i move to the email internal table and data is been sent via email using a excel sheet.
    Now, when I open the excel sheet, i see that all fields get displayed but the last field is shown as too much length meaning field length is 15 chars but in excel sheet it shows as almost 40 - 50 chars.

    Decalre one more field in your internal table ,which should be last field.
    and do not pass header for this field and just pass the empty value to this field.
    if not use this FM : EXCEL_OLE_STANDARD_DAT
    Reward Points if it is helpful
    Thanks
    Seshu

  • How to import tablesfrom excel sheet to database using sqldeveloper

    hi dear,
    i have lots of tables without data in excell sheet. i want to import all the tables in to data base using sql developer .how to import pls help me

    No one here is your 'dear' so please don't use such terms.
    Whenever you post provide your sql developer version.
    >
    i have lots of tables without data in excell sheet. i want to import all the tables in to data base using sql developer
    >
    You will need to provide an example of what you mean by a table without data.
    What database and what version. What do you expect to end up with in the database after such an 'import'?

Maybe you are looking for

  • How do I share iTunes library between different versions of iTunes

    I have an old motorola powerPC based iMac which is running Mac OS 9. The latest iTunes version for the old Mac is 9.2.  I also have various computers including an Intel Mac and other Windows PCs that run the latest iTunes version 10.6.3. When I tried

  • 2014 Mac Mini won't detect Dell monitor on startup

    On a cold start or waking from sleep it is necessary to reset the PRAM in order for the Mini to recognize a Dell P2014H.  Restarts are not a problem. This was not an issue with an older MacBook Pro or an Air at the Genius Bar.  I have resolved this b

  • Hyperlink issues in InDesign CS5 and CS6

    This might be obvious, but it's driving me insane. I'm highlighting text and linking to external URL's from InDesign.  In InDesign it seems to keep rewriting the hyperlinks?  When I highlight and change it to a specific URL, I'll highlight another on

  • ORA 22813 in merge statement

    hi gems..good afternoon... My database version is 11.2.0.1.0 64 bit Solaris OS. I am facing an "ORA-22813: operand value exceeds system limits" while running a procedure. I have used loggers and found that it is getting failed in a MERGE statement. T

  • Oracle 9.2.0.3, fatal error with DBMS_AQADM.CREATE_QUEUE_TABLE

    Hi All, I installed Oracle 9.2.0.1 and patched it with 9.2.0.3 on a Solaris 10 Sun 280R machine. I deleted the initially created database instance and created a new one using dbca after the patch installation. However, when I am tring to install the