July 2013
Intermediate to advanced
370 pages
8h 27m
English
We’ll use MySQL in the examples in this chapter; however, we can use any database that we can access using JDBC. First let’s set up the database we’ll use in the examples, with a table named weather. The table contains names of and temperature values for some cities.
It’s easier to set up the database using an automated script than to do it manually. So, let’s create a SQL script to build the database:
| | create database if not exists weatherinfo; |
| | use weatherinfo; |
| | |
| | drop table if exists weather; |
| | create table weather ( |
| | city varchar(100) not null, |
| | temperature integer not null |
| | ); |
| | |
| | insert into weather (city, temperature) values ('Austin', 48); |
| | insert into weather (city, ... |
Read now
Unlock full access