- Derby: A Database for All Seasons
- What Is Derby?
- How to Use Derby
- Setting Up Your CLASSPATH
- Testing Your Setup
- Running Your First Derby Program
- Derby Application Components
- Derby Application Startup
- Loading the Derby Driver
- Database and Connection Creation
- Statement Creation
- Table Creation
- Table Access
- Shutdown
- Running the Code
Table Creation
Before we can manipulate some database data, we must create and populate some tables. Table creation is illustrated in Listing 9.
Listing 9 Table creation
s.execute("create table derbyDB(num int, addr varchar(40))");
Listing 9 illustrates the creation of a table called derbyDB. This table has two columns: an integer column and a variable character column. The latter can store strings of up to 40 characters in length. Letβs now get some data into the table.