Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
map-parent
Overview
Overview
Details
Activity
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
常超
map-parent
Commits
6209837d
Commit
6209837d
authored
Sep 29, 2022
by
宋珺琪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数据表统计功能
parent
830c8cd2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
0 deletions
+52
-0
common/common_utils/src/main/java/com/founder/commonutils/util/JDBCUtil.java
+52
-0
service/publicapi/src/main/java/com/founder/publicapi/controller/Database/DatabaseController.java
+0
-0
No files found.
common/common_utils/src/main/java/com/founder/commonutils/util/JDBCUtil.java
0 → 100644
View file @
6209837d
package
com
.
founder
.
commonutils
.
util
;
import
java.sql.*
;
public
class
JDBCUtil
{
private
static
final
String
DRIVER
=
"com.mysql.cj.jdbc.Driver"
;
//驱动类类名
private
static
final
String
DBURL
=
"jdbc:mysql://47.92.48.137:3900/skyp?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai"
;
//连接URL,javaweb为数据库名
private
static
final
String
DBUSER
=
"root"
;
//数据库用户
private
static
final
String
DBPASSWORD
=
"gkptCcYy123"
;
//数据库密码
public
static
Connection
getConnection
()
{
Connection
connection
=
null
;
try
{
Class
.
forName
(
DRIVER
);
connection
=
DriverManager
.
getConnection
(
DBURL
,
DBUSER
,
DBPASSWORD
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
connection
;
}
public
static
void
close
(
Connection
connection
,
Statement
ps
,
ResultSet
rs
)
{
if
(
rs
!=
null
)
{
try
{
rs
.
close
();
}
catch
(
SQLException
e
)
{
e
.
printStackTrace
();
}
}
if
(
ps
!=
null
)
{
try
{
ps
.
close
();
}
catch
(
SQLException
e
)
{
e
.
printStackTrace
();
}
}
if
(
connection
!=
null
)
{
try
{
connection
.
close
();
}
catch
(
SQLException
e
)
{
e
.
printStackTrace
();
}
}
}
}
service/publicapi/src/main/java/com/founder/publicapi/controller/Database/DatabaseController.java
View file @
6209837d
This diff is collapsed.
Click to expand it.
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