first version of java connector (still needs to be synced with other connector, so all the connector follow similar approach)