Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CarRental_Christopher_Foster
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
christopher.foster
CarRental_Christopher_Foster
Commits
a0e1f704
Commit
a0e1f704
authored
May 13, 2020
by
christopher.foster
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated queries, still non functional
parent
a6fe9c6f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
DBConnector.java
app/src/main/java/com/example/assignment/DBConnector.java
+3
-3
No files found.
app/src/main/java/com/example/assignment/DBConnector.java
View file @
a0e1f704
...
@@ -23,7 +23,7 @@ public class DBConnector extends SQLiteOpenHelper {
...
@@ -23,7 +23,7 @@ public class DBConnector extends SQLiteOpenHelper {
@Override
@Override
public
void
onCreate
(
SQLiteDatabase
db
)
public
void
onCreate
(
SQLiteDatabase
db
)
{
{
String
CREATE_table
=
"CREATE TABLE "
+
TABLE_Users
+
"("
+
COLUMN_ID
+
"INTEGER PRIMARY KEY,
"
+
COLUMN_Name
+
"TEXT,"
+
COLUMN_UserName
+
"TEXT,"
+
COLUMN_Password
+
"INTEGER
"
+
")"
;
String
CREATE_table
=
"CREATE TABLE "
+
TABLE_Users
+
"("
+
COLUMN_ID
+
"INTEGER PRIMARY KEY,
"
+
COLUMN_Name
+
" TEXT, "
+
COLUMN_UserName
+
" TEXT, "
+
COLUMN_Password
+
" INTEGER
"
+
")"
;
db
.
execSQL
(
CREATE_table
);
db
.
execSQL
(
CREATE_table
);
}
}
...
@@ -48,7 +48,7 @@ public class DBConnector extends SQLiteOpenHelper {
...
@@ -48,7 +48,7 @@ public class DBConnector extends SQLiteOpenHelper {
{
{
boolean
correct
=
false
;
boolean
correct
=
false
;
String
query
=
"Select * FROM
"
+
TABLE_Users
+
"
= \""
+
username
+
"\""
;
String
query
=
"Select * FROM
"
+
TABLE_Users
+
"
= \""
+
username
+
"\""
;
SQLiteDatabase
db
=
this
.
getWritableDatabase
();
SQLiteDatabase
db
=
this
.
getWritableDatabase
();
Cursor
cursor
=
db
.
rawQuery
(
query
,
null
);
Cursor
cursor
=
db
.
rawQuery
(
query
,
null
);
...
@@ -72,7 +72,7 @@ public class DBConnector extends SQLiteOpenHelper {
...
@@ -72,7 +72,7 @@ public class DBConnector extends SQLiteOpenHelper {
public
String
finduser
(
String
username
)
public
String
finduser
(
String
username
)
{
{
String
string
=
null
;
String
string
=
null
;
String
query
=
"Select * FROM
"
+
TABLE_Users
+
"WHERE"
+
COLUMN_UserName
+
"
= \""
+
username
+
"\""
;
String
query
=
"Select * FROM
"
+
TABLE_Users
+
" WHERE "
+
COLUMN_UserName
+
"
= \""
+
username
+
"\""
;
SQLiteDatabase
db
=
this
.
getWritableDatabase
();
SQLiteDatabase
db
=
this
.
getWritableDatabase
();
Cursor
cursor
=
db
.
rawQuery
(
query
,
null
);
Cursor
cursor
=
db
.
rawQuery
(
query
,
null
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment