Skip to Content
Java数据科学实战
book

Java数据科学实战

by Michael R. Brzustowicz, PhD
January 2020
Intermediate to advanced
202 pages
5h 41m
Chinese
Posts & Telecom Press
Content preview from Java数据科学实战
数据的输入与输出
|
15
如果文件是要累积的,那么不要忘记设置
FileWriter
中的追加位。只需通过在
FileWriter
中设置追加位,就可以把更多
JSON
记录添加到文件末尾:
try
(BufferedWriter bw =
new
BufferedWriter(
new
FileWriter("somefile.txt",
true
)) ) {
...
}
1.5
 掌握数据库操作
关系数据库(例如
MySQL
)的稳健性与灵活性使得它们成为许多应用场合中最适合的技
术。作为一名数据科学家,你很可能会与关系数据库交互,以连接到更大的应用,或者会
为数据科学小组的任务生成一些有组织的压缩数据表格。无论哪种情况,掌握命令行、结
构化查询语言(
SQL
)以及
Java
数据库连接(
JDBC
)都是关键的技能。
1.5.1
 命令行客户端
对于管理数据库以及执行查询而言,命令行是很棒的环境。作为交互式
shell
,客户端可以
对探索数据的命令进行快速修改。查询语句在命令行中通过后,你可以在以后把
SQL
写入
到
Java
程序中。为了满足更加灵活的运用,查询中可以包括参数。所有流行的数据库,例
如
MySQL
、
PostgreSQL
和
SQLite
,都有命令行客户端。在已经安装了
MySQL
(用于开
发)的系统中(例如个人计算机),应该能够匿名登录以进行数据库连接,其中数据库名
是可选的。
bash$
mysql
<
database
>
然而,你也许不能创建新数据库。可以用如下命令以数据库管理员身份登录:
bash$
mysql -u root ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

云安全实用指南

云安全实用指南

Chris Dotson
Kafka权威指南

Kafka权威指南

Neha Narkhede, Gwen Shapira, Todd Palino

Publisher Resources

ISBN: 9787115533302