table design

If you're developing on your local machine you can use another database, just need to load the relevant jdbc driver. These tutorials assume you are using a remove linux server connected to the net.

start putty and login to the linux box, note you don't need to do these steps if your using our server space. Jump to creating the tables (still need to add a local odbc driver).

1. Configure mysql.

telnet> mysqladmin create javatutes -p
creates a new database (-p means with password)
mysql> mysql mysql -p
enter mysql command line admin
mysql> insert into user values ('%', 'username', password('passwd'),'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');
add new user (% means can access from any domain - could put an ip address in here)
mysql> quit
return to the telnet command prompt
telnet> mysqladmin reload -p
refresh the changes just made
mysql> GRANT ALL PRIVILEGES on javatutes.* to username@'domain.com';
mysql> select host, user, password,grant_priv from user;
mysql> select host,db,user from db;
mysql> update user set password ='passwd' where user = 'user';
passwd is encoded and can be found from the select statement about
mysql> quit
telnet> mysqladmin reload -p
telnet> exit

2. Now add the odbc driver for windows
WinSQL uses this to connect to the remote MySql database, download and install the driver. Get it here.

Next step is to add an new local odbc machine source. The images below show how to configure the driver.







DROP TABLE jtutes_users;
CREATE TABLE jtutes_users
(
user_id int
not null auto_increment,
primary key (user_id),
user_name varchar
(255),
user_password varchar
(255),
company_name varchar
(255),
address1 varchar
(255),
address2 varchar
(255),
address3 varchar
(255),
town varchar
(255),
postcode varchar
(20),
country varchar
(255),
phone varchar
(50),
email_address varchar
(255)
)

DROP TABLE jtutes_questions;
CREATE TABLE jtutes_questions
(
question_id int
not null auto_increment,
primary key (question_id),
screen_text varchar
(255),
type int
)

DROP TABLE jtutes_response;
CREATE TABLE jtutes_response
(
response_id int
not null auto_increment,
primary key (response_id),
question_id int
,
survey_id int
,
resp_str_01 varchar
(255),
resp_str_02 varchar
(255),
resp_str_03 varchar
(255),
resp_str_04 varchar
(255),
resp_str_05 varchar
(255),
resp_str_06 varchar
(255),
resp_str_07 varchar
(255),
resp_str_08 varchar
(255),
resp_str_09 varchar
(255),
resp_num_01 double
,
resp_num_02 double
,
resp_num_03 double
,
resp_num_04 double
,
resp_num_05 double
,
resp_num_06 double
,
resp_num_07 double
,
resp_num_08 double
,
resp_num_09 double
)

DROP TABLE jtutes_response_archive;
CREATE TABLE jtutes_response_archive
(
response_archive_id int
not null auto_increment,
primary key (response_archive_id),
question_id int
,
survey_id int
,
resp_str_01 varchar
(255),
resp_str_02 varchar
(255),
resp_str_03 varchar
(255),
resp_str_04 varchar
(255),
resp_str_05 varchar
(255),
resp_str_06 varchar
(255),
resp_str_07 varchar
(255),
resp_str_08 varchar
(255),
resp_str_09 varchar
(255),
resp_num_01 double
,
resp_num_02 double
,
resp_num_03 double
,
resp_num_04 double
,
resp_num_05 double
,
resp_num_06 double
,
resp_num_07 double
,
resp_num_08 double
,
resp_num_09 double
)

DROP TABLE jtutes_survey;
CREATE TABLE jtutes_survey
(
survey_id int
not null auto_increment,
primary key (survey_id),
user_id int
,
date date
)

DROP TABLE jtutes_survey_instance;
CREATE TABLE jtutes_survey_instance
(
survey_instance_id int
not null auto_increment,
primary key (survey_instance_id),
user_id int
,
description varchar
(255),
date date
)

DROP TABLE jtutes_survey;
CREATE TABLE jtutes_survey
(
survey_id int
not null auto_increment,
primary key (survey_id),
user_id int
,
date date
)

Click here to download a zip file containing the sql above but in files (text file with .sql extension)

last java webhosting next
bl br
copyright