Analytics-Plus Help

ManageEngine Reports Metadata

Currently you can obtain the ManageEngine Report's metadata using the JDBC Driver. Follow the below links to get started.

Sample:

The following code snippet shows the list of databases created by the demouser in ManageEngine Reports.

import java.util.*;
import java.sql.*;
import java.net.URLEncoder;
import java.io.*;
publicclass Zoho_GetCatalogs
{
privatestaticfinal String APIKEY= "bfc2f00820f07f1be4fe97594c590b42";//<your key>
privatestaticfinal String USER = "demouser";//<your user name>
privatestaticfinal String PASSWORD = "demouser";//<your password
privatestaticfinal String DB_NAME= "DEMODB";//<your db name>
privatestaticfinal String TABLE_NAME="demotable";//<your table name>
publicstatic void main(String args[]) throws Exception
{
Connection conn = null;
Statement stmt = null;
ResultSet catalogs = null;
try
{
Class.forName("com.zoho.cloudsql.jdbc.ZohoReportsDriver");
Properties conProps = newProperties();
conProps.put("ZOHO_API_KEY",APIKEY);
conProps.put("user",USER);
conProps.put("password",PASSWORD);
conn = DriverManager.getConnection("https://reports.zoho.com/api"
+ "/" + URLEncoder.encode(USER,"UTF-8")
+ "/" + URLEncoder.encode(DB_NAME,"UTF-8"),
conProps);
DatabaseMetaData dmd = conn.getMetaData();
catalogs = dmd.getCatalogs();
if(catalogs != null)
{
while(catalogs.next())
{
System.out.println(catalogs.getObject("TABLE_CAT"));
}
}
}
catch(Exception e)
{
e.printStackTrace();
}
finally
{
if (catalogs != null){try { catalogs.close(); } catch (Exception e){ e.printStackTrace();}}
if (stmt != null){try { stmt.close(); } catch (Exception e){ e.printStackTrace();}}
if (conn != null){try { conn.close(); } catch (Exception e){ e.printStackTrace();}}
}
}
}

 

Share this post : FacebookTwitter

Still can't find what you're looking for?

Write to us: support@zohodeveloper.com