Parse dBase .dbf file

Hello,
We're writing a java application that needs to read in a .dbf file and eventually insert (via JDBC) into our Oracle 10g database. I wanted to know if Oracle had an API to read in the column Names, column count, row count, and read in each row.
Thanks,
Jim

I do not believe Oracle provides any APIs. Pl see if this link helps - http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:711825134415
HTH
Srini

Similar Messages

  • Heterogeneous Services & Oracle Generic Connectivity for dbase DBF file

    Dear All,
    Can we use Heterogeneous Services & Oracle Generic Connectivity for creating dbase DBF file or Writing in dbase DBF file?
    I have used it for Excel and Access for connectivity with Oracle 9i
    but I dont have any idea about dbase DBF file?
    Any help in this reagards will be highly appriciatalble.
    Thanks
    Rana

    I wouldn't think so these days ... however, you could try posting this in the heterogeneous services - which is somewhere on OTN.
    If it we me, I'd convert the DBF into something easier to use with Oracle : like XML or CSV

  • How to convert an ascii file into dBase .dbf file type

    Does any one out there know how to convert an ascii file(which is generated from PL/SQL script) into a .dbf (dBaseIII) file type? Thanks in advance.

    I haven't worked with dBase for about 20 years, but I seem to recall it having an IMPORT command for that purpose. But maybe I'm wrong...

  • Problems accessing Dbase DBFs

    Hello!
    I need to import the contens of dbase DBF file into an oracle DB.
    The problem is, that I get a connection error using the microsoft odbc diver for dbase.
    The whole thing works with jbuilder(same driver and same dbf-file).
    I wanted to port the code from jbuilder to jdeveloper but I'm stuck at the beginning right now.
    My second problem is that I cannot deploy a BC4J application to a simple jar file.
    The whole thing becomes 40 mb big. This is ridiculous! The dependency analyzer takes eons to check the lib-dependencies and the resulting jar won't run because of missing class-files.
    Please help!
    Thanx in advance!

    Hello!
    I need to import the contens of dbase DBF file into an oracle DB.
    The problem is, that I get a connection error using the microsoft odbc diver for dbase.
    The whole thing works with jbuilder(same driver and same dbf-file).What are you doing where it fails? Please provide some more details.
    I wanted to port the code from jbuilder to jdeveloper but I'm stuck at the beginning right now.
    My second problem is that I cannot deploy a BC4J application to a simple jar file.
    The whole thing becomes 40 mb big. This is ridiculous! The dependency analyzer takes eons to check the lib-dependencies and the resulting jar won't run because of missing class-files.How are you deploying it? As a simple archive, WAR file?
    Thanks,
    Rob

  • Heterogeneous Services & Oracle Generic Connectivity For DBF file?

    Dear All,
    Can We Create dbf file directly means without using CSV file?
    Can we use Heterogeneous Services & Oracle Generic Connectivity for creating dbase DBF file or Writing in dbase DBF file?
    I have used it for Excel and Access for connectivity with Oracle 9i
    but I dont have any idea about dbase DBF file?
    Any help in this reagards will be highly appriciatalble.
    Thanks
    Rana

    HSODBC/DG4ODBC is generic connectivity and you find the generic setup in:
    Note.109730.1 How to setup generic connectivity (HSODBC) for 32 bit Windows (Windows NT, Windows 2000, Windows XP, Windows 2003)
    There is nothing sepcial for DBF's. Just define a system ODBC DSN using a DBASE ODBC driver pointing to the DBF file.
    The rest is absolute similar to the note.
    If you have already a running HSODBC/DG4ODBC the quickest test is to just define a new system dsn for the DBF file, then change in the init>hsodbc/dg4odbc>.ora file the HS_FDS_CONNECT_INFO parameter pointing to the newly created system DSN. Last step is within the Oracle db to define a database link.

  • .How to Change Path to dbf files Using Visual FoxPro ODBC Driver

    Using vb.Net 2008, full Crystal 2008.
    I have a Crystal report that uses a Visual FoxPro File DSN pointing at a folder with dbase (.dbf) files. 
    I need to be able to change the folder location at runtime. In the RDC, one key part of this has been specifying a connection string, such as:
    "Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=" & gs_FileDSN_Path & ";Exclusive=No;Collate=Machine;Null=Yes;BackgroundFetch=No;"""""""
    However, I can't find any .NET documentation confirming this syntax and, even more importantly, where does it go?
    I tried 2 variations as:
                    reportTableLogonInfo.ConnectionInfo.Attributes.Collection.Add(New NameValuePair2("Connection String", ls_ConnectionString))
                    reportTableLogonInfo.ConnectionInfo.Attributes.Collection.Add(New NameValuePair2("ConnectionString", ls_ConnectionString))
    Followed later by   TableN.ApplyLogOnInfo(reportTableLogonInfo)before calling
    But I don't know if the correct attribute name is "Connection String", "ConnectionString", or something else.
    I also tried to set the connection string to the QE_ServerDescriptions property, as in:
    reportTableLogonInfo.ConnectionInfo.Attributes.Collection.Add(New NameValuePair2("QE_ServerDescription", ls_ConnectionString))
    None of these variations nr many others seem to work.
    BOTTOM LINE:
    Could someone provide sample code for overriding the dbase files folder location specified by a Visual FoxPro FileDSN?
    Thanks!

    OK, I came to the conclusion that the tables or the report somehow hold on to the File DSN for dear life and I can't change that fact.
    So I'm going to change my approach and instead of changing the connection properties of the tables, I'll modify the properties of the File DSN on the fly.  Ugly, but an OK solution for my use scenario.
    It would still be great to get a code sample for the original question but, it's no longer a burning issue for me.
    It would be nice if the support team created a document describing in detail how to achieve database location changes using .NET for different scenarios. It's a common need and the RDC object model had such a document.

  • .dbf file interaction in coldfusion

    How to use dbase (.dbf) file in ColdFusion. How to connect the same, datasource creation and query to get data?
    This is for windows?

    I think this will depend on what version of coldfusion and windows you are running.
    If they are quite old this link may point you in the right direction - Connecting to dBASE/FoxPro Databases
    Otherwise if you have CF 10+ you can do something like this - Connecting ColdFusion 10 to FoxPro 9 | CFchimp

  • Storing DBF (DBase IV) file to database

    hi all,
    i need to load a dbf (dbase IV) file from forms9i into the oracle10g database. my problem is they don't want to convert first the dbf file to csv format (which could have made my life easier) manually to prevent accidental alteration of the file's contents. i know there are tools that could handle this but the reason why i need to do it from forms is that i have to do plsql processing right after the loading.
    looking forward to your help,
    dong

    correction: we are using forms 10g and 9i database

  • Connect to dbf file from jsp with servletexec??

    I am trying to connect to a dbf file from a jsp page on an win2003Server with ServletExec. But i get the exception "no suitable driver".
    It works fine with the exact same code and file on my winxp machine. This is the connectionstring: url = "jdbc:odbc:;DRIVER=Microsoft dBase VFP Driver (*.dbf);Sourcedb=E:\\Data\\der\\Solutions;Sourcetype=dbf";
    I can create a "Microsoft dBase VFP Driver" odbcConnection from the controlPanel and than use the connection from MicrosoftAccess and it works as it should. But I can't use it from the jsp code like this: url="jdbc:odbc:testdriver" .
    It feels like I am missing something in servletexec. Like a classpath to the odbcdriver. But in all my other installations I have not done anything more than installed the servletexc correctly and added the classpath for parser.jar and jaxp.jar.
    Am I missing something here???
    Zoktrax

    Try putting a Class.forName( "my.jdbc.DriverClass" ) before DriverManager.getConnection( url, user, password ), where "my.jdbc.DriverClass" is the fully-qualified class name of the JDBC driver class. I think that JDBC driver classes have static initializers that register the driver class with the DriverManager. I had a similar problem and the Class.forName( ) fixed it.
    If that doesn't work, double-check your URL.
    - Jesse

  • Crystal Report Performance for dbf files.

    We have a report which was designed 5 -6 years ago. This report has 4 linked word doc and dbf file as datasource. This report also as 3 subreports. The size of field in dbf is 80 chars and couple of field are memo field. The report performance was excellent before we migrated the crystall report to 2008. After CR2008 the system changed and it is suddenly really slow. We have not change our reports so much it should have an influence on performance. When the user presses the preview button on printing tool window the control is transferred to Crystal. Something has happened inside black box of Crystal ( IMO ).   the dll we have are crdb_p2bxbse.dll 12.00.0000.0549 . The issues seems to be of xbase driver (not possible to use latest version of crdb_p2bxbse.dll and dbase files with memo fields).

    Hi Kamlesh,
    Odd that the word doc is opened before the RPT, I would think that the RPT would need to be opened first so it sees that the doc also needs to be opened. Once it's been loaded then the connection can be closed, CR embeds the DOC in the RPT so the original is no longer required.
    Also, you should upgrade to Service Pack 3, it appears you are still using the original release. SP1 is required first but then you should be able to skip SP2 and install SP3.
    You did not say what earlier version of Cr you were using? After CR 8.5 we went to full UNICODE support at which time they completely re-built the report designer and removed the database engines from the EXE and made them separate dll's now. OLE objecting also changed, you can use a formula and database field to point to linked objects now so they can be refreshed any time. Previously they were only refreshed when the report was opened.
    You may want to see if linking them using a database field would speed up the process. Other than that I can't suggest anything else as a work around.
    Thank you
    Don

  • Parsing an xml file using xerces DOM  parser

    Hi
    I want to parse a simple xml file using DOM parser.
    The file is
    <Item>
         <SubItem>
              <title>SubItem0</title>
              <attr1>0</attr1>
              <attr2>0</attr2>
              <attr3>0</attr3>
         </SubItem>
         <SubItem>
              <title>SubItem1</title>
              <attr1>1</attr1>
              <attr2>0</attr2>
              <attr3>0</attr3>
         </SubItem>
         <SubItem>
              <title>SubItem2</title>
              <attr1>1</attr1>
              <attr2>1</attr2>
              <attr3>0</attr3>
              <SubItem>
                   <title>SubItem20</title>
                   <attr1>2</attr1>
                   <attr2>1</attr2>
                   <attr3>0</attr3>
              </SubItem>
              <SubItem>
                   <title>SubItem21</title>
                   <attr1>1</attr1>
                   <attr2>1</attr2>
                   <attr3>0</attr3>
              </SubItem>
         </SubItem>
    </Item>
    I just want to parse this file and want to store the values in desired datastructures,
    I am trying using DOM parser, since it gives a tree structure, which is ok in this case.
    public void init()
              InputReader ir     =new InputReader("Habsys");
              Document      doc     =ir.read("Habitat");
              System.out.println(doc);
              traverse(doc);
    private void traverse(Document idoc)
              NodeList lchildren=idoc.getElementsByTagName("SubItem");
              for(int i=0;i<lchildren.getLength();i++)
                   String lgstr=lchildren.item(i).getNodeName();
                   if(lgstr.equals("SubItem"))
                        traverse(lchildren.item(i));
    private void traverse (Node node) {
    int type = node.getNodeType();
    if (type == Node.ELEMENT_NODE)
    System.out.println ("Name :"+node.getNodeName());
    if(!node.hasChildNodes())
    System.out.println ("Value :"+node.getNodeValue());
    NodeList children = node.getChildNodes();
    if (children != null) {
    for (int i=0; i< children.getLength(); i++)
    traverse (children.item(i));
    But I am not getting required results, a lot of values I am getting as null
    Could anybody tell me how to retrieve the data from the xml file, I simply want to read data and store it in data structures. For eg, for tag Subitem with title as ' SubItem1' has attr1 as '1', attr2 as'0' and attr3 as '0'.
    Thanks
    Gaurav

    Check This Sample Code....
    public void amethod(){
    DocumentBuilderFactory dbf = null;
    DocumentBuilder docBuilder = null;
    Document doc = null;
    try{
         dbf = DocumentBuilderFactory.newInstance();
         db = dbf.newDocumentBuilder();
         doc = db.parse(New File("path/to/your/file"));
         Node root = doc.getDocumentElement();
         System.out.println("Root Node = " + root.getNodeName());
         readNode(root);
    }catch(FactoryConfigurationError fce){ fce.printStackTrace();
    }catch(ParserConfigurationException pce){  pce.printStackTrace();
    }catch(IOException ioe){  ioe.printStackTrace();
    }catch(SAXException saxe){  saxe.printStackTrace();
    private void readNode(Node node) {
    System.out.println("Current Node = " + node.getNodeName());
    readAttributes(node);
    readChildren(node);
    private void readAttributes(Node node) {
    if (!node.hasAttributes())
         return;
    System.out.println("Attributes:");
    NamedNodeMap attrNodes = node.getAttributes();
    for (int i=0; i<attrNodes.getLength(); i++) {
    Attr attr = (Attr)attrNodes.item(i);
    System.out.println(attr.getNodeName() + " => " + attr.getNodeValue());
    private void readChildren(Node node) {
    if (!node.hasChildNodes())
         return;
    System.out.println("Value/s:");
    NodeList childNodes = node.getChildNodes();
    for (int i=0; i<childNodes.getLength(); i++) {
    Node child = (Node)childNodes.item(i);
    if (child.getNodeType() == Node.ELEMENT_NODE) {
    readNode(child);
    continue;
    if (child.getNodeType() == Node.TEXT_NODE) {
    if (child.getNodeValue()!=null)
    System.out.println(child.getNodeValue());

  • Reading foxpro dbf files from forms6i

    hi all,
    can anyone tell me how can i read a dbf file and access data from that.
    Thanks
    Uday

    Exec_Sql Package allows you to acess non Oracle Database
    You will have to follow following steps as follows:-
    1-First Find OCA.PLL and EXEC_SQL.PLL libraray.
    2-Attach Both libraries to ur concerned Forms.
    3-Create VFP odbc driver.
    3-Create a Button to write follwing codes on WHEN-BUTTON-PRESSED trigger or u can write
    these code on any Trigger as you required.
    Decalre
    conidodbc exec_sql.conntype;
    B varchar2(100);
    C varchar2(100);
    curid exec_sql.cyrstype;
    sqlstr varchar2(1000);
    nres pls_integer;
    Begin
    --This exec_sql.open_connection Procedure connect your 
    --non Oracle Database through ODBC Driver
    coniidodbc:=exec_sql.open_connection
    ('scott/tiger@odbc:yourodbcdivername');
    --exec_sql.opne_cursor return the curid of your non
    --Oracle Database
    curid:=exec_sql.opne_cursor(conidodbc);
    --It is Your non Oracle Database Statement follow there
    --Syntax rule of your non Oracle Database Syntax
    sqlstr:='Select A from yourdbffilename ';
    --exec_sql.Parse procedure parse your Stement to non
    --Oracle Database
    exec_sql.Parse(connidodbc,curid,sqlstr,exec_sql.V7);
    --After succesful Parsing it Executes your Ststment
    nres:=exec_sql.execute(conidodbc,curid);
    --exec_sql.Define column mapping for your local
    --variable to Non Oracle Database Column
    exec_sql.Define column (conidodbc,curid,B,30);
    while (Exec_Sql.fetch_rows(conidodbc,curid)>0)
    loop
    --Exec_Sql.column_value intiliaze your Non Oracle
    --Database to your Local Variable
    Exec_Sql.column_value (conidodbc,curid,1,B);
    C:=B;
    message('C value '||C);
    end loop;
    End;
    --Rest Explanation About Exec_Sql Package Find Help in
    --You Forms Still If any Problem then add me on MSN my id
    --is [email protected] may be I can help you more
    Thanks
    Khurram Siddiqui

  • Can Document Builder parse an XML file from a URL?

    Warning: Java newbie here...
    My problem is that I am able to parse an XML file if it is copied into my project, but not if it is a full URL. Here is what I got so far, that works.
    import java.io.*;
    import java.net.*;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    try {
        File file = new File("path/to/file.xml");
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        DocumentBuilder db = dbf.newDocumentBuilder();
        Document doc = db.parse(file);
        doc.getDocumentElement().normalize();
        NodeList nodeLst = doc.getElementsByTagName("Names");
        for (int s = 0; s < nodeLst.getLength(); s++) {
            Node parentNode = nodeLst.item(s);
            if (parentNode.getNodeType() == Node.ELEMENT_NODE) {
                Element parentElmnt = (Element) parentNode;
                NodeList nameElmntLst = parentElmnt.getElementsByTagName("Name");
                //etc.
    } catch (Exception e){
        e.printStackTrace();
    }So building off of this I have tried to parse an input stream like this:
    URL url = new URL("http://example.com/file.xml");
    InputStream is = url.getInputStream();
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    DocumentBuilder db = dbf.newDocumentBuilder();
    Document doc = db.parse(is);which gives me the following error
    [Fatal Error] :-1:-1: Premature end of file.
    LOG: HME receiver connected
    org.xml.sax.SAXParseException: Premature end of file.
    I also even tried to write the file locally like this:
    URL url = new URL("http://example.com/file.xml");
    HttpURLConnection urlcon = (HttpURLConnection) url.openConnection();
    urlcon.connect();
    InputStream is = urlcon.getInputStream();
    File file = new File("path/to/file.xml");
    OutputStream out = new FileOutputStream(file);
    byte buf[] = new byte[1024];
    int len;
    while((len=is.read(buf))>0)
        out.write(buf,0,len);
    out.close();
    is.close();
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    DocumentBuilder db = dbf.newDocumentBuilder();
    Document doc = db.parse(file);This gives the same error.
    If anyone can point me in the right direction I would forever thankful. I've tried search Google and the Sun forums, but haven't quite found the solution. I think it is because I need to try something else completely. Thank you for reading.
    ~~~~ Jeremy

    jmose wrote:
    If I copy the page, it works as shown in the first code block. In the third codeblock the file is never even created, so I cannot tell if that works or not.So: having the parser access the URL fails, and having some other Java code access the URL also fails in the identical way? That suggests the problem is simply accessing the URL via Java code. Presumably when you downloaded the data from the URL, you used a browser to do it and not wget or something like that?

  • Create .dbf file from Forms 6i

    Hello,
    I know how to create a text file with Only col of tables in Text File(*.txt) using Text_io Package.
    How To get the same Output as DBF File(*.dbf) directly so that there is no Extra overhead of converting *.txt to *.dbf using Visual Foxpro?
    Thanks in Advance

    You can use the Exec_SQL package.
    The following code successfully copies the EMP form block into a emp.dbf file.
    The ODBC Data Source "prashanth" must be configured.
    declare
      fox_tab  EXEC_SQL.conntype;
      cur      EXEC_SQL.curstype;
      ret      pls_integer;
    begin
      begin -- Delete emp.dbf
        fox_tab := exec_sql.open_connection(null, null, 'ODBC:prashanth');
        cur := EXEC_SQL.open_cursor(fox_tab);
        EXEC_SQL.parse(fox_tab, cur, 'drop table emp ');
        ret := exec_sql.execute(fox_tab, cur);
      exception 
        when OTHERS then NULL;
      end;
    -- create new emp.dbf file
    EXEC_SQL.parse(fox_tab, cur, 
        'create table emp (EMPNO INTEGER,'||
                          'ENAME CHAR(10),'||
                          'JOB CHAR(9),'||
                          'MGR NUMBER,'||
                          'HIREDATE DATE,'||
                          'SAL NUMBER,'||
                          'COMM NUMBER,'||
                          'DEPTNO NUMBER)');
    ret := exec_sql.execute(fox_tab, cur);
    Go_Block('EMP');
    execute_query;
    loop
      EXEC_SQL.parse(fox_tab, cur, 
         'insert into emp(EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO)'||
                          values('||:EMP.EMPNO||','''||:EMP.ENAME||''','''||
                          :EMP.JOB||''','||
                          NVL(TO_CHAR(:EMP.MGR), 'NULL')||','''||
                          TO_CHAR(:EMP.HIREDATE, 'DD-MON-YYYY')||''','||
                          NVL(TO_CHAR(:EMP.SAL), 'NULL')||','||
                          NVL(TO_CHAR(:EMP.COMM), 'NULL')||','||
                          NVL(TO_CHAR(:EMP.DEPTNO), 'NULL')||')');
      ret := exec_sql.execute(fox_tab, cur);
      if :system.last_record = 'TRUE' then exit; else next_record; end if;
    end loop;
    EXEC_SQL.close_cursor(cur);
    EXEC_SQL.close_connection(fox_tab);
    end;

  • Select DBase (.dbf) data from Oracle on Linux

    How to select DBase (.dbf) data from Oracle on Linux ?
    dbf files connected to Linux form NetWare server as 'ncpmount'.
    Oracle has access as oracle 'Directory' object.

    If you have an ODBC driver for it and are using Oracle 10g you can use Generic Connectivity. For more information on Generic Connectivity refer to the Chap 7 of the Heterogeneous Connectivity Administrator's Guide.
    http://download-west.oracle.com/docs/cd/B13789_01/server.101/b10764/gencon.htm#1005900

Maybe you are looking for

  • Sales Order - order reason - cost element error in PO creation

    Good day Friends, We have a third party order scenario in our group among different company codes (FI-SD).   This scenario is working fine among the existing companies. Now there is a requirement from finance department to capture the revenues at dif

  • Issue with opening PDF files from the web Acrobat 8.1.4

    Hello everyone I just found out about this problem today, and it manifests in such a manner that when you try to open a PDF document on the web, it hangs for a while, and then the standard message about Adobe Acrobat not being able to open the docume

  • Imposible descarga del Acrobat Reader después desinstalar WSP2

    !Hola! Yo tenía instalado el Adobe Reader en mi PC y cometí el atrevimiento de querer instalar el programa gratuito Windows SP2. A partir de ahí todo han sido problemas y he tenido que desinstalarlo. He descubierto que no me funciona ya el Adobe y he

  • IDVD finished project plays in 4:3 ration on my widescreen 16:9???

    I did my whole project in 16:9 ratio and when I burnt the DVD through iDVD it was set up as 16:9 ratio. When I play the DVD on my TV(Samsung 50" plasma) it cuts the left and right ends of as if it was made in 4:3 ratio. I'm stuck and need help!!!!!!

  • Best way to prepare an iMac for sale?

    I have a 2007 24" iMac I would like to sell. I had upgraded it to 4 GB of RAM and it is running Mavericks. I would like to offer it with Mavericks installed. What's the best way to "reset it all" so my stuff is all cleared out, and the new owner will