docker run -d --name postgres --restart always -p 5432:5432 -e POSTGRES_PASSWORD=root123 -e PGDATA=/var/lib/postgresql/data/pgdata -v /tmp/postgres/data:/var/lib/postgresql/data postgres
docker exec -it postgres bash
psql -U postgres
create database customer;
\c customer
create table userinfo(id int primary key, name char(32), age int);
insert into userinfo values(1, 'xw', 18);
select * from userinfo;
CREATE USER tom WITH PASSWORD 'root123';
grant insert on userinfo to tom;
grant select on userinfo to tom;
grant update on userinfo to tom;
<root>
<Insert_Statement1>
<dbTableName action="INSERT">
<table>userinfo</table>
<access>
<id>121</id>
<name>test121</name>
<age>19</age>
</access>
</dbTableName>
</Insert_Statement1>
</root>
JDBC Data Source Aliase come from previous step. Click on Save and Deploy .
docker ps
docker exec -it f0e748998892 bash
psql -U postgres
\c customer
select * from userinfo;
The Ends!
Thanks for your time!
Best regards!
Jacky Liu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
28 | |
27 | |
14 | |
13 | |
12 | |
11 | |
10 | |
7 | |
7 | |
6 |