Prev
12. Networking
Next
14. Unit testing

13. exercise: 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

Prev
12. Networking
Next
14. Unit testing
Tags:
Created by Valdis Vītoliņš on 2017-01-03 10:07
Last modified by Valdis Vītoliņš on 2019-08-12 17:08
 
Xwiki Powered
Creative Commons Attribution 3.0 Unported License