{"id":38604534,"url":"https://github.com/albfernandez/javadbf","last_synced_at":"2026-01-17T08:36:40.347Z","repository":{"id":36097606,"uuid":"40398736","full_name":"albfernandez/javadbf","owner":"albfernandez","description":"Java library for reading and writing Xbase (dBase/DBF) files.","archived":false,"fork":false,"pushed_at":"2025-12-23T18:32:22.000Z","size":1204,"stargazers_count":236,"open_issues_count":11,"forks_count":103,"subscribers_count":28,"default_branch":"main","last_synced_at":"2025-12-24T10:51:41.090Z","etag":null,"topics":["java"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/albfernandez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING.LESSER","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2015-08-08T09:53:36.000Z","updated_at":"2025-12-23T18:32:25.000Z","dependencies_parsed_at":"2025-05-14T23:23:27.021Z","dependency_job_id":"06c7c2de-dbff-4e00-92ac-f9e72d0c5515","html_url":"https://github.com/albfernandez/javadbf","commit_stats":null,"previous_names":[],"tags_count":51,"template":false,"template_full_name":null,"purl":"pkg:github/albfernandez/javadbf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albfernandez%2Fjavadbf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albfernandez%2Fjavadbf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albfernandez%2Fjavadbf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albfernandez%2Fjavadbf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/albfernandez","download_url":"https://codeload.github.com/albfernandez/javadbf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albfernandez%2Fjavadbf/sbom","scorecard":{"id":178143,"data":{"date":"2025-08-11","repo":{"name":"github.com/albfernandez/javadbf","commit":"9b405b734fe90a3689c384f9dcce20010bb945c3"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.7,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1","Warn: no topLevel permission defined: .github/workflows/maven.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":10,"reason":"SAST tool detected: CodeQL","details":["Info: SAST configuration detected: CodeQL","Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/albfernandez/javadbf/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/albfernandez/javadbf/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:53: update your workflow using https://app.stepsecurity.io/secureworkflow/albfernandez/javadbf/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:67: update your workflow using https://app.stepsecurity.io/secureworkflow/albfernandez/javadbf/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/maven.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/albfernandez/javadbf/maven.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/maven.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/albfernandez/javadbf/maven.yml/main?enable=pin","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: COPYING.LESSER:0","Info: FSF or OSI recognized license: GNU Lesser General Public License v3.0: COPYING.LESSER:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v.1.14.1 not signed: https://api.github.com/repos/albfernandez/javadbf/releases/137787131","Warn: release artifact v.1.14.0 not signed: https://api.github.com/repos/albfernandez/javadbf/releases/81736634","Warn: release artifact v.1.13.3 not signed: https://api.github.com/repos/albfernandez/javadbf/releases/81702504","Warn: release artifact v.1.13.2 not signed: https://api.github.com/repos/albfernandez/javadbf/releases/48702542","Warn: release artifact v.1.13.1 not signed: https://api.github.com/repos/albfernandez/javadbf/releases/44441976","Warn: release artifact v.1.14.1 does not have provenance: https://api.github.com/repos/albfernandez/javadbf/releases/137787131","Warn: release artifact v.1.14.0 does not have provenance: https://api.github.com/repos/albfernandez/javadbf/releases/81736634","Warn: release artifact v.1.13.3 does not have provenance: https://api.github.com/repos/albfernandez/javadbf/releases/81702504","Warn: release artifact v.1.13.2 does not have provenance: https://api.github.com/repos/albfernandez/javadbf/releases/48702542","Warn: release artifact v.1.13.1 does not have provenance: https://api.github.com/repos/albfernandez/javadbf/releases/44441976"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'","Warn: branch protection not enabled for branch 'version_zero_pentaho_like'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-16T18:13:45.233Z","repository_id":36097606,"created_at":"2025-08-16T18:13:45.233Z","updated_at":"2025-08-16T18:13:45.233Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28504369,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T06:57:29.758Z","status":"ssl_error","status_checked_at":"2026-01-17T06:56:03.931Z","response_time":85,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java"],"created_at":"2026-01-17T08:36:39.779Z","updated_at":"2026-01-17T08:36:40.334Z","avatar_url":"https://github.com/albfernandez.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JavaDBF\nJavaDBF is a Java library for reading and writing XBase files.\nThere are plenty of legacy applications around with .dbf as their primary storage format.\nJavaDBF was initially written for data transfer with such applications.\n\n# License\n\nJavaDBF is LGPL\n\nhttps://www.gnu.org/licenses/lgpl.txt\n\n# Introduction\n\nTill late 90s dBase and its cousins were the most preferred database platform for small and even medium enterprise applications.\nThey required low hardware configurations and were cheaper to develop. \nEventually more capable desktop databases like Microsoft Access came into picture,\nDBF file format still remains one of the simplest way to store and transfer data.\n\n\n# News and changes in version 1.0.0\n\n## Possible breaking changes\n\nJavaDBF 1.0.0 is the first release considered stable. It has a lot of improvements and is almost compatible with\nold code. But there are some small changes that may break your code:\n\n* Numeric and Double types (N and F) are now returned as BigDecimal instead of Double.\n* DBFException is now a RuntimeException, not need to explictitly catch or rethrow, but yo can if you wish.\n* Character data is now trimmed tailing white spaces. You can disable it calling reader.setTrimRightSpaces(false)\n\n## News\n* Support for dbase Level 7 databases.\n* Support for new field types.\n  * Support for memo text and binary types (M, B, G, P) via external file (fpt or dbt)\n  * Support for varchar (V) fields\n  * Support for double (O) fields\n  * Support for double (B) fields\n  * Support for long character (up to 65534 bytes) fields\n   \n\n\n# Getting and Installing\n\nObtain the latest version of JavaDBF from release page at github.\nDownload the jar file and put it in your $CLASSPATH variable. You are ready to go. \n\n## Getting with Maven\nIf you are using Maven, you can add JavaDBF to your project using this dependency in your pom.xml\n\n```\n\t\u003cdependency\u003e\n\t\t\u003cgroupId\u003ecom.github.albfernandez\u003c/groupId\u003e\n\t\t\u003cartifactId\u003ejavadbf\u003c/artifactId\u003e\n\t\t\u003cversion\u003e1.13.1\u003c/version\u003e\n\t\u003c/dependency\u003e\n```\n\n\n# Overview of the Library\n\nJavaDBF has a simple API of its own and it does not implement the JDBC API. \nIt is designed this way because JavaDBF is not intended to support full-blown RDBMS-style database interaction.\nAnd you are not supposed to use it like a back-end; it just doesn't work that way. \nAlso, JavaDBF is not designed to be thread-safe; keep that in mind when you design multithreaded applications.\n\nJavaDBF comes in the package com.linuxense.javadbf. \nImport that package in your Java code. Following examples will familiarise you with its APIs. \n\n# Data Type Mapping\n\nJavaDBF supports almost all XBase data types. \nWhile reading, those types are interpretted as appropriate Java types.\nFollowing tables shows the mapping scheme.\n\n\n## Read and write supported types\n\n| XBase Type    | XBase Symbol | Java Type used in JavaDBF |\n|------------   | ------------ | ---------------------------\n|Character      | C            | java.lang.String          |\n|Numeric        | N            | java.math.BigDecimal      |\n|Floating Point | F            | java.math.BigDecimal      |\n|Logical        | L            | java.lang.Boolean         |\n|Date           | D            | java.util.Date            |\n\n\n## Read supported types\n\n| FoxPro Type           | Symbol | Java Type used in JavaDBF |\n| --------------------- | ------ | ------------------------- |  \n| Currency              | Y      | java.math.BigDecimal      |\n| Long                  | I      | java.lang.Integer         |\n| Date Type             | T      | java.util.Date            |\n| Timestamp             | @      | java.util.Date            | \n| AutoIncrement         | +      | java.lang.Integer         |\n| Memo                  | M      | java.lang.String or byte[]|\n| Binary                | B      | byte[] or java.lang.Double|\n| Blob                  | W      | byte[]                    |\n| General               | G      | byte[]                    |\n| Picture               | P      | byte[]                    |\n| VarBinary             | Q      | byte[]                    |\n| Varchar               | V      | java.lang.String          |\n| Double                | O      | java.lang.Double          |\n\n\n\n\n\n\n\n# Reading a DBF File\n\nTo read a DBF file, JavaDBF provides a DBFReader class. \nFollowing is a ready-to-compile, self-explanatory program describing almost all feature of the DBFReader class. \nCopy/paste this listing and compile it. Keep a .dbf file handy to pass to this program as its argument.\n\n```java\nimport java.io.*;\nimport com.linuxense.javadbf.*;\n\npublic class JavaDBFReaderTest {\n\n\tpublic static void main(String args[]) {\n\n\t\tDBFReader reader = null;\n\t\ttry {\n\n\t\t\t// create a DBFReader object\n\t\t\treader = new DBFReader(new FileInputStream(args[0]));\n\n\t\t\t// get the field count if you want for some reasons like the following\n\n\t\t\tint numberOfFields = reader.getFieldCount();\n\n\t\t\t// use this count to fetch all field information\n\t\t\t// if required\n\n\t\t\tfor (int i = 0; i \u003c numberOfFields; i++) {\n\n\t\t\t\tDBFField field = reader.getField(i);\n\n\t\t\t\t// do something with it if you want\n\t\t\t\t// refer the JavaDoc API reference for more details\n\t\t\t\t//\n\t\t\t\tSystem.out.println(field.getName());\n\t\t\t}\n\n\t\t\t// Now, lets us start reading the rows\n\n\t\t\tObject[] rowObjects;\n\n\t\t\twhile ((rowObjects = reader.nextRecord()) != null) {\n\n\t\t\t\tfor (int i = 0; i \u003c rowObjects.length; i++) {\n\t\t\t\t\tSystem.out.println(rowObjects[i]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// By now, we have iterated through all of the rows\n\n\t\t} catch (DBFException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tfinally {\n\t\t\tDBFUtils.close(reader);\n\t\t}\n\t}\n}\n```\n\n# Reading a DBF File using field names\n\n\nFrom JavaDBF 1.7.0 you can use field names to access data. \nYou must use nextRow instead nextRecord\n\n```\t\n\nimport java.io.*;\n\nimport com.linuxense.javadbf.*;\n\npublic class JavaDBFReaderWithFieldNamesTest {\n\n\n\tpublic static void main(String args[]) {\n\n\t\tDBFReader reader = null;\n\t\ttry {\n\n\t\t\t// create a DBFReader object\n\t\t\treader = new DBFReader(new FileInputStream(args[0]));\n\n\t\t\t// get the field count if you want for some reasons like the following\n\n\t\t\tint numberOfFields = reader.getFieldCount();\n\n\t\t\t// use this count to fetch all field information\n\t\t\t// if required\n\n\t\t\tfor (int i = 0; i \u003c numberOfFields; i++) {\n\n\t\t\t\tDBFField field = reader.getField(i);\n\n\t\t\t\t// do something with it if you want\n\t\t\t\t// refer the JavaDoc API reference for more details\n\t\t\t\t//\n\t\t\t\tSystem.out.println(field.getName());\n\t\t\t}\n\n\t\t\t// Now, lets us start reading the rows\n\n\t\t\tDBFRow row;\n\n\t\t\twhile ((row = reader.nextRow()) != null) {\n\t\t\t\tSystem.out.println(row.getString(\"PHONE\"));\n\t\t\t}\n\n\t\t\t// By now, we have iterated through all of the rows\n\n\t\t} catch (DBFException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tfinally {\n\t\t\tDBFUtils.close(reader);\n\t\t}\n\t}\n}\n\n```\n\n# Reading a DBF File with memo file\n\nYou can specify memo file to read Memo fields from. If you don't specify this file this fields will be filled with null\n\n```java\nimport java.io.*;\nimport com.linuxense.javadbf.*;\n\npublic class JavaDBFReaderMemoTest {\n\n\tpublic static void main(String args[]) {\n\t\tDBFReader reader = null;\n\t\ttry {\n\n\t\t\t// create a DBFReader object\n\t\t\treader = new DBFReader(new FileInputStream(args[0]));\n\n\t\t\treader.setMemoFile(new File(\"memo.dbt\"));\n\n\t\t\t// do whatever you want with the data\n\n\t\t} catch (DBFException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tDBFUtils.close(reader);\n\t\t}\n\t}\n}\n\n```\n\n# Writing a DBF File\n\nThe class complementary to DBFReader is the DBFWriter. While creating a .dbf data file you will have to deal with two aspects: \n\n1. define the fields and \n2. populate data. \n\nAs mentioned above a dbf field is represented by the class DBFField. First, let us familiarise this class.\n\n## Defining Fields\n\nCreate an object of DBFField class:\n\n```java\n\tDBFField field = new DBFField();\n\tfield.setName(\"emp_name\"); // give a name to the field\n\tfield.setType(DBFDataType.CHARACTER); // and set its type\n\tfield.setLength(25); // and length of the field\n```\n\nThis is, now, a complete DBFField Object ready to use. \nWe have to create as many DBFField Objects as we want to be in the .dbf file. \nThe DBFWriter class accept DBFField in an array. \nNow, let's move on to the next step of populating data.\n\n## Preparing DBFWriter Object\n\nA DBFWriter is used for creating a .dbf file. First lets create a DBFWriter object by calling its constructor \nand then set the fields created (as explained above) by calling the setFields method.\n\n```java\n\tOutputStream os = // wathever output you want to use\n\tDBFWriter writer = new DBFWriter(os);\n\t// fields is a non-empty array of DBFField objects\n\twriter.setFields(fields); \n```\nNow, the DBFWriter Object is ready to be populated. \nThe method for adding data to the DBFWriter is addRecord and it takes an Object array as its argument. \nThis Object array is supposed contain values for the fields added with one-to-one correspondence with the fields set. \n\nFollowing is a complete program explaining all the steps described above:\n\n```java\nimport com.linuxense.javadbf.*;\nimport java.io.*;\n\npublic class JavaDBFWriterTest {\n\n\tpublic static void main(String args[]) throws IOException {\n\n\t\t// let us create field definitions first\n\t\t// we will go for 3 fields\n\n\t\tDBFField[] fields = new DBFField[3];\n\n\t\tfields[0] = new DBFField();\n\t\tfields[0].setName(\"emp_code\");\n\t\tfields[0].setType(DBFDataType.CHARACTER);\n\t\tfields[0].setLength(10);\n\n\t\tfields[1] = new DBFField();\n\t\tfields[1].setName(\"emp_name\");\n\t\tfields[1].setType(DBFDataType.CHARACTER);\n\t\tfields[1].setLength(20);\n\n\t\tfields[2] = new DBFField();\n\t\tfields[2].setName(\"salary\");\n\t\tfields[2].setType(DBFDataType.NUMERIC);\n\t\tfields[2].setLength(12);\n\t\tfields[2].setDecimalCount(2);\n\n\t\tDBFWriter writer = new DBFWriter(new FileOutputStream(args[0]));\n\t\twriter.setFields(fields);\n\n\t\t// now populate DBFWriter\n\n\t\tObject rowData[] = new Object[3];\n\t\trowData[0] = \"1000\";\n\t\trowData[1] = \"John\";\n\t\trowData[2] = new Double(5000.00);\n\n\t\twriter.addRecord(rowData);\n\n\t\trowData = new Object[3];\n\t\trowData[0] = \"1001\";\n\t\trowData[1] = \"Lalit\";\n\t\trowData[2] = new Double(3400.00);\n\n\t\twriter.addRecord(rowData);\n\n\t\trowData = new Object[3];\n\t\trowData[0] = \"1002\";\n\t\trowData[1] = \"Rohit\";\n\t\trowData[2] = new Double(7350.00);\n\n\t\twriter.addRecord(rowData);\n\n\t\t// write to file\n\t\twriter.close();\n\t}\n}\n```\n\nKeep in mind that till the close method is called, all the added data will be kept in memory. \nSo, if you are planning to write huge amount of data make sure that it will be safely held in memory \ntill it is written to disk and the DBFWriter object is garbage-collected.\nRead the Sync Mode section to know how JavaDBF to use a special feature of JavaDBF to overcome this.\n\n## Sync Mode: Writing Records to File as They are Added\n\nThis is useful when JavaDBF is used to create a DBF with very large number of records. \nIn this mode, instead of keeping records in memory for writing them once for all,\nrecords are written to file as addRecord() is called. Here is how to write in Sync Mode.\n\nCreate DBFWriter instance by passing a File object which represents a new/non-existent or empty file.\nAnd you are done! But, as in the normal mode, remember to call close() when have added all the records.\nThis will help JavaDBF to write the meta data with correct values. Here is a sample code:\n\n```java\nimport com.linuxense.javadbf.*;\nimport java.io.*;\n\npublic class DBFWriterTest {\n\n  public static void main(String args[]) throws  IOException {\n\n    // ...\n\n    DBFWriter writer = new DBFWriter(new File(\"/path/to/a/new/file\")); \n    // this DBFWriter object is now in Sync Mode\n    \n    // set fields \n    writer.setFields(fields);\n    \n    // add the data\n    writer.addRecord(rowData);\n    \n    // close\n    writer.close();\n\n    // ...\n  }\n}\n```\n\n# Appending Records\n\nFrom version 0.4.0 onwards JavaDBF supports appending of records to an existing DBF file. \nUse the same constructor used in Sync Mode to achieve this. \nBut here the File object passed to the construction should represent the DBF file to which records are to be appended. \n\nIt is illegal to call setFields in DBFWriter object created for appending. \nHere also it is required to call the close() method after adding all the records.\n\n```java\nimport com.linuxense.javadbf.*;\nimport java.io.*;\n\npublic class DBFWriterTest {\n\n  public static void main(String args[]) throws IOException {\n\n    // ...\n\n    DBFWriter writer = new DBFWriter(new File(\"/path/to/an/existing/dbfile\")); \n    // this DBFWriter object is now in Syc Mode\n    \n    // add the data (no setFields, because it's an existing file)\n    writer.addRecord(rowData);\n    \n    // close\n    writer.close();\n\n    // ...\n  }\n}\n```\n\n# Building from sources\n\nClone the repository or download de tar file from releases page on github, then run the Maven command:\n\n    git clone https://github.com/albfernandez/javadbf.git\n    cd javadbf\n    mvn clean package\n\nThe result file is ``target/javadbf-x.xx.x.jar``\n\n\n\n# Links\n\nhttps://en.wikipedia.org/wiki/.dbf\n\nhttp://www.clicketyclick.dk/databases/xbase/format/index.html\n\nhttp://www.dbase.com/Knowledgebase/INT/db7_file_fmt.htm\n\nhttp://devzone.advantagedatabase.com/dz/webhelp/advantage9.0/server1/dbf_field_types_and_specifications.htm\n\nhttp://msdn.microsoft.com/en-us/library/st4a0s68%28VS.80%29.aspx\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falbfernandez%2Fjavadbf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falbfernandez%2Fjavadbf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falbfernandez%2Fjavadbf/lists"}