Hi Dinali,

Please find the documentation [1] for interacting with the data which is
stored in DAL via REST api. For each scenarios you can see a sample
request, and according to that you need to send the authentication headers
with your request. You can first try with curl or any other REST API tools,
and then try to incorporate with jaggery app.

[1]
https://docs.wso2.com/display/DAS300/Checking+if+a+Given+Table+Exists+via+REST+API

Thanks,
Sinthuja.

On Sat, Nov 21, 2015 at 7:10 AM, Dinali Dabarera <din...@wso2.com> wrote:

> 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
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
*Sinthuja Rajendran*
Associate Technical Lead
WSO2, Inc.:http://wso2.com

Blog: http://sinthu-rajan.blogspot.com/
Mobile: +94774273955
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to