CSE 4051: Project #10 -- Language Database

Due: Wedensday, 28 April 2008.

Task

Design a Java Swing user interface to access the SIL data of languages of the world. The program is to be an application (not an applet). A database of language information will be provided for you. You must use JDBC to access it. The application is to make it easy for someone that does not know SQL to search the database. You should use color and incorporate images, for example, country maps.

You may work in teams of upto two people from the class. You may not work with the same person twice.

Put
mysql-connector-java-3.1.8-bin.jar
on the classpath.

Information needed to access the database I am running for this project.

com.mysql.jdbc.Driver
jdbc:mysql://sql.cs.fit.edu/sil?user=cse4051&password=jdbc
The actual password will be announced in class.

Example SQL queries that work on MySQL.

SELECT * FROM languages WHERE (name REGEXP "^J" AND speakers >=10000) ORDER BY name
SELECT name,speakers,family FROM languages WHERE speakers >=10000 ORDER BY name
SELECT name,speakers,family FROM languages WHERE (speakers >=100000 AND speakers <=200000) ORDER BY name
SELECT name,speakers,family FROM languages WHERE speakers BETWEEN 100000 AND 200000 ORDER BY name;
SELECT name,speakers,family,fips FROM languages,countries WHERE countries.code=languages.code and (name REGEXP "^J" AND speakers <=10000) ORDER BY name
SELECT DISTINCT family FROM languages ORDER BY family;
SELECT alias, languages.* from sil.aliases,sil.languages where sil.aliases.code=sil.languages.code and aliases.alias LIKE "%obo%";
SELECT * from sil.aliases where alias LIKE "%cantonese%";

LIKE and REGEXP searches ignore case.

Data

The catalog or "database" is sil, there are three tables. (Database can be located by the show databases command.) Please observed the case as it is significant. The columns of the tables are
columndescription
codecode for the language assigned by SIL
namea standard name the language is known by
aliasother names the language is known by
familytop-level classification of the language
classsub classification of the language
speakersthe estimated number of speakers
sccprincipal country where the language is spoken
fipstwo letter country code
countrya standard name for the country

The table languages (show columns from languages):

+----------+-------------+------+-----+---------+-------+
| Field    | Type        | Null | Key | Default | Extra |
+----------+-------------+------+-----+---------+-------+
| code     | char(3)     | YES  |     | NULL    |       |
| name     | varchar(20) | YES  |     | NULL    |       |
| family   | varchar(20) | YES  |     | NULL    |       |
| class    | varchar(60) | YES  |     | NULL    |       |
| speakers | int(11)     | YES  |     | NULL    |       |
| scc      | varchar(4)  | YES  |     | NULL    |       |
+----------+-------------+------+-----+---------+-------+
AAA|Ghotuo|Niger-Congo|Atlantic-Congo/Volta-Congo/Benue-Congo/Edoid/North-Central/Ghotuo-Uneme-Yekhee|9000|Nigr
AAB|Arum-Cesu|Niger-Congo|Atlantic-Congo/Volta-Congo/Benue-Congo/Platoid/Benue/Tarokoid|4000|Nigr
AAC|Ari|Trans-New Guinea|Main Section/Central and Western/Gogodala-Suki/Gogodala|80|Papu
AAE|Albanian, Arbėreshė|Indo-European|Albanian/Tosk|80000|Ital
AAF|Aranadan|Dravidian|Unclassified|600|Inda
AAG|Are|Indo-European|Indo-Iranian/Indo-Aryan/Southern zone/Unclassified|2590|Inda
AAI|Arifama-Miniafia|Austronesian|Malayo-Polynesian/Central-Eastern/Eastern Malayo-Polynesian/Oceanic/Western Oceanic/Papuan Tip/Nuclear/North Papuan Mainland-D'Entrecasteaux/Are-Taupota/Are|2150|Papu
AAK|Ankave|Trans-New Guinea|Main Section/Central and Western/Angan/Angan Proper|1600|Papu
AAL|Afade|Afro-Asiatic|Chadic/Biu-Mandara/B/B.1/Kotoko Proper|25000|Nigr
AAM|Aramanik|Nilo-Saharan|Eastern Sudanic/Nilotic/Southern/Kalenjin/Nandi-Markweta/Nandi|0|Tanz

The table aliases (show columns from aliases):

+-------+-------------+------+-----+---------+-------+
| Field | Type        | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+-------+
| alias | varchar(45) | YES  |     | NULL    |       |
| code  | char(3)     | YES  |     | NULL    |       |
+-------+-------------+------+-----+---------+-------+
Otwa|AAA
Otuo|AAA
Arum-Chessu|AAB
Alai|AAD
Arbėreshė|AAE
Eranadans|AAF
Arya|AAG
Kalika Arya Bhasha|AAG
Ade Bhasha|AAG
Aray|AAG

The table sil_countries:

+---------+-------------+------+-----+---------+-------+
| Field   | Type        | Null | Key | Default | Extra |
+---------+-------------+------+-----+---------+-------+
| scc     | varchar(4)  | YES  |     | NULL    |       |
| country | varchar(20) | YES  |     | NULL    |       |
| fips    | char(2)     | YES  |     | NULL    |       |
+---------+-------------+------+-----+---------+-------+
sil country|country|
Afgh|Afghanistan|AF
Alba|Albania|AL
Alge|Algeria|AG
Amer|American Samoa|AQ
Ando|Andorra|AN
Ango|Angola|AO
Angu|Anguilla|AV
Anti|Antigua|AC
Arge|Argentina|AR
Arme|Armenia|AM

Image files

The FIPS code can get you access over the WWW to county maps and flags from the CIA factbook.

Or, locally:

Example

The WWW page languages.html may serve to stimulate thought about presentation.

Helpful Stuff

Turning it in

Turn in the Java source code for the program using the submission server. To submit your file, use proj11. Do not use jar files. (OK, if you use packages send me one jar file for the source code of your project.) Call your application LanguageDatabase. Your program will be invoked something like this:

java -classpath .:<path>mysql-connector-java-3.1.12-bin.jar LanguageDatabase
where I will insert the correct path to locate the ConnectJ driver for MySQL. Be sure to set the property jdbc.drivers to the appropriate driver or drivers you require.
System.setProperty ("jdbc.drivers", "com.mysql.jdbc.Driver");
Set the title (setTitle()) of the main window of the GUI to: "Your Name -- Language Database".

File to be submitted:

Control code:
Course=cse4051
Project=proj12


Ryan Stansifer <ryan@cs.fit.edu>
Last modified: Thu Apr 26 14:10:52 EDT 2007