当前位置:网站首页>kettle入门之文本文件导入数据库
kettle入门之文本文件导入数据库
2022-07-21 05:21:00 【小林家的史莱姆】
启动kettle
e
数据库连接,首先需要将相应的数据库驱动
添加到lib
目录下
数据库连接测试
设置数据库连接配置
下面视图是我使用JDBC
连接本机MySQL
访问的是test
数据库,端口号3306
,点击测试
,就会显示,是否连接成功。
既然连接成功,那就做一个小demo:将文本文件中的内容导入到MySQL数据库。
准备:一个文本文件,数据库连接成功,访问的数据库中有一张表。
文本文件路径:F:\test\test.txt
Test.txt
内容如下:
JY01011604280016|JY010116042800160019|1|1|2017-04-27|1000000.00|121666.66|1000000.00|121666.66| |01 |
JY01011604280022|JY010116042800220025|1|1|2017-04-27|1000000.00|121666.66|1000000.00|121666.66| |01 |
WT01011607040001|WT010116070400010002|1|1|2016-08-04|12000.00|51.67|12000.00|51.67| |01 |
JY01011602020103|JY010116020201030004|2|2|2016-06-20|0.00|28933.33|0.00|28933.33| |01 |
JY01011602020103|JY010116020201030004|3|1|2016-08-01|2000000.00|19600.00|2000000.00|19600.00| |01 |
LD01011607160101|LD010116071601010002|1|1|2016-08-23|16.67|0.94|16.67|0.94| |01 |
LD01011607160104|LD010116071601040004|1|1|2016-08-23|83.33|4.71|83.33|4.71| |01 |
JY02011607310101|JY020116073101010002|1|1|2016-08-01|233980.65|2391.67|233980.65|2391.67| |01 |
JY02011607310001|JY020116073100010002|1|1|2016-08-01|166830.63|3000.00|166830.63|3000.00| |01 |
LD01011607160101|LD010116071601010002|1|1|2016-08-23|16.67|0.94|16.67|0.94| |01 |
LD01011607160104|LD010116071601040004|1|1|2016-08-23|83.33|4.71|83.33|4.71| |01 |
LD01011607160101|LD010116071601010002|1|1|2016-08-23|16.67|0.94|16.67|0.94| |01 |
LD01011607160104|LD010116071601040004|1|1|2016-08-23|83.33|4.71|83.33|4.71| |01 |
JY01011604280016|JY010116042800160019|1|1|2017-04-27|1000000.00|121666.66|1000000.00|121666.66| |01 |
JY01011604280022|JY010116042800220025|1|1|2017-04-27|1000000.00|121666.66|1000000.00|121666.66| |01 |
WT01011607040001|WT010116070400010002|1|1|2016-08-04|12000.00|51.67|12000.00|51.67| |01 |
JY01011602020103|JY010116020201030004|2|2|2016-06-20|0.00|28933.33|0.00|28933.33| |01 |
JY01011602020103|JY010116020201030004|3|1|2016-08-01|2000000.00|19600.00|2000000.00|19600.00| |01 |
JY01011604280016|JY010116042800160019|1|1|2017-04-27|1000000.00|121666.66|1000000.00|121666.66| |01 |
JY01011604280022|JY010116042800220025|1|1|2017-04-27|1000000.00|121666.66|1000000.00|121666.66| |01 |
WT01011607040001|WT010116070400010002|1|1|2016-08-04|12000.00|51.67|12000.00|51.67| |01 |
JY01011602020103|JY010116020201030004|2|2|2016-06-20|0.00|28933.33|0.00|28933.33| |01 |
JY01011602020103|JY010116020201030004|3|1|2016-08-01|2000000.00|19600.00|2000000.00|19600.00| |01 |
MySQL数据库中,访问的是test
数据库,表acc_repayschedule
acc_repayschedule
表信息如下:
建表语句如下:
CREATE TABLE ACC_REPAYSCHEDULE
(
contractno VARCHAR(30),
duebillno VARCHAR(30) NOT NULL,
currentno VARCHAR(30) NOT NULL,
STATUS VARCHAR(2),
maturedate DATE,
currentsum DECIMAL(16,2),
currentinterest DECIMAL(16,2),
paysum DECIMAL(16,2),
payinterest DECIMAL(16,2),
closedate DATE,
currency VARCHAR(2)
)
准备工作完成!!!!
开始配置
首先有一个文本文件输入+一个表输出
那么怎样找到呢?表输出雷同。
中间的箭头表示将文本文件的内容输到指向的地方。(按着shift左击文本文件输入将线拖动到表输出
)
接下来配置文本文件。双击
文本文件输入图标
点击预览,查看是否成功,成功之后点击确定
走到这里,文件输入没问题了,那就开始配置数据库信息。
配置已经到位,马上开始工作了。
点击run-------启动
显示如下信息,表示已经成功了
上面出现对号,不是红杠。
那么看一下数据中的表数据吧。。。
那么恭喜你简单的小入门已经完成了,继续努力吧。
边栏推荐
猜你喜欢
Stack differences
高可用集群Keepalived
3. Use playbook in ansible
The shortcomings of LVS and the fourth forwarding type fullnat
SQL summary data
Learn IO from simple to deep
TZC 1283: simple sort merge sort
LAMP架構——mysql路由器(讀寫分離器)
Intranet detection 1- working group information collection & intra domain information collection
Oracle subquery
随机推荐
Navicat 16.1 provides a new choice of management development tools for oceanbase Community Edition
Take you to easily decrypt the white box test and (Demo detailed explanation)
Tcp/ip Foundation
The database is for the salaries table emp above_ No field create index idx_ emp_ no
Part 06: pooling Technology
Connections and differences between three-level dispatching
table表格
Frequently asked interview questions in software testing [3]
Part 03: SQL syntax tree parsing
Atomic quotation to solve ABA problem
Learn IO from simple to deep
Kruskal reconstruction tree
Analysis of cross apply and outer apply query of SQL Server - Part I
二叉树的先根,中根,后根遍历
First root, middle root, and last root traversal of binary tree
NFS FTP PXE
虛擬機的封裝
虚拟机的封装
centos7部署mysql8
I spent 6000 to sign up for the test training class. Three months later, I successfully "cheated" into Tencent with a monthly salary of 17k