1 2 1
摘要: 1 /* 2 当数据类型不一样时,将会发生数据类型转换。 3 4 自动类型转换(隐式) 5 1. 特点:代码不需要进行特殊处理,自动完成。 6 2. 规则:数据范围从小到大。 7 8 强制类型转换(显式) 9 */ 10 public class Demo01 { 11 public static void main(String[] args) { 12 Sys... 阅读全文
posted @ 2019-12-11 16:05 NotFound-404 阅读(496) 评论(0) 推荐(0)
摘要: Demo-01 1 import pymysql 2 #连接数据库 3 db = pymysql.connect(host='localhost',user='root', password='123456', port=3306) 4 #获取游标 5 cursor = db.cursor() 6 #执行 7 cursor.execute('SELECT VERSION()') 8... 阅读全文
posted @ 2019-12-11 15:51 NotFound-404 阅读(195) 评论(0) 推荐(0)
摘要: 1 import pymysql 2 # 连接数据库 3 db =pymysql.connect( 4 host='127.0.0.1', #需要连接的主机IP地址 5 user='root', #MySQL数据库用户名 6 passwd='your password', #MySQL数据库密码 7 阅读全文
posted @ 2019-12-11 15:36 NotFound-404 阅读(192) 评论(0) 推荐(0)
摘要: 1 @Test 2 public void testListStatus() throws IOException, InterruptedException, URISyntaxException { 3 4 //获取文件配置信息 5 Configuration configuration = new Configuration(); 6 FileSystem fs = F... 阅读全文
posted @ 2019-10-08 16:31 NotFound-404 阅读(523) 评论(0) 推荐(0)
摘要: 1 //文件详情查看 2 @Test 3 public void testListFiles() throws IOException, InterruptedException, URISyntaxException { 4 5 //获取文件系统 6 Configuration configuration = new Configuration(); 7 FileSyst... 阅读全文
posted @ 2019-10-08 15:41 NotFound-404 阅读(110) 评论(0) 推荐(0)
摘要: 1 //文件名更改 2 @Test 3 public void testRename() throws IOException, InterruptedException, URISyntaxException { 4 5 //获取文件系统 6 Configuration configuration = new Configuration(); 7 FileSystem f... 阅读全文
posted @ 2019-10-08 15:38 NotFound-404 阅读(926) 评论(0) 推荐(0)
摘要: 1 @Test 2 public void testDelete() throws IOException, InterruptedException, URISyntaxException { 3 4 //1.获取文件系统 5 Configuration configuration = new Configuration(); 6 FileSystem fs = FileS... 阅读全文
posted @ 2019-10-08 15:09 NotFound-404 阅读(549) 评论(0) 推荐(0)
摘要: 1 //文件下载 2 @Test 3 public void testCopyToLocalFile() throws IOException,InterruptedException,URISyntaxException{ 4 5 //1.获取文件系统 6 Configuration configuration = new Configuration(); 7 F... 阅读全文
posted @ 2019-10-08 14:59 NotFound-404 阅读(255) 评论(0) 推荐(0)
摘要: 1.在src/main/resources文件夹下创建 hdfs-site.xml 文件 1 2 --> 3 4 5 6 dfs.replication 7 8 1 9 10 2.文件上传 1 //文件上传 2 @Test 3 public void testCopyFromLocalFeil() throws IOException, I... 阅读全文
posted @ 2019-10-08 10:31 NotFound-404 阅读(282) 评论(0) 推荐(0)
摘要: 1 public class HDFSClient { 2 3 public static void main(String[] args) throws IOException, Exception, URISyntaxException { 4 //操作集群 5 //获取文件系统 6 Configuration conf = new Configuration()... 阅读全文
posted @ 2019-09-29 11:23 NotFound-404 阅读(316) 评论(0) 推荐(0)