Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
db_studies
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
Deokhyun Lee
db_studies
Commits
b939d186
Commit
b939d186
authored
Dec 03, 2021
by
Deokhyun Lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added updateUserInfo
parent
fdb013f6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
MemberDaoImpl.java
src/dao/MemberDaoImpl.java
+24
-0
No files found.
src/dao/MemberDaoImpl.java
View file @
b939d186
...
...
@@ -161,4 +161,28 @@ public class MemberDaoImpl implements MemberDao {
}
}
}
public
void
updateUserInfo
(
String
email
,
String
password
,
String
changePassword
)
{
String
table
=
"SELECT * FROM mytestdb.major_table"
;
String
sql
=
"UPDATE mytestdb.major_table SET password=? WHERE email=?"
;
PreparedStatement
pstmt
=
null
;
PreparedStatement
pstmtTable
=
null
;
try
{
pstmtTable
=
conn
.
prepareStatement
(
table
);
pstmt
=
conn
.
prepareStatement
(
sql
);
ResultSet
rs
=
pstmtTable
.
executeQuery
();
while
(
rs
.
next
()){
if
(
rs
.
getString
(
"email"
).
equals
(
email
)
&&
rs
.
getString
(
password
).
equals
(
password
)){
pstmt
.
setString
(
1
,
changePassword
);
pstmt
.
setString
(
2
,
email
);
pstmt
.
executeUpdate
();
System
.
out
.
println
(
"수정된 이름: "
+
changePassword
);
break
;
}
}
}
catch
(
SQLException
e
)
{
e
.
printStackTrace
();
}
}
}
\ No newline at end of file
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