Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
data-computing-proxy-test
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李振振
data-computing-proxy-test
Commits
bb6e6f78
Commit
bb6e6f78
authored
Aug 04, 2023
by
李振振
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
polardbx的curd测试
parent
cb3b0f8e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
22 deletions
+21
-22
src/main/java/com/beagle/informix/repository/impl/VccinfoDaoImpl.java
...a/com/beagle/informix/repository/impl/VccinfoDaoImpl.java
+3
-4
src/main/java/com/beagle/informix/service/impl/InformixHibernateServiceImpl.java
...e/informix/service/impl/InformixHibernateServiceImpl.java
+4
-4
src/main/java/com/beagle/informix/service/impl/InformixJdbcProxyServiceImpl.java
...e/informix/service/impl/InformixJdbcProxyServiceImpl.java
+4
-4
src/main/java/com/beagle/informix/service/impl/InformixMybatisServiceImpl.java
...gle/informix/service/impl/InformixMybatisServiceImpl.java
+8
-8
src/main/resources/application.yaml
src/main/resources/application.yaml
+2
-2
No files found.
src/main/java/com/beagle/informix/repository/impl/VccinfoDaoImpl.java
View file @
bb6e6f78
...
...
@@ -69,14 +69,13 @@ public class VccinfoDaoImpl implements VccinfoDao {
// 第二步:设置jpql的参数
Query
query
=
entityManager
.
createQuery
(
jpql
);
query
.
setParameter
(
1
,
"赵六666999"
);
query
.
setParameter
(
2
,
"%jpa%"
);
query
.
setParameter
(
1
,
vccinfo
.
getVName
()
);
query
.
setParameter
(
2
,
vccinfo
.
getVId
()
);
// 第三步:执行jpql
int
rows
=
query
.
executeUpdate
();
System
.
out
.
println
(
"影响的行数:"
+
rows
);
transaction
.
commit
();
// transaction.commit();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
// transaction.rollback();
...
...
src/main/java/com/beagle/informix/service/impl/InformixHibernateServiceImpl.java
View file @
bb6e6f78
...
...
@@ -35,10 +35,10 @@ public class InformixHibernateServiceImpl implements InformixService {
@Override
@Transactional
public
void
doConnectJob
()
throws
Exception
{
insert
();
// update(
);
// query(
);
// delete(
);
//
insert();
update
(
123458
);
query
(
123458
);
delete
(
123458
);
}
private
void
insert
()
throws
Exception
{
Vccinfo
vccinfo
=
new
Vccinfo
();
...
...
src/main/java/com/beagle/informix/service/impl/InformixJdbcProxyServiceImpl.java
View file @
bb6e6f78
...
...
@@ -45,9 +45,9 @@ public class InformixJdbcProxyServiceImpl implements InformixService {
Driver
driver
=
getDriver
();
Connection
conn
=
getConnection
(
driver
);
insert
(
conn
);
//
update(conn);
//
query(conn);
//
delete(conn);
update
(
conn
);
query
(
conn
);
delete
(
conn
);
closeConnection
(
conn
);
deregisterDriver
(
driver
);
}
...
...
@@ -125,7 +125,7 @@ public class InformixJdbcProxyServiceImpl implements InformixService {
Properties
properties
=
new
Properties
();
// 组装连接数据库信息
// jdbc:informix-sqli://<server>:<port1526>/<database>:informixserver=<dbservername>
StringBuilder
jdbcBuilder
=
new
StringBuilder
(
"jdbc:mysql://localhost:
3307
"
)
StringBuilder
jdbcBuilder
=
new
StringBuilder
(
"jdbc:mysql://localhost:
13309
"
)
.
append
(
"/"
)
.
append
(
"testdb"
).
append
(
"?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=Asia/Shanghai&useServerPrepStmts=true"
);
DriverManager
.
setLoginTimeout
(
10
);
...
...
src/main/java/com/beagle/informix/service/impl/InformixMybatisServiceImpl.java
View file @
bb6e6f78
...
...
@@ -35,14 +35,14 @@ public class InformixMybatisServiceImpl extends ServiceImpl<VccinfoMapper, Vccin
@Override
@Transactional
public
void
doConnectJob
()
throws
Exception
{
insertMethod
();
//
updateMethod();
//
queryMethod();
//
delete();
//
insertMethod();
updateMethod
();
queryMethod
();
delete
();
}
private
void
insertMethod
()
throws
Exception
{
Vccinfo
vccinfo
=
new
Vccinfo
();
vccinfo
.
setVId
(
3
);
//
vccinfo.setVId(3);
vccinfo
.
setEffective
(
1
);
vccinfo
.
setVName
(
"mybatis"
);
vccinfo
.
setIvrMax
(
1
);
...
...
@@ -65,19 +65,19 @@ public class InformixMybatisServiceImpl extends ServiceImpl<VccinfoMapper, Vccin
private
void
updateMethod
()
throws
Exception
{
LambdaQueryWrapper
<
Vccinfo
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
Vccinfo:
:
getVId
,
"
ibatis
"
);
queryWrapper
.
eq
(
Vccinfo:
:
getVId
,
"
123459
"
);
Vccinfo
vccinfo
=
new
Vccinfo
();
vccinfo
.
setVName
(
"mybatis-update"
);
baseMapper
.
update
(
vccinfo
,
queryWrapper
);
}
private
void
queryMethod
()
{
List
<
Vccinfo
>
vccinfoList
=
vccinfoMapper
.
queryList
(
1
);
List
<
Vccinfo
>
vccinfoList
=
vccinfoMapper
.
queryList
(
1
23459
);
log
.
info
(
"queryAll:{}"
,
JSONUtil
.
toJsonStr
(
vccinfoList
));
}
private
void
delete
()
{
LambdaQueryWrapper
<
Vccinfo
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
Vccinfo:
:
getVId
,
"
ibatis
"
);
queryWrapper
.
eq
(
Vccinfo:
:
getVId
,
"
123459
"
);
baseMapper
.
delete
(
queryWrapper
);
}
...
...
src/main/resources/application.yaml
View file @
bb6e6f78
...
...
@@ -4,7 +4,7 @@ spring:
# url: jdbc:informix-sqli://localhost:9088/testdb:INFORMIXSERVER=informix
#&useServerPrepStmts=true
# url: jdbc:mysql://localhost:3307/testdb?useUnicode=true&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=Asia/Shanghai
url
:
jdbc:mysql://localhost:
3307
/testdb?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=Asia/Shanghai
url
:
jdbc:mysql://localhost:
13309
/testdb?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=Asia/Shanghai
# url: jdbc:mysql://localhost:3307/testdb?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=Asia/Shanghai&useServerPrepStmts=true
username
:
root
# username: informix
...
...
@@ -26,7 +26,7 @@ spring:
jpa
:
properties
:
hibernate
:
dialect
:
org.hibernate.dialect.
Informix
Dialect
dialect
:
org.hibernate.dialect.
MySQL
Dialect
format_sql
:
true
mybatis-plus
:
configuration
:
...
...
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