source /usr/box/etc/triton-student-login # insert user customization here # for mysql commands set path = ($path /usr/faculty/schmitt/mysql/bin .) # for JDBC setenv CLASSPATH '/usr/faculty/schmitt/WWW/java/jdbc/lib/mm.mysql-2.0.2-bin.jar:.' |
Note: It is not necessary to copy the zip file to your directory, and it is not necessary to unzip it. The classes are automatically loaded from the zip files in your CLASSPATH as they are needed by java.
% mysql -p database
Enter password: **********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 16 to server version: 3.21.30
Type 'help' for help.
mysql> select * from stocks\g
ERROR 1017: Can't find file: 'stocks.frm' (errno: 2)
mysql> create table stocks (
-> ticker char(8) not null primary key,
-> title char(40),
-> price decimal(9,3))\g
Query OK, 0 rows affected (0.04 sec)
mysql> insert into stocks values("IBM","IBM Corp",106.25)\g
Query OK, 1 row affected (0.00 sec)
mysql> insert into stocks values("LUV","Southwest Airlines",28.5)\g
Query OK, 1 row affected (0.00 sec)
mysql> insert into stocks values("MSFT","Microsoft Corp",94.125)\g
Query OK, 1 row affected (0.00 sec)
mysql> insert into stocks values("U","USAir Group",79.25)\g
Query OK, 1 row affected (0.00 sec)
mysql> insert into stocks values("DIS","Walt Disney",107.5)\g
Query OK, 1 row affected (0.01 sec)
mysql> insert into stocks values("KO","Coca Cola",80.375)\g
Query OK, 1 row affected (0.00 sec)
mysql> select * from stocks\g
+--------+--------------------+---------+
| ticker | title | price |
+--------+--------------------+---------+
| IBM | IBM Corp | 106.250 |
| LUV | Southwest Airlines | 28.500 |
| MSFT | Microsoft Corp | 94.125 |
| U | USAir Group | 79.250 |
| DIS | Walt Disney | 107.500 |
| KO | Coca Cola | 80.375 |
+--------+--------------------+---------+
6 rows in set (0.00 sec)
mysql> exit
Bye
%
% java StocksMy IBM IBM Corp 106.250 LUV Southwest Airlines 28.500 MSFT Microsoft Corp 94.125 U USAir Group 79.250 DIS Walt Disney 107.500 KO Coca Cola 80.375 %