MADB Java Library
High Level API to Manage a Microsoft Access Database (.accdb)
Section titled “High Level API to Manage a Microsoft Access Database (.accdb)”Using the ucanaccess library
Tutorial
Section titled “Tutorial”-
Import MADB in your project as a dependency (see Releases for .jar file)
-
Create MADB object
MADB db = new MADB([your_db_directory]); -
Now through this object you have access to all of the SQL Methods (INSERT, SELECT, UPDATE etc)
Examples
Section titled “Examples”//Insert value at the specific columndb.INSERT("Table_name", "Column_name", value);
//Insert multiple values in multiple columnsdb.INSERT("Table_name", new String[]{"Column_name_1", "Column_name_2", "Column_name_3"}, new String[]{value1, value2, value3});
//Select the whole columnArrayList<Object> arr = db.SELECT("Table_name", "Column_name");
//Update a value based on the custom conditiondb.UPDATE("Table_name", "Column_name", value, new Condition("Column", Value, Operator.AND, "Other_Column", Other_Value));
//Delete a row based on the custom conditiondb.DELETE("Table_name", "Column_name", new Condition("Column_name", Value));Creating Conditions
Section titled “Creating Conditions”Example - Create the condition: ColumnA = ValueA AND NOT ColumnB = ValueB
Condition c = new Condition("ColumnA", ValueA, Operator.AND_NOT, "ColumnB", ValueB);Available Operators
Section titled “Available Operators”- OR
- AND
- NOT
- AND_NOT
- OR_NOT
- GREATER_THAN
- GREATER_OR_EQUAL_THAN
- LESS_THAN
- LESS_OR_EQUAL_THAN
- BETWEEN
- LIKE
- IN
- ANY
- ALL
- EXISTS
Dependencies
Section titled “Dependencies”<dependency> <groupId>kdesp73.madb</groupId> <artifactId>MADB</artifactId> <version>1.0.7-SNAPSHOT</version></dependency>git clone https://github.com/KDesp73/MADB- Basic SQL Methods (SELECT, INSERT, UPDATE, DELETE)
- Make dependency fully public on the Maven repository
- Add more SQL features
Contributing
Section titled “Contributing”Contributions are always welcome!
See Contributing.md for ways to get started.
Please adhere to this project’s Code of Conduct.