Check out our new application for website testing.
Saturday, March 24, 2012
Wednesday, March 21, 2012
How to connect to JavaDB and create database -- Tutorial
1. Open your Netbeans, go to Window and select Services. Alternatively press CTRL+5.
2. Right Click on JavaDB and select Start Server
3. Right Click again and this time select Create Databese
- name it -- login
- username -- nut
- password -- nut
- confirm password
- click OK
4. Right click on jdbc:derby://localhost:1527/login[nut on APP] and select Connect
5. Open jdbc:derby://localhost:1527/login[nut on APP] tree and select APP
6. Right click on Tables, select Create Table
7. Name your table -- users
8. Create columns, one by one
- firstName
- lastName
- userName
- password
- address1
- address2
- address3
- address4
- telephone
- mobile
- ageGroup
- employmentStatus
9. Alternatively you can create and populate your table using mysql query. Right click on Tables and select Execute Command and insert
following mySql query.
CREATE TABLE users (firstName VARCHAR(20), lastName VARCHAR(20),
userName VARCHAR(15), password VARCHAR(15), address1 VARCHAR(30),
address2 VARCHAR(30), address3 VARCHAR(20), address4 VARCHAR(20),
telephone VARCHAR(15), mobile VARCHAR(15), email VARCHAR(35), ageGroup
VARCHAR(5), employmentStatus VARCHAR(17));
and Run SQL.
10. Add some users...
INSERT INTO users
VALUES ('Jake', 'Roberts', 'snake@ifpwafcad.com', 'password' , '123 Castle Lawns' , 'Tallagh' , 'Dublin 24' , 'Ireland' , '412 565-5656', '555 565-5656','snake@ifpwafcad.com', '18-24' , 'Student' ),
('Andre','','snake@ifpwafcad.com', 'password' , '123 Castle Lawns' , 'Tallagh' , 'Dublin 24' , 'Ireland' , '412 565-5656', '555 565-5656','snake@ifpwafcad.com', '18-24' , 'Student' );
and Run SQL.
10. Add some users...
INSERT INTO users
VALUES ('Jake', 'Roberts', 'snake@ifpwafcad.com', 'password' , '123 Castle Lawns' , 'Tallagh' , 'Dublin 24' , 'Ireland' , '412 565-5656', '555 565-5656','snake@ifpwafcad.com', '18-24' , 'Student' ),
('Andre','','snake@ifpwafcad.com', 'password' , '123 Castle Lawns' , 'Tallagh' , 'Dublin 24' , 'Ireland' , '412 565-5656', '555 565-5656','snake@ifpwafcad.com', '18-24' , 'Student' );
and Run SQL.
Subscribe to:
Posts (Atom)