Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
lwby_ad_data
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
maliang
lwby_ad_data
Commits
b048e4b9
Commit
b048e4b9
authored
Apr 30, 2020
by
maliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
权限控制
parent
3dbf29f1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
13 deletions
+19
-13
pom.xml
pom.xml
+7
-5
ConnectionJDBC.java
...n/java/com/boot/security/server/utils/ConnectionJDBC.java
+11
-7
config.properties
src/main/resources/config.properties
+1
-1
No files found.
pom.xml
View file @
b048e4b9
...
...
@@ -77,11 +77,6 @@
<artifactId>
mybatis-spring-boot-starter
</artifactId>
<version>
${mybatis.version}
</version>
</dependency>
<dependency>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
<scope>
runtime
</scope>
</dependency>
<!--<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
...
...
@@ -143,6 +138,13 @@
<artifactId>
jedis
</artifactId>
<version>
2.10.2
</version>
</dependency>
<dependency>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
<version>
5.1.44
</version>
<scope>
compile
</scope>
<!--<scope>runtime</scope>-->
</dependency>
<dependency>
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
...
...
src/main/java/com/boot/security/server/utils/ConnectionJDBC.java
View file @
b048e4b9
...
...
@@ -16,15 +16,15 @@ public class ConnectionJDBC {
* */
public
static
Connection
getConnection
()
throws
Exception
{
//1.加载配置文件
InputStream
is
=
ClassLoader
.
getSystemResourceAsStream
(
"config.properties"
);
Properties
pros
=
new
Properties
();
pros
.
load
(
is
);
//
InputStream is = ClassLoader.getSystemResourceAsStream("config.properties");
//
Properties pros = new Properties();
//
pros.load(is);
//2.读取配置信息
String
user
=
pros
.
getProperty
(
"user"
)
;
String
password
=
pros
.
getProperty
(
"password"
)
;
String
url
=
pros
.
getProperty
(
"url"
)
;
String
driverClass
=
pros
.
getProperty
(
"driverClass"
)
;
String
user
=
"read_bi"
;
String
password
=
"OxmQkfpS2019"
;
String
url
=
"jdbc:mysql://rr-2ze3749220qh1448p.mysql.rds.aliyuncs.com:3306/lwby_novel?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false"
;
String
driverClass
=
"com.mysql.jdbc.Driver"
;
//System.out.println(driverClass);
...
...
@@ -100,6 +100,10 @@ public class ConnectionJDBC {
String
codeId
=
rs
.
getString
(
3
);
String
advertName
=
rs
.
getString
(
4
);
Integer
platformId
=
rs
.
getInt
(
5
);
System
.
out
.
println
(
advertiserId
);
System
.
out
.
println
(
advertiserName
);
// 获取列的别名:列的别名,使用类的属性名充当
//String columnLabel = rsmd.getColumnLabel(i + 1);
//给相应属性赋值
...
...
src/main/resources/config.properties
View file @
b048e4b9
...
...
@@ -12,7 +12,7 @@ cassnadra.keyspace=dmp
user
=
read_bi
password
=
OxmQkfpS2019
url
=
jdbc:mysql://rr-2ze3749220qh1448p.mysql.rds.aliyuncs.com:3306/lwby_novel
url
=
jdbc:mysql://rr-2ze3749220qh1448p.mysql.rds.aliyuncs.com:3306/lwby_novel
?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
driverClass
=
com.mysql.jdbc.Driver
## redis配置
...
...
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