alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Glassfish example source code file (create_derby.sql)

This example Glassfish source code file (create_derby.sql) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Glassfish tags/keywords

create, cust_id,city,custname, insert, integer, integer, into, key, key, table, table, values, varchar, varchar, web_customer

The Glassfish create_derby.sql source code

CREATE TABLE CMP3_CUSTOMER(CUST_ID INTEGER PRIMARY KEY NOT NULL,CUST_VERSION INTEGER,CITY VARCHAR(255),NAME VARCHAR(255));
CREATE TABLE CMP3_ITEM(ITEM_ID INTEGER PRIMARY KEY NOT NULL,ITEM_VERSION INTEGER, DESCRIPTION VARCHAR(255),NAME VARCHAR(255));
CREATE TABLE CMP3_ORDER(ORDER_ID INTEGER PRIMARY KEY NOT NULL,ORDER_VERSION INTEGER,QTY INTEGER,SHIPADD VARCHAR(255),CUST_ID INTEGER,ITEM_ID INTEGER);

ALTER TABLE CMP3_ORDER ADD CONSTRAINT FK_ORDER FOREIGN KEY (CUST_ID) REFERENCES CMP3_CUSTOMER (CUST_ID) ;
ALTER TABLE CMP3_ORDER ADD CONSTRAINT FK_ITEM FOREIGN KEY (ITEM_ID) REFERENCES CMP3_ITEM(ITEM_ID) ;

CREATE TABLE WEB_CUSTOMER(CUST_ID INTEGER PRIMARY KEY NOT NULL,CITY VARCHAR(255),CUSTNAME VARCHAR(255));

INSERT INTO WEB_CUSTOMER (CUST_ID,CITY,CUSTNAME) VALUES (1,'Santa Clara', 'Alice_1');
INSERT INTO WEB_CUSTOMER (CUST_ID,CITY,CUSTNAME) VALUES (2,'Cupertino', 'Alice_2');
INSERT INTO WEB_CUSTOMER (CUST_ID,CITY,CUSTNAME) VALUES (3,'Mountain View', 'Alice_3');
INSERT INTO WEB_CUSTOMER (CUST_ID,CITY,CUSTNAME) VALUES (4,'Fremont', 'Alice_4');

select city from web_customer where cust_id=1;
select * from web_customer where custname Like 'Alice_1';


Other Glassfish examples (source code examples)

Here is a short list of links related to this Glassfish create_derby.sql source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.