HI,
I am new to DAS and REST API.
I converted normal h2 databases in to mysql as follows,
<datasource>
<name>WSO2_ANALYTICS_EVENT_STORE_DB</name>
<description>The datasource used for analytics record
store</description>
<definition type="RDBMS">
<configuration>
<url>jdbc:mysql://localhost:3306/Election</url>
<username>root</username>
<password>root</password>
<driverClassName>com.mysql.jdbc.Driver</driverClassName>
<maxActive>80</maxActive>
<maxWait>60000</maxWait>
<validationQuery>SELECT 1</validationQuery>
<defaultAutoCommit>false</defaultAutoCommit>
<initialSize>0</initialSize>
<testWhileIdle>true</testWhileIdle>
<minEvictableIdleTimeMillis>4000</minEvictableIdleTimeMillis>
</configuration>
</definition>
</datasource>
My intention is to store persistent data which i got from SPARK queeries in
to a mySQL databse/tables, so that i get retrieve them from outside jaggery
server/juggeryApp.
My work succeeded, I get data into databases.
Now I tried to retrieve those data through a juggeryapp
<html>
<body>
<h2>Below is a Jaggery print</h2>
<%
config = {};
var db = new Database("jdbc:mysql://localhost:3306/Election",
"root", "root", config);
var q1 =" SELECT * FROM ANX___7LgTGRXo_ ";
var data= db.query(q1);
print(data);
%>
</body>
</html>
I get data but they are not in the format that I can read. MyQSL tables
created inside the Election database is unreadable.
Database changed
mysql> show tables;
+--------------------+
| Tables_in_Election |
+--------------------+
| ANX___7LgTGRXo_ |
| ANX___8GECxAtQ_ |
| ANX___8GIvT7Rc_ |
| ANX___8GMmoCp8_ |
+--------------------+
4 rows in set (0.00 sec)
I found out this is because they are using rest API, But I cant find a
complete documentation to do what i want.
I did this,
<html>
<body>
<h2>Below is a Jaggery print</h2>
<%
var url = " https://localhost:9446/api/configs/das/tables";
var twitterJson = get(url);
print(twitterJson);
%>
</body>
</html>
But it does not work! it gives Error 500
Can anyone give any suggestions!
Thanks!
Cheers!
Dinali Rosemin
University of Peradeniya (Computer Engineering)
WSO2 Intern
077-0198933
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev