JDBC vs excell csv file

Hi All,
Could JDBC API read off values from an excell csv file? Such that they could be transferred easily to JTables? Thanx again ^^

you could configure the "Microsoft Text Driver" (which is for CSV and text files), from 32-bit ODBC option of control panel in Windows Systems (if u r using windows).
Then u can query using normal JDBC SQL syntax,
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:myDsn");
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select * from myCsvFile.csv");
Priya.

Similar Messages

  • JDBC wrapper for CSV files?

    I wrote my own method to read in CSV files into a table structure (String[][]). For big CSV files, I added several functionalities to ignore specific data lines that have specific values. All this looks quite similar to a database table that I do a select * for and reduce the resulting rows via specific WHERE clause criterias. So I wonder if there's already such a JDBC wrapper around CSV files?

    Yes. I believe the JDBC-ODBC bridge can use an Excel URL to read in a CSV. Though don't quote me on that one.
    However, why not simply use your RDBMS data-import utility? You can invoke it from a scheduler or from Runtime.exec(). It should perform MUCH better than middleware for a huge CSV file. If manipulation needs to occur for the data, write it first to a temp table, then manipulate it.
    - Saish

  • Import data from excel/csv file in web dynpro

    Hi All,
    I need to populate a WD table by first importing a excel/CSV file thru web dynpro screen and then reading thru the file.Am using FileUpload element from NW04s.
    How can I read/import data from excel / csv file in web dynpro table context?
    Any help is appreciated.
    Thanks a lot
    Aakash

    Hi,
    Here are the basic steps needed to read data from excel spreadsheet using the Java Excel API(jExcel API).
    jExcel API can read a spreadsheet from a file stored on the local file system or from some input stream, ideally the following should be the steps while reading:
    Create a workbook from a file on the local file system, as illustrated in the following code fragment:
              import java.io.File;
              import java.util.Date;
              import jxl.*;
             Workbook workbook = Workbook.getWorkbook(new File("test.xls"));
    On getting access to the worksheet, once can use the following code piece to access  individual sheets. These are zero indexed - the first sheet being 0, the  second sheet being 1, and so on. (You can also use the API to retrieve a sheet by name).
              Sheet sheet = workbook.getSheet(0);
    After getting the sheet, you can retrieve the cell's contents as a string by using the convenience method getContents(). In the example code below, A1 is a text cell, B2 is numerical value and C2 is a date. The contents of these cells may be accessed as follows
    Cell a1 = sheet.getCell(0,0);
    Cell b2 = sheet.getCell(1,1);
    Cell c2 = sheet.getCell(2,1);
    String a1 = a1.getContents();
    String b2 = b2.getContents();
    String c2 = c2.getContents();
    // perform operations on strings
    However in case we need to access the cell's contents as the exact data type ie. as a numerical value or as a date, then the retrieved Cell must be cast to the correct type and the appropriate methods called. The code piece given below illustrates how JExcelApi may be used to retrieve a genuine java double and java.util.Date object from an Excel spreadsheet. For completeness the label is also cast to it's correct type. The code snippet also illustrates how to verify that cell is of the expected type - this can be useful when performing validations on the spreadsheet for presence of correct datatypes in the spreadsheet.
      String a1 = null;
      Double b2 = 0;
      Date c2 = null;
                        Cell a1 = sheet.getCell(0,0);
                        Cell b2 = sheet.getCell(1,1);
                        Cell c2 = sheet.getCell(2,1);
                        if (a1.getType() == CellType.LABEL)
                           LabelCell lc = (LabelCell) a1;
                           stringa1 = lc.getString();
                         if (b2.getType() == CellType.NUMBER)
                           NumberCell nc = (NumberCell) b2;
                           numberb2 = nc.getValue();
                          if (c2.getType() == CellType.DATE)
                            DateCell dc = (DateCell) c2;
                            datec2 = dc.getDate();
                           // operate on dates and doubles
    It is recommended to, use the close()  method (as in the code piece below)   when you are done with processing all the cells.This frees up any allocated memory used when reading spreadsheets and is particularly important when reading large spreadsheets.              
              // Finished - close the workbook and free up memory
              workbook.close();
    The API class files are availble in the 'jxl.jar', which is available for download.
    Regards
    Raghu

  • Which version of the Forms Central subscription will allow me to export data to excel (CSV file)?

    Which version of the Forms Central subscription will allow me to export data to excel (CSV file)?

    Hi Heather 349
    I believe you can do it with both FormsCentral Basic and FormsCentral PLUS
    Also Refer : Tutorial: Exporting Responses to Excel, CSV or PDF

  • VBscript to export local outlook machine's GAL to excel CSV file

    Hi,
    Any one help to provide me VBscript to do Export GAL to excel CSV  file in Local outlook system?
    Windows OS - 7
    Outlook version -2010 client
    MD

    VBscript related questions should be posted in the developers forum:
    https://social.msdn.microsoft.com/Forums/office/en-US/home?forum=outlookdev
    -Jeff

  • Dynamic Resource name for Excel/csv files

    Hi All,
    Reading from a source excel (as well as csv) file, I tried passing the resource name via a variable which is set to contain the name of the file (refresh). However, on execution, the file name shows up with an additional "\" character without being specified in the variable text causing the interface to face on load step.
    The error says:
    ODI-1227: Task SrcSet0 (Loading) fails on the source FILE connection <ConnNameHere>.
    Caused By: java.sql.SQLException: ODI-40438: File not found: C:\DirectoryNameHere\ /OTD.
    Is this expected behavior where one needs to escape the special character?
    I've verified that the extra / is not present in either the variable value or the directory for the Physical Schema.
    TIA.

    http://youtu.be/-QMV6cElgsk
    http://youtu.be/V7OzzZ3kYdc
    http://youtu.be/hNqqbZ4sJWA
    http://youtu.be/TMHzhtEwgrA
    http://youtu.be/REJDi584jh8
    http://youtu.be/jE6k5OfWqi0
    http://youtu.be/P3EKyykseps
    http://youtu.be/-QMV6cElgsk
    http://youtu.be/Gl7YvZohVVA
    http://youtu.be/zb1ue5BP9mI
    http://youtu.be/NhPDcc8n4VU
    http://youtu.be/tD_kw5QXmps

  • What´s the best approach to work with Excel, csv files

    Hi gurus. I got a question for you. According to your experience what's the best approach to work with Excel or csv files that have to be uploaded through DataServices to you datawarehouse.
    Let's say your end-user, who is not a programmer, creates a group of 4 excel files with different calculations in a monthly basis, so they can generate a set of reports from their datawarehouse once the files have been uploaded to tables in your DWH. The calculations vary from month to month. The user doesn't have a front-end to upload the excel files directly to Data Services. The end user needs to keep a track of which person uploaded the files for a determined month.
    1. The end user should place their 4 excel files in a shared directory that will be seen by DataServices.
    2. DataServices will execute certain scheduled job that will read the four files and upload them to the Datawarehouse at a determined time, lets say at 9:00pm.
    It makes me wonder... what happens if the user needs to present their reports immediately so they can´t wait until 9:00pm.  Is it possible for the end user to execute some kind of action (out of the DataServices Environment) so DataServices "could know" that it has to process those files right now, instead of waiting for the night schedule?
    Is there a way that DS will track who was the person who uploaded those files?
    Would it be better to build a front-end for the end user so they can upload their four files directlyto the datawarehouse?
    Waiting for your comments to resolve this dilemma
    Best Regards
    Erika

    Hi,
    There are functions in DS that captures the input files automatically. You could use file_exists() or wait_for_file() option to do that. Schedule the job to run every certain minute and if the file exists then run. This could be done by using a certain file name with date and timestamp etc or after running move the old files to archive and DS wait for new files to show up.
    Check this - Selective Reading and Postprocessing - Enterprise Information Management - SCN Wiki
    Hope this helps.
    Arun

  • How to read columns of a Microsoft Excel .csv file with LabVIEW?

    This should be simple.  Any ideas on how to read an Excel file with csv extension using LabVIEW?
    Thanks!

    Use the Read From SpeadSheet File.VI which you can find on the FILE I/O pallette.
    "Read From Spreadsheet File
    Reads a specified number of lines
    or rows from a numeric text file beginning at a specified character offset and
    converts the data to a 2D, single-precision array of numbers. You optionally can transpose the
    array. The VI opens the file before reading from it and closes it afterwards.
    You can use this VI to read a spreadsheet file saved in text format. This VI
    calls the Spreadsheet String
    to Array function to convert the data."
    The CSV file is essentially a text file which uses commas as delimiters in the files structure.

  • Working with Excel & CSV Files

    Hello Everyone,
    I am a newbie (well not even that really)! I am thinking of changing from PC to Mac. I have a question about Numbers - for if I can manage it, I don't want to have to buy Microsoft Office for Mac.
    I'm sure these questions are really simple and will make me look stupid, but I have to ask....Firstly, if I only have iWork installed can I still download Excel files onto the computer (to save and then open in Numbers)? Also can I save Numbers files as CSV files (I need to do this to upload data)?
    Those are the two main questions and I would like to thank any responses in advance.
    Cheers,
    Louise

    Hi there!
    First off, being a recent switcher, I'd definitely recommend the switch! Like you, I only bought iWork, and haven't had the need to purchase Office 2008, not that I would need (or like) to.
    I'll just quickly answer your questions, and then elaborate further below.
    -Yes, you can easily open Office 2003 and earlier Excel documents, as well as Office 2007 Excel documents.
    -Yes, you can also export your Numbers file as a CSV file.
    Now, further elaboration. While Numbers can easily open Office 2007, 2003 and earlier Excel files (.xls and .xlsx), as well as many other filetypes, it cannot simply save them as Excel can. For instance, you cannot open an Excel document, edit, and save it - you must save it as a Numbers (.numbers) file, and if you wish to share the document, there is an 'Export' option under the Share menu in the toolbar, through which you can export it as an Excel, PDF or CSV file. It's also worth noting that you can't export as Office 2007 documents as well, not that you should need to.
    Hopefully this answers your questions

  • HELP - Export Files from Data Set into Excel (CSV File)

    Hello,
    I was hoping someone could help me with adobe forms since this is the first time we have used this function at my work.  We created an enrollment form, posted it online and 700 employees completed the form (with the submit button it came back to my email).  I received all the forms and added them to the dataset in adobe.  Now that my forms are complete, I have tried several options to export them into a csv file and it is not working properly.  When I use the export button it only brings over 125 of the 700.  If I export by clicking on forms>manage form data>merge files into a spreadsheet it brings them all over but is moving my information on some of the rows.  For example, some names will be in the name column, some are under social security, etc.  I need the exact answer under the appropriate column becuase I can't tell which plan employees chose.  I would really appreciate if someone could help.  I have searched and searched for the reason this is doing this but I can't seem to locate an answer.  Is there another step that I'm missing?  Does anyone know why my rows are shifting?  We tried to test this before we used it and it seemed to work fine but we only used 5 files.  Please Please Please Help Me!  This enrollment file is due by tomorrow!
    Thank You,
    Mary

    I've moved your post to the Acrobat Windows user to user forums. You might also want to consider the Adobe moderated Acrobat forums here:
    http://www.acrobatusers.com/forums/aucbb/index.php 
    Kind Regards, 
    Michelle

  • How to load excel-csv file into oracle database

    Hi
    I wanted to load excel file with csv extension(named as trial.csv) into
    oracle database table(named as dept),I have given below my experiment here.
    I am getting the following error,how should I rectify this?
    For ID column I have defined as number(5) datatype, in my control file I have defined as interger external(5),where as in the Error log file why the datatype for ID column is comming as character?
    1)my oracle database table is
    SQL> desc dept;
    Name Null? Type
    ID NUMBER(5)
    DNAME CHAR(20)
    2)my data file is(trial.csv)
    ID     DNAME
    11     production
    22     purchase
    33     inspection
    3)my control file is(trial.ctl)
    LOAD DATA
    INFILE 'trial.csv'
    BADFILE 'trial.bad'
    DISCARDFILE 'trial.dsc'
    APPEND
    INTO TABLE dept
    FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    (ID POSITION(1:5) INTEGER EXTERNAL(5)      
    NULLIF ID=BLANKS,
    DNAME POSITION(6:25) CHAR
         NULLIF DNAME=BLANKS
    3)my syntax on cmd prompt is
    c:\>sqlldr scott/tiger@xxx control=trial.ctl direct=true;
    Load completed - logical record count 21.
    4)my log file error message is
    Column Name Position Len Term Encl Datatype
    ID           1:5 5 , O(") CHARACTER
    NULL if ID = BLANKS
    DNAME 6:25 20 , O(") CHARACTER
    NULL if DNAME = BLANKS
    Record 1: Rejected - Error on table DEPT, column ID.
    ORA-01722: invalid number
    Record 21: Rejected - Error on table DEPT, column ID.
    ORA-01722: invalid number
    Table DEPT:
    0 Rows successfully loaded.
    21 Rows not loaded due to data errors.
    0 Rows not loaded because all WHEN clauses were failed.
    0 Rows not loaded because all fields were null.
    Bind array size not used in direct path.
    Column array rows : 5000
    Stream buffer bytes: 256000
    Read buffer bytes: 1048576
    Total logical records skipped: 0
    Total logical records read: 21
    Total logical records rejected: 21
    Total logical records discarded: 0
    Total stream buffers loaded by SQL*Loader main thread: 0
    Total stream buffers loaded by SQL*Loader load thread: 0
    5)Result
    SQL> select * from dept;
    no rows selected
    by
    balamuralikrishnan.s

    Hi everyone!
    The following are the steps to load a excell sheet to oracle table.i tried to be as simple as possible.
    thanks
    Step # 1
    Prapare a data file (excel sheet) that would be uploaded to oracle table.
    "Save As" a excel sheet to ".csv" (comma seperated values) format.
    Then save as to " .dat " file.
    e.g datafile.bat
    1,Category Wise Consumption Summary,Expected Receipts Report
    2,Category Wise Receipts Summary,Forecast Detail Report
    3,Current Stock List Category Wise,Forecast rule listing
    4,Daily Production Report,Freight carrier listing
    5,Daily Transactions Report,Inventory Value Report
    Step # 2
    Prapare a control file that define the data file to be loaded ,columns seperation value,name and type of the table columns to which data is to be loaded.The control file extension should be " .ctl " !
    e.g i want to load the data into tasks table ,from the datafile.dat file and having controlfile.ctl control file.
    SQL> desc tasks;
    Name Null? Type
    TASK_ID NOT NULL NUMBER(14)
    TASK_NAME VARCHAR2(120)
    TASK_CODE VARCHAR2(120)
    : controlfile.ctl
    LOAD DATA
    INFILE 'e:\datafile.dat'
    INTO TABLE tasks
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    (TASK_ID INTEGER EXTERNAL,
    TASK_NAME CHAR,
    TASK_CODE CHAR)
    The above is the structure for a control file.
    Step # 3
    the final step is to give the sqlldr command to execute the process.
    sqlldr userid=scott/tiger@abc control=e:\controlfile.ctl log=e:\logfile.log
    Message was edited by:
    user578762

  • How can I pull data from an attached excel/csv file?

    I currently manage some price lists for the company I work for. They are graphical, and usually created in inDesign and then exported to pdf.
    I'm looking for a way to attach our company's prices in an excel sheet, (or delimited file) and be able to pull a price into the pdf.
    For example, attaching an excel file with 2 columns, SKU & Price. Then saying, if text field SKU= "APPLE" text field PRICE = "0.50". Only I don't want the user to have any inpurt options, I want to do this myself and then save a flat version to distribute in the company.
    Any ideas on how this could be accomplished (if it even could be?) I've been searching for the past week.
    Thank you in advance.
    (I have Acrobat X Pro)

    First, let me start off by saying thank you again for your help. I sincerely appreciate it.
    I have placed the following code into the document-level section of the javascript editor:
    var oFile = this.getDataObjectContents("Price.xls");
    var strData = util.stringFromStream(oFile, "utf-8");
    function ParseData( strData ){
    var objCollection = {}
    strData.replace(
    new RegExp( "\\[(\\w+)=([^\\]]*)\\]", "gi" ),
    function( $0, $1, $2 ){
    objCollection[ $1 ] = $2;
    return( objCollection );
    // Custom Calculate script for price text field
    (function () {
        // Get the value of the SKU field
        var sku = getField("SKU").valueAsString;
        // Look up the price
        var price = objCollection[sku];
        // Set the value of this field to the price if it's present,
        // otherwise blank this field
        event.value = price || "";
    And I have created a field SKU, which I placed a valid SKU value into. I also created a blank field called event for the price to populate into, but I have a strong feeling that this was the wrong approach.
    At any rate, I've recieved the following error in the javascript debugger:
    ReferenceError: objCollection is not defined
    89:Document-Level:ADBE::FileAttachmentsCompatibility
    Any idea what I may be doing wrong?
    Thanks again.

  • Newbie: BW Export to Excel/CSV file destination and file name

    Is it possible to control where the export of a BW web query is sent by appending the url with some tag voodoo? Also, can I create the file name of the exported file? I figured out how to kick off the export process, but haven't found any code to control the export destination or file name. I wish to skip over the save dialog and write the file to a specific location.

    Hello John,
    BW provides several ways to export data. Please look into Open Hub for example.
    Other options include Information Broadcasting in SAP NetWeaver '04 or MDX, XML Webservices, or OLAP BAPI.
    Regards,
    Marc
    SAP NetWeaver RIG, US BI

  • Loading a CSV file and accessing the variables

    Hi guys,
    I'm new to AS3 and dealt with AS2 before (just getting the grasp when the change it).
    Is it possible in AS3 to load an excel .csv file into Flash using the URLLoader (or ???) and the data as variables?
    I can get the .csv to load and trace the values (cell1,cell2,cell3....) but I'm not sure how to collect the data and place it into variables.
    Can I just create an array and access it like so.... myArray[0], myArray[1]? If so, I'm not sure why it's not working.
    I must be on the completely wrong path. Here's what I have so far....
    var loader:URLLoader = new URLLoader();
    loader.dataFormat = URLLoaderDataFormat.VARIABLES;
    loader.addEventListener(Event.COMPLETE, dataLoaded);
    var request:URLRequest = new URLRequest("population.csv");
    loader.load(request);
    function dataLoaded(evt:Event):void {
        var myData:Array = new Array(loader.data);
        trace(myData[i]);
    Thanks for any help,
    Sky

    just load your csv file and use the flash string methods to allocate those values to an array:
    var myDate:Array = loader.data.split(",");

  • Problem importing a CSV file with forward slashes in a column

    I have an Excel csv file of a product database (contains about 6500 products) that contains product codes with forward slahes such as 499/1, 499/3, 499/5.
    These are different sizes of a product and as such have different prices etc.
    When I import the file into Numbers these numbers appear as 499, 166 1/3, and 99 4/5 respectively.
    What seems to be happening is that Numbers is interpreting the forward slash (/) as a divide by command and subsequently performing a calculation on that number on import and hence totally changing the value of the cell so that it is impossible to look up the price related to a product as the product code no longer exists.
    Excel can import these files with no problems, why can't Numbers treat each cell as text and leave it alone on import.
    Is there any way round this or do I have to revert to using Excel for the import of csv files.
    Thanks
    Steve

    I know I'm a bit(!) late (a year) coming to this party, but there is a simple solution, that worked for me, enclose the field in double quotes, and add a single quote before the number:
    Instead of
    499/1,"Super Widget 3",12.34
    do
    "'499/1","Super Widget 3",12.34
    In fact the single (unclosed) quote without double-quotes works as well:
    '499/1,"Super Widget 3",12.34
    I've always found it better to enclose strings with double quotes. This works on loading the file into Mac Numbers and should work with Excel too if that helps. It opens with OpenOffice 4 on the Mac too - if you select "comma" in the "Separated by" checkbox
    I can't remember where I picked this info up....
    Hope this helps someone, albeit late.
    Andy

Maybe you are looking for