Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
study
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
Li Yongyu
study
Commits
db0d3708
Commit
db0d3708
authored
Mar 18, 2019
by
Li Yongyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db
parent
6e6664fb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
104 additions
and
0 deletions
+104
-0
MYSQLConnection.java
...Api_auto_test/src/com/offcn/TestUnti/MYSQLConnection.java
+38
-0
sql.java
studycenter_Api_auto_test/src/com/offcn/system/sql.java
+37
-0
DatabaseSql.xml
studycenter_Api_auto_test/src/resources/DatabaseSql.xml
+29
-0
No files found.
studycenter_Api_auto_test/src/com/offcn/TestUnti/MYSQLConnection.java
0 → 100644
View file @
db0d3708
package
com
.
offcn
.
TestUnti
;
import
java.sql.Connection
;
import
java.sql.DriverManager
;
import
java.sql.PreparedStatement
;
import
java.sql.ResultSet
;
import
java.sql.SQLException
;
import
java.sql.Statement
;
public
class
MYSQLConnection
{
public
static
Connection
coontSql
(
String
url
,
String
name
,
String
pwd
){
Connection
ct
=
null
;
try
{
Class
.
forName
(
"com.mysql.jdbc.Driver"
);
ct
=
DriverManager
.
getConnection
(
url
,
name
,
pwd
);
}
catch
(
ClassNotFoundException
e
)
{
System
.
out
.
println
(
"获取驱动失败"
);
e
.
printStackTrace
();
}
catch
(
SQLException
e
)
{
System
.
out
.
println
(
"建立连接失败"
);
e
.
printStackTrace
();
}
return
ct
;
}
public
static
Statement
stmtSql
(
Connection
ct
){
Statement
stmt
=
null
;
try
{
stmt
=
ct
.
createStatement
();
}
catch
(
SQLException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
return
stmt
;
}
}
studycenter_Api_auto_test/src/com/offcn/system/sql.java
0 → 100644
View file @
db0d3708
package
com
.
offcn
.
system
;
public
class
sql
{
private
String
sqlurl
;
private
String
sqlname
;
private
String
sqlpwd
;
public
String
getSqlurl
()
{
return
sqlurl
;
}
public
void
setSqlurl
(
String
sqlurl
)
{
this
.
sqlurl
=
sqlurl
;
}
public
String
getSqlname
()
{
return
sqlname
;
}
public
void
setSqlname
(
String
sqlname
)
{
this
.
sqlname
=
sqlname
;
}
public
String
getSqlpwd
()
{
return
sqlpwd
;
}
public
void
setSqlpwd
(
String
sqlpwd
)
{
this
.
sqlpwd
=
sqlpwd
;
}
public
sql
(
String
sqlurl
,
String
sqlname
,
String
sqlpwd
)
{
super
();
this
.
sqlurl
=
sqlurl
;
this
.
sqlname
=
sqlname
;
this
.
sqlpwd
=
sqlpwd
;
}
public
sql
()
{
}
}
studycenter_Api_auto_test/src/resources/DatabaseSql.xml
0 → 100644
View file @
db0d3708
<?xml version="1.0" encoding="UTF-8"?>
<Databases>
<Database
name=
"xyzb"
>
<sqlurl>
jdbc:mysql://192.168.10.222:3306/xyu?useUnicode=true
&
characterEncoding=UTF-8
&
zeroDateTimeBehavior=convertToNull
</sqlurl>
<sqlname>
root
</sqlname>
<sqlpwd>
offcn.com
</sqlpwd>
</Database>
<Database
name=
"tk"
>
<sqlurl>
jdbc:mysql://39.105.124.219:3312/tiku?useUnicode=true
&
characterEncoding=UTF-8
&
zeroDateTimeBehavior=convertToNull
</sqlurl>
<sqlname>
testTest
</sqlname>
<sqlpwd>
7b467efW#$%f5c50aa3d
</sqlpwd>
</Database>
<Database
name=
"nwn"
>
<sqlurl>
jdbc:mysql://39.105.124.219:3312/nwn?useUnicode=true
&
characterEncoding=UTF-8
&
zeroDateTimeBehavior=convertToNull
</sqlurl>
<sqlname>
nwnBeta
</sqlname>
<sqlpwd>
Beta@
&
123
</sqlpwd>
</Database>
<Database
name=
"zxkt"
>
<sqlurl>
jdbc:mysql://rm-2zevlk47ul0ovuci80o.mysql.rds.aliyuncs.com:3306/zxkt?useUnicode=true
&
characterEncoding=UTF-8
&
zeroDateTimeBehavior=convertToNull
</sqlurl>
<sqlname>
zxkt
</sqlname>
<sqlpwd>
WWCsss2131jjjjjJJJD
</sqlpwd>
</Database>
</Databases>
\ 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