Details
-
Type:
Monitor
-
Status: Closed
-
Priority:
Major
-
Resolution: Done
-
Affects Version/s: None
-
Fix Version/s: 2021
-
Component/s: FIWARE-TECH-HELP
-
Labels:
-
HD-Chapter:Data
-
HD-Enabler:Cosmos
Description
Created question in FIWARE Q/A platform on 14-10-2014 at 18:10
Please, ANSWER this question AT http://stackoverflow.com/questions/26366059/accesing-cosmos-data-with-hive-from-javascript
Question:
Accesing Cosmos data with Hive from Javascript
Description:
I'm triying to access data stored in Cosmos by using javascript to create a web interface. I know there's a java code available to make query's with Hive. That code is shown below:
private Connection getConnection(
String ip, String port, String user, String password) {
try
catch (ClassNotFoundException e)
{ System.out.println(e.getMessage()); return null; } // try catchtry { // return a connection based on the Hive JDBC driver, default DB return DriverManager.getConnection("jdbc:hive://" + ip + ":" + port + "/default?user=" + user + "&password=" + password); } catch (SQLException e) { System.out.println(e.getMessage()); return null; }
// try catch
} // getConnection
private void doQuery() {
try {
// from here on, everything is SQL!
Statement stmt = con.createStatement();
ResultSet res = stmt.executeQuery("select column1,column2," +
"otherColumns from mytable where column1='whatever' and " +
"columns2 like '%whatever%'");
// iterate on the result
while (res.next())
// while
// close everything
res.close(); stmt.close(); con.close();
} catch (SQLException ex)
// try catch
} // doQuery
I need to know how to implement that code in javascript, I know it's possible but I don't know how.
Thanks!
Activity
Field | Original Value | New Value |
---|---|---|
Component/s | FIWARE-TECH-HELP [ 10278 ] |
Status | Open [ 1 ] | In Progress [ 3 ] |
Status | In Progress [ 3 ] | Answered [ 10104 ] |
Resolution | Done [ 10000 ] | |
Status | Answered [ 10104 ] | Closed [ 6 ] |
Assignee | Francisco Romero [ frb ] |
Summary | FIWARE.Question.Lab.Accesing Cosmos data with Hive from Javascript | FIWARE.Question.Tech.Accesing Cosmos data with Hive from Javascript |
Summary | FIWARE.Question.Tech.Accesing Cosmos data with Hive from Javascript | FIWARE.Question.Tech.FIWARE.Question.Tech.Accesing Cosmos data with Hive from Javascript |
Summary | FIWARE.Question.Tech.FIWARE.Question.Tech.Accesing Cosmos data with Hive from Javascript | FIWARE.Question.Tech.Accesing Cosmos data with Hive from Javascript |
Summary | FIWARE.Question.Tech.Accesing Cosmos data with Hive from Javascript | FIWARE.Question.Tech.Data.BigData-Analysis.Accesing Cosmos data with Hive from Javascript |
HD-Enabler | Cosmos [ 10872 ] | |
HD-Chapter | Data [ 10838 ] |
Fix Version/s | 2021 [ 12600 ] |