Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cmpt-370-group-project-group26
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eyan Cunningham (esc568)
cmpt-370-group-project-group26
Commits
205dba5a
Commit
205dba5a
authored
3 years ago
by
Rafi Zereselasie (raz070)
Browse files
Options
Downloads
Patches
Plain Diff
Refactored RafisWeirdClass to DataBaseQuery and added comments.
parent
4a4b3af7
No related branches found
Branches containing commit
No related tags found
1 merge request
!6
Changed update implementation for employees so rather than sending the whole...
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SchedulerApp/src/main/java/com/example/schedulerapp/DataBaseQuery.java
+49
-0
49 additions, 0 deletions
...src/main/java/com/example/schedulerapp/DataBaseQuery.java
with
49 additions
and
0 deletions
SchedulerApp/src/main/java/com/example/schedulerapp/
RafisWeirdClass
.java
→
SchedulerApp/src/main/java/com/example/schedulerapp/
DataBaseQuery
.java
+
49
−
0
View file @
205dba5a
...
...
@@ -2,18 +2,40 @@ package com.example.schedulerapp;
import
java.sql.*
;
public
class
RafisWeirdClass
{
/*
Name: DataBaseQuery
Description: Makes the connection to the database, and sends the connection to the Staff and Schedule after
initializing them.
*/
public
class
DataBaseQuery
{
protected
Staff
staff
;
protected
Schedule
schedule
;
private
Connection
dbConnection
;
public
RafisWeirdClass
(
String
dbURL
,
String
dbUser
,
String
dbPass
){
/*
Name: DataBaseQuery
Parameters:
String dbURL: The URL of the database
String dbUser: The username of the database.
String dbPass: The password of the database.
Description: Calls connectDataBase and initializes the Staff and Schedule.
Return: DataBaseQuery
*/
public
DataBaseQuery
(
String
dbURL
,
String
dbUser
,
String
dbPass
){
connectDataBase
(
dbURL
,
dbUser
,
dbPass
);
this
.
staff
=
new
Staff
(
dbConnection
);
this
.
schedule
=
new
Schedule
(
dbConnection
);
}
/*
Name: connectDataBase
Parameters:
String dbURL: The URL of the database
String dbUser: The username of the database.
String dbPass: The password of the database.
Description: Establishes the connection to the database.
Return: void
*/
protected
void
connectDataBase
(
String
dbURL
,
String
dbUser
,
String
dbPass
){
try
{
dbConnection
=
DriverManager
.
getConnection
(
dbURL
,
dbUser
,
dbPass
);
...
...
@@ -24,6 +46,4 @@ public class RafisWeirdClass {
System
.
out
.
println
(
"Successfully connected to the database"
);
}
public
static
void
main
(
String
[]
args
)
{
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment