I use JDBC to run "dfs -lsr hdfs://hdpnn:9000/group/hive/" command, but ResultSet don't return value, the code like below:
Class.forName("org.apache.hadoop.hive.jdbc.HiveDriver"); hiveConnection = DriverManager.getConnection("jdbc:hive:// 10.232.11.53:10000/default" , "root", "root"); statement = hiveConnection.createStatement(); String sql = "dfs -mkdir hdfs://hdpnn:9000//group/tbprofile/mianfeng/scratch/test/001/ "; ResultSet result = statement.executeQuery(sql); //the ResultSet don't return any value. while(result.next()) { System.out.println("day_id =" + result.getString(1) );//the } statement.execute("set remove.scratch.dir=ture"); statement.close(); I run the command in CLI, there is output content, the content like below : drwxr-x--- - mianfeng cug-tbprofile 0 2010-10-25 20:55 /group/tbprofile/mianfeng/scratch/test/001