Skip to content
Snippets Groups Projects
Commit f9265540 authored by Rhys Nute's avatar Rhys Nute
Browse files

database Update

parent e63d275a
No related branches found
No related tags found
1 merge request!16Ready to merge - Database
......@@ -21,7 +21,7 @@ public class UserController {
@GetMapping("/userList")
public ModelAndView userList(){
ModelAndView mav = new ModelAndView("users.html");
ModelAndView mav = new ModelAndView("usersData.sql");
List<user> users = userRepository.getAllUsers();
mav.addObject("users", users);
return mav;
......
......@@ -29,7 +29,7 @@ public class UserRepositoryJDBC implements UserRepository{
@Override
public List<user> getAllUsers(){
String sql = "select * from User";
String sql = "select * from user";
return jdbc.query(sql, userMapper);
}
}
spring.datasource.url=jdbc:mariadb://localhost:3306/Towns
spring.datasource.url=jdbc:mariadb://localhost:3306/Smart_Towns
spring.datasource.username=root
spring.datasource.password=comsc
......
drop table if exists landmarks;
create table if not exists landmarks(
landmarksId bigint auto_increment primary key,
name varchar(100)
) engine=InnoDB;
\ No newline at end of file
drop table if exists trails;
create table if not exists trails(
trailID bigint auto_increment primary key
) engine=InnoDB;
drop table if exists location;
create table if not exists location(
locationID bigint auto_increment primary key
trailID bigint auto_increment primary key,
name varchar(100)
) engine=InnoDB;
drop table if exists users;
create table if not exists users(
userID bigint auto_increment primary key
userID bigint auto_increment primary key,
name varchar(100)
) engine=InnoDB;
\ No newline at end of file
DELETE from users
INSERT INTO users (userId) VALUES (1)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment