MiniSQL, developed by Hughes Technologies, is an exceptionally fast DBMS with very low system requirements. It supports a fairly useful subset of the Structured Query Language (SQL). Using it for commercial purposes requires purchasing a license, although free licenses are provided for academic and charity organizations.
The software is distributed in source code form, all bundled up in a gzipped tar file (currently, the latest distribution file is msql-2.0.11.tar.gz). It may be downloaded from the Hughes Technology web site (see Resources). The MiniSQL manual, with all the necessary installation and usage information, is contained in the files msql-2.0.11/doc/manual.ps.gz and msql- 2.0.11/doc/manual-html/manual.html, once the distribution file is extracted. The reader is encouraged to carefully review and follow the instructions contained there. However, it must be noted that two important details are missing from the MiniSQL manual:
The “system” section contained in the /usr/local/Hughes/msql.conf file has a parameter called Remote_Access that has a default value of false. It must be changed to true in order to allow access to the database from remote systems.
Like other server dæmons (for example, the HTTP web server), the MiniSQL 2.0 server, called msql2d, should be run as a background process. Executing the following command as root should achieve this: /usr/local/Hughes/bin/msql2d &
In addition to the database server, MiniSQL comes with some other useful utilities: a server administration program, an interactive SQL monitor, a schema viewer, a data dumper and a table-data exporter and importer. The server administration program is required to create the Hangman database that will contain the mystery words. The following command must be executed as root:
/usr/local/Hughes/bin/msqladmin create hangmanAfterward, a mystery-words table needs to be created. Only two columns will be contained in this table: word (the mystery word or sentence) and category (a classification for the mystery word: computers, animals, movies, etc.), both of them being character strings. Also, a few rows should be inserted. The interactive SQL monitor may be used for both purposes. Executing the command
/usr/local/Hughes/bin/msql hangmanenters the interactive monitor with the “hangman” database. The MiniSQL prompt should appear. SQL queries can now be issued, followed by “\g”(GO) to indicate that the query should be sent to the database server. Here are the SQL commands for the Hangman application:
create table mystery (word char(40), category char(15))\g insert into mystery values ('elephant', 'animals')\g insert into mystery values ('rhinoceros', 'animals')\g insert into mystery values ('gone with the wind', 'movies')\g
The application's middle tier uses Blackdown's Linux Port Java Development Kit 1.2.2, release candidate 4, and CIE's mSQL-JDBC driver for JDBC 2.0. The Java tutorial is one of many excellent places to learn how to access databases from within a Java program; that's why only the specific issues on accessing MiniSQL will be dealt with here.
Before attempting to access the MiniSQL server from a Java application, the corresponding JDBC driver must be installed. The driver may be freely downloaded from The Center for Imaginary Environments web site (see Resources). The distribution file comes with many things, but the most important part is the JAR file that contains the driver itself (currently, the file is msql-jdbc-2.0b5.jar). The easiest way to install the driver is to copy the JAR file to the /usr/local/jdk1.2.2/jre/lib/ext directory (root privileges are required to copy files to this directory).
In order to load the driver from the Java program, the following statement should be executed:
The connection to the database server is established when executing this statement (ignore line wrap):
Connection con = DriverManager.getConnection ('jdbc:msql://localhost:1114/hangman');Inside the JDBC URL, the URL of a remote system should replace “localhost” if the MiniSQL server is not running in the same machine. 1114 is the default port number to which the MiniSQL server is listening. The msql.conf file can be modified in order to specify another port number.
The three-tier architecture is a versatile and modular infrastructure intended to improve usability, flexibility, interoperability and scalability. Linux, Java and MiniSQL result in an interesting combination for learning how to build three-tier architecture systems. Nevertheless, more convenient implementations than the one presented here may be produced using component technology in the middle tier, such as CORBA (Common Object Request Broker Architecture), EJB (Enterprise Java Beans) and DCOM (Distributed Component Object Model). The interested reader should review these topics to get a better understanding of the current three-tier architecture capabilities.
Ariel Ortiz Ramirez (email@example.com) is a faculty member in the Computer Science Department of the Monterey Institute of Technology and Higher Education, Campus Estado de Mexico. Although he has taught several different programming languages for almost a decade, he personally has much more fun when programming in Scheme and Java (in that order). He can be reached at firstname.lastname@example.org.
Practical Task Scheduling Deployment
July 20, 2016 12:00 pm CDT
One of the best things about the UNIX environment (aside from being stable and efficient) is the vast array of software tools available to help you do your job. Traditionally, a UNIX tool does only one thing, but does that one thing very well. For example, grep is very easy to use and can search vast amounts of data quickly. The find tool can find a particular file or files based on all kinds of criteria. It's pretty easy to string these tools together to build even more powerful tools, such as a tool that finds all of the .log files in the /home directory and searches each one for a particular entry. This erector-set mentality allows UNIX system administrators to seem to always have the right tool for the job.
Cron traditionally has been considered another such a tool for job scheduling, but is it enough? This webinar considers that very question. The first part builds on a previous Geek Guide, Beyond Cron, and briefly describes how to know when it might be time to consider upgrading your job scheduling infrastructure. The second part presents an actual planning and implementation framework.
Join Linux Journal's Mike Diehl and Pat Cameron of Help Systems.
Free to Linux Journal readers.Register Now!
- SUSE LLC's SUSE Manager
- My +1 Sword of Productivity
- Murat Yener and Onur Dundar's Expert Android Studio (Wrox)
- Managing Linux Using Puppet
- Non-Linux FOSS: Caffeine!
- SuperTuxKart 0.9.2 Released
- Doing for User Space What We Did for Kernel Space
- Parsing an RSS News Feed with a Bash Script
- Google's SwiftShader Released
- Rogue Wave Software's Zend Server
With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.
This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.Get the Guide