WARNING:
If you downloaded: moleculej_1.zip
please visit
sourceForge.net & download:
moleculej_FirstRelease_R1.zip
The moleculej_1.zip was kind of a pre-release.
Yes I blew it; when you release a project on sourceForge.net they
promote it on the main home page.
Everyone who downloaded moleculej_1.zip got a bunch of crap that didn't work;
yes a nightmare!
![]()
The download includes the code, built classes,
JavaDoc, a netBeans 5.x GUI Example project and more.
You are at: www.datavirtue.com
If you are a Java programmer and would like to take part in moleculeJ enhancement please contact software@datavirtue.com.
Changes Development Plans Highlights Examples Limitations
| Introduction |
Story moleculeJ is a super-small sub-relational database engine for Java developers. DbEngine.java has built-in helper methods to return a sorted (TableSorter.java) or non-sorted TableModel for use in JTables. You don't have to jump through SQL hoops to develop a small to medium scale desktop application. If you need network data capabilities you should use Derby or Cloudscape 10. ...or RMI? This database engine was used to develop a significant business application before I released it on Source Forge. Below you will find code snippets from the netBeans 5.x GUI Example project included with the release download. MPL 1.1
- You are free to modify and include this in any of your projects under the
MPL 1.1 license. Suggestions are welcome. Post Questions Here: http://sourceforge.net/forum/?group_id=183825
THE OR THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| Development Plans |
| Advanced text file (.CSV) processing engine (java.util.regex). Optimize private methods for speed and flexibility (regex). Develop a way to generate or "compile" .sch files so they can be created dynamically. (regex) Standard XML output or XML schema/translation mechanism for relations between tables. (?)(regex?) ...?????
|
moleculeJ is developed sporadically in line with my other projects. New features are added or amended when needed; mostly on the fly. Enjoy.
|
| Highlights |
| Only two small classes needed for a raw data engine. Easy to change in the midst of a project, adding features or revising private methods for speed. Simple to-the-point methods prevent any learning curve. Developed and tested to handle over 40000 records per table, four times more than Microsoft Access 2000. (fairly quick :) Schemas (tables/files) and "Data Systems" (Databases) are created with simple text files. It is possible to dynamically load and unload schemas and or chain DbEngine instances. Schema and Data System design possibilities are endless, great for experimental data scenarios on the desktop. Good to test or experiment with threads and RMI. You can wrap the DbEngine with a command parser (regex) class to handle just the SQL you need for a project. Easy to create complex small business applications for the desktop. Sub-Relational Design: Relations are established in the business logic code and or objects. Good way to teach OOP and Java fundamentals to new students. (It gives them something interesting to work on instead of text book exercises.) No need to change old data when adding features, simply create a new table, add interface components, insert CRUD of new table into business logic using a key from the "parent" table as a reference. Leave your user's old data alone and avoid messy conversions. Fun to play with and test.
|
| Files needed to construct a Data System |
.dsf file and any number of .sch files called by the .dsf
See Code Examples below for alternate usage with just .sch file
|
| Code Snips from GUI Example |
|
private DbEngine db = new
DbEngine (); //construct a data engine
db.loadSchema("zip.sch");
//Provide access to one data file(table). private void
closeButtonActionPerformed(java.awt.event.ActionEvent evt) {
// Or it is null? |
| Limitations |
No special fields yet. No image fields, no auto-increment (except key) fields. Only stores Java Integer, Float, Boolean and String data. If you change a field's properties in the .sch file all the data becomes inaccessible; delete the corresponding .db file and let the system start a new one. You must practice good database design! Error handling prevents any type of data corruption but leaves much to be desired. Path addressing scheme needs revised (not easy or it would be done by now) for more flexibility. csvEx/Import() methods could be improved for better performance. No join methods or other such complications; presentation by logic is handled through the application where everyone can see what is going on.
|
| moleculeJ stores
data, that is it. Data accessed through your basic CRUD methods with a
Java flavor and additional helper methods. The "sub-relational" aspect
is the ability to relate the tables through code as all methods are designed
for this type of use.
|
| Story |
| Several years ago I was studying Java; actually I became obsessed. Anyway, as I was studying I needed a project to focus my attention while learning the language. It is a big help to develop a small narrow purposed application to get you up to speed while learning a new language. Furthermore, I spent a year developing this data engine for java. After I deemed it ready for use and wider testing I used it to develop single screen utilities that needed access to large amounts of data; like a zip code finder. Through this testing I found the little engine to be extremely reliable. (To date [01-18-07] I have not had a single data anomaly or corruption of any kind.) During this stage I tested it with a 40K row zip code file. I isolated many common performance problems inherent to file based data systems and optimized the general access of data. After I was happy with the performance at this point I started the application I had been mulling over for a long time (Nevitium). During this project several changes were made to further increase the speed at which you can get to the data and organize it. All the while I was resisting the temptation to implement bloat features, joins, cascaded deletes, indexing, or transactions. (Transactions are easy to implement without further modification.) One thing I did add was the ability to address rows by byte location (apposed to just key) (searches can return byte locations or keys and in turn rows can be accessed either way; however this still requires a manual search; to index it you would have to implement a mark/pack system instead of the current instant delete process) As I finished this freeware project (Nevitium) I felt the need to release something open source so I decided to release the db engine I created as moleculeJ. One of the reasons I did this is because I want new programmers to be able to examine the core of a data engine so they are not intimidated by SQL servers and such. When I was a young lad this greatly interested me.
|
| Change Log |
| [Feb-01-2007] (not
uploaded yet) Changed String storage from Unicode byte representation to ASCII bytes (top 8 bits discarded) [RAF.writeBytes(String s)]. In other words it now stores strings in half the space as the original release. This not only makes it lighter but faster as well. [Feb-08-2007] email: seanka@datavirtue.com for a recent version until I upload the new release (jar file) to sourceForge.net
|
|
|
|
|