If it is not explicitly told in following recipe, setting up services are described for Ubuntu 16.04 server, but applications are described for Ubuntu 16.04 and/or Lubuntu 16.04 workstation. If you use different Ubuntu version or Linux distribution, settings as well as content, names and places of configuration files may be different!
Got it.

13. JDBC

General steps

Review topic

  1. Review presentation JDBC


Set up MySQL and database

  1. If necessary:
    1. To enable additional software reposoitories, run

      sudo leafpad /etc/apt/sources.list

      and uncomment lines staring with # deb... (delete #)

      Do not uncomment # deb cdrom..., because then manager will look for installation disk!
    2. To refresh info about repositories run command:

      sudo apt-get update
  2. To install MySQL server, run following command:

    sudo apt-get install mysql-server

    Set password Student007 for MySQL's root user

  3. To install MySQL workbench, run command:

    sudo apt-get install mysql-workbench
  4. In MySQL Workbenche open and execute .../src/main/java/jtm/activity13/database.sql SQL script from your project

Configure detailed MySQL logging (Optional)

To enable detailed logging on MySQL server:

  1. Open configuration file:

    sudo leafpad /etc/mysql/mysql.conf.d/mysqld.cnf
  2. Change two lines to following (i.e. remove from beginning of line):

    general_log_file        = /var/log/mysql/mysql.log
    general_log             = 1
  3. Restart mysql server:

    sudo systemctl restart mysql
  4. To watch log in real time, run command:

    sudo tail -f /var/log/mysql/mysql.log

Implement activity

  1. Investigate jtm.activity13 package
  2. Implement class TeacherManager to pass unit tests

Extra exercise

More info

In English

In Latvian

Created by Valdis Vītoliņš on 2020-05-28 13:56
Last modified by Valdis Vītoliņš on 2020-05-28 15:27
Xwiki Powered
Creative Commons Attribution 3.0 Unported License