{"id":24316516,"url":"https://github.com/jferard/jxbase","last_synced_at":"2025-12-25T03:10:30.158Z","repository":{"id":57720462,"uuid":"217692782","full_name":"jferard/JxBase","owner":"jferard","description":"JxBase is a fork from [jdbf](https://github.com/iryndin/jdbf), a Java utility to read/write DBF files","archived":false,"fork":false,"pushed_at":"2023-05-27T09:53:04.000Z","size":946,"stargazers_count":1,"open_issues_count":5,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-17T12:59:30.091Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jferard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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}},"created_at":"2019-10-26T10:28:18.000Z","updated_at":"2023-05-27T09:53:02.000Z","dependencies_parsed_at":"2025-01-17T12:57:17.904Z","dependency_job_id":"9485241b-0a9c-4c45-8fbb-63a05be67398","html_url":"https://github.com/jferard/JxBase","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jferard%2FJxBase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jferard%2FJxBase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jferard%2FJxBase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jferard%2FJxBase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jferard","download_url":"https://codeload.github.com/jferard/JxBase/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242855699,"owners_count":20196359,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2025-01-17T12:56:43.758Z","updated_at":"2025-12-25T03:10:30.083Z","avatar_url":"https://github.com/jferard.png","language":"Java","readme":"JxBase\n======\n* JxBase - Copyright (c) 2019-2021 Julien Férard (https://github.com/jferard)\n* JDBF - Copyright (c) 2012-2018 Ivan Ryndin (https://github.com/iryndin)\n\n[![Build Status](https://travis-ci.com/jferard/JxBase.svg?branch=master)](https://travis-ci.com/jferard/JxBase)\n[![codecov](https://codecov.io/gh/jferard/JxBase/branch/master/graph/badge.svg)](https://codecov.io/gh/jferard/JxBase)\n\nJxBase is a fork from [jdbf](https://github.com/iryndin/jdbf), a Java utility to read/write DBF files\n\n## Convert a DBF file to SQLite from command line\nCall, from command line, the class `com.github.jferard.jxbase.tool.DatabaseLoader`. Here's an example:\n\n    ...$ java -cp \"$HOME/.m2/repository/com/github/jferard/jxbase/0.0.1-SNAPSHOT/jxbase-0.0.1-SNAPSHOT.jar\" com.github.jferard.jxbase.tool.DatabaseLoader\n    Usage: java -cp 'path/to/jxbase/jar:path/to/jdbc/driver/jar' com.github.jferard.jxbase.tool.DatabaseLoader [option] [source] [connect_string]\n    \n       -h, --help          Print this message\n       -c driver_class     Load the driver using Class.forName\n       -d                  Drop tables if they exist\n       -s N                Chunk size (default is one chunk of the size of the file)\n                           Use this to avoid an out of memory for big files\n       source              A directory or a single dbf file\n       connection_string   A connection string to the database\n    ...$java -cp \"$HOME/.m2/repository/org/xerial/sqlite-jdbc/3.32.3.2/sqlite-jdbc-3.32.3.2.jar:$HOME/.m2/repository/com/github/jferard/jxbase/0.0.1-SNAPSHOT/jxbase-0.0.1-SNAPSHOT.jar\" com.github.jferard.jxbase.tool.DatabaseLoader -d -s 10000 $HOME/prog/java/jxbase/src/test/resources/data1 \"jdbc:sqlite:./test.sqlite\"\n    oct. 17, 2020 10:52:55 PM com.github.jferard.jxbase.tool.DatabaseLoader buildAndFillTables\n    INFOS: Build tables\n    oct. 17, 2020 10:52:55 PM com.github.jferard.jxbase.tool.DatabaseLoader buildAndFillTable\n    INFOS:  \u003e /home/jferard/prog/java/jxbase/src/test/resources/data1/gds_im.dbf\n    oct. 17, 2020 10:52:55 PM com.github.jferard.jxbase.tool.DatabaseLoader buildAndFillTable\n    INFOS:  \u003e /home/jferard/prog/java/jxbase/src/test/resources/data1/tir_im.dbf\n         \n\n## User Guide\n\n### Read a DBF file \n\nTODO\n\nSee [the integration test example](src/test/java/com/github/jferard/jxbase/it/ReaderIT.java)\n\n### Read a DBF file with MEMO fields\n\nTODO\n\nSee [the integration test example](src/test/java/com/github/jferard/jxbase/it/ReaderWithMemoIT.java)\n\n### Write a DBF file \n\nTODO\n\nSee [the integration test example](src/test/java/com/github/jferard/jxbase/it/WriterIT.java)\n\n### Write a DBF file with MEMO fields\n\nTODO\n\nSee [the integration test example](src/test/java/com/github/jferard/jxbase/it/WriterWithMemoIT.java)\n\n## Design of an xBase database\nThe database is a simple set of files.\n\n### References\nSee:\n* https://www.clicketyclick.dk/databases/xbase/format/\n* http://www.dbase.com/KnowledgeBase/int/db7_file_fmt.htm\n* http://devzone.advantagedatabase.com/dz/webhelp/Advantage12/index.html?master_advantage_isam_file_types.htm\n* https://dbfread.readthedocs.io/en/latest/field_types.html: comprehensive list of data types.\n* http://fox.wikis.com/wc.dll?Wiki~TableFileStructure~Wiki: comprehensive list of data types. \n\n### The DBF file\nThe main file. Contains the header and the records.\n\n    +------- Header ---------+\n    |       Metadata         |   \u003c- XBaseMetaDataReader/Writer    \n    | Field Descriptor Array |   \u003c- XBaseFieldDescriptorArrayReader/Writer\n    |        Optional        |   \u003c- XBaseOptionalReader/Writer\n    +------------------------+\n    |        Records         |   \u003c- XBaseRecordReader/Writer\n    +------------------------+\n\n### DBT file (memo: optional)\nThis file contains block of data.\n\n    +------------------------+  \\\n    |         Header         |   |\n    +------------------------+   } \u003c- XBaseMemoReader/Writer\n    |        Records         |   |\n    +------------------------+  /\n\n### NDX file (index: optional)\nTODO\n\n## Design of JxBase\n###\nJxBase aims to build DBF format reader and writer by layers. Each dialect derives an existing format \nand adds fields, formats, files.  \n\n### The covariance parameter problem\nWhereas a `GenericRecordReader` has a `GenericDialect` parameter, a `FoxProRecordReader` needs \na `FoxProDialect` parameter. A covariant parameter (the parameters type varies with the class type)\nis a real problem because it violates the Liskov substitution principle: the subclass \n`FoxProRecordReader` won't work with a `GenericDialect` parameter (see https://en.wikipedia.org/wiki/Covariance_and_contravariance_(computer_science)#Covariant_method_parameter_type).\nUsually, one solves this problem with generics:\n\n```\n    class GenericRecordReader\u003cD extends GenericDialect\u003e {\n        ...\n    }\n    \n    class FoxProRecordReader extends GenericRecordReader\u003cFoxProDialect\u003e {\n        ...\n    }\n```\n\nCurrently, JxBase doesn't use generics for covariance because this would lead to a really complex situation. The fallaback used to achieve the covariance is \na simple cast: we accept a `GenericDialect` and try to cast the instance into a `FoxProDialect` \n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjferard%2Fjxbase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjferard%2Fjxbase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjferard%2Fjxbase/lists"}