Month: August 2014

Code Examples of Processing json Data with esProc


esProc

esProc can process json data. Here we’ll introduce some of the applications through examples. 1. Analyzing and generating json data with esProc; 2. Data-interchange between esProc and application program through json; 3.Reading jsonfile data inesProc.

A. Analyzing and generating json data with esProc

Generally speaking, json is a format used by webpage js program and Java’s server-side program (such as servlet) to interchange data. While data access between Java’s server-side program and the databases adopts SQL result set format. esProc can act as an intermediary in the data computation and data-interchange between the two formats.

In this example, we use esProc to query detailed information of a group of designated employees. Both data input and output will adopt json format. Table employee of database demo contains all information of the employees:esProc_json_1

 

esProc receives an EID list of json format and returns corresponding detailed information of employees…

View original post 534 more words

Advertisements

Working with JSON Data from SQL


Informix on my mind

The MongoDB support was introduced in 12.10xC2, bringing many cool things to Informix, one of them being JSON and BSON data types. Putting all the NoSQL and MongoDB story aside, these new data types enable us to work with semi-structured data directly from SQL, thanks to several new built-in functions. Of course, you could do the same with XML documents, but it took a while before all the necessary functions became available in Informix, and working with XML is still more complex than working with JSON, because of the difference of those two data formats.

In order to put the data in a JSON column you can use genBSON function, or simply cast a text to a JSON type. Here’s an example – a tourist office database table storing various places people could visit. One table with JSON data could be used to store data of many different places –…

View original post 613 more words

How to get the Drupal 7 posts from mysql


It’s snippet time!

I needed to quickly extract all the articles on a Drupal site.
Every article has its own taxonomy term on a custom dictionary (myDictionary) so I needed to extract which term every article is set up.
Here we go:

SELECT
    FROM_UNIXTIME(N.created) as created
    , NT.name as t_name
    , TTD.name as keyword
    , N.title
    , B.body_value as body
  FROM
    node N
    INNER JOIN node_type NT ON N.type = NT.type
    INNER JOIN taxonomy_index TI ON TI.nid = N.nid
    INNER JOIN taxonomy_term_data TTD ON TI.tid = TTD.tid
    INNER JOIN taxonomy_vocabulary TV ON TV.vid = TTD.vid
    INNER JOIN field_data_body B ON B.entity_id = N.nid AND B.entity_type = 'node'
WHERE TV.name = 'myDictionary'
ORDER BY N.created

Drupal 7 ER schema

View original post

Purging Mysql-Binary Logs


Rohit Tiwari Blog

Updating you one of my client issue which i have just resolved ..
Scenario -> My client is having a very critical mysql server .. i m calling it critical because there two mission critical application which were using mysql  as a database backend and for data protection they have set up mysql slave and one of application is using slave as a database backend.
Issue -> Master server Got Down 😦  Due to disk space issue and Mysql Replication Logs were taking two much of space. i knew these logs are important “because whole replication depends on these logs”.
so i have to remove them carefully and i did that using purge statement in mysql and every thing is fine. without taking any mysql down, the issue got resolved 🙂
Note :- we can use rm command on OS shell for deleting the logs but that never advisable and recommended. logs should be deleted from mysql shell.
So…

View original post 539 more words

A simple example of how to set up a PHP-MySQL application in IBM Bluemix (including the code you need)


Smart People I Know

While PHP is not one of the standard runtimes provided in the Bluemix catalog, the sample code in this git repo (
https://hub.jazz.net/git/u27275/blm-hello-world-php/) will show you how to bring your own buildpack, and this buildpack will allow you to have PHP code running in Bluemix that also can talk to a MySQL database running in Bluemix.

Among the files there is a PDF providing detailed instructions on how to set things up in IBM Bluemix.

P.S. This is sample code.  See the licence file in the repo for more details.

View original post

REST fundamentals


skrasool

REST stands for REpresentational State Transfer, is an architectural style. HTTP is a protocol which contains the set of REST architectural constraints.

REST fundamentals

  • Everything in REST is considered as a resource.
  • Every resource is identified by an URI.
  • Uses uniform interfaces. Resources are handled using POST, GET, PUT, DELETE operations which are similar to Create, Read, update and Delete(CRUD) operations.
  • Be stateless. Every request is an independent request. Each request from client to server must contain all the information necessary to understand the request.
  • Communications are done via representations. E.g. XML, JSON

The PUT, GET, POST and DELETE methods are typical used in REST based architectures.

The following table gives an explanation of these operations.

  • GET defines a reading access of the resource without side-effects. The resource is never changed via a GET request, e.g., the request has no side effects (idempotent).
  • PUT creates a new resource…

View original post 32 more words

Oracle announces Java 9 features


java and javascript

JavaOracle has announced a series a JEP’s (Java Enhancement Proposal) for Java 9 release that is slated to release in 2016. Previous release of JDK 9 were restricted to bug fixes and small enhancements only.

The features include:

1) Process API updates:- aims at improving the API for controlling and managing OS processes. Java SE provides limited support for native operating-system processes. It provides a basic API to setup the environment and start a process, destroy a process. Current needs include ability to get the PID of processes created with API, ability to get/set the process name of processes created with API, enumerating processes etc.

2) Light weight JSON API:- provides API for generating & consuming JSON documents, streams. It is expected that this will be delivered as a set of new sub-packages in the java.util hierarchy and will consist of at least four modules; events, streams, trees, generators.

3)

View original post 202 more words