How to connect to MaprDB (Hbase) from Java program without mapr client - java

I know how to talk to MaprDB from Java program with Mapr client installed. But, want to know how can I connect to MaprDB without Mapr client installed? Is there a pure Java API (i.e. without needing to install any other software, just using some jars) for my requirement?
Please note - these are binary tables (and not JSON tables).

There is an approach that you can use.
The so-called DAG (data access gateway) is a gRPC-based gateway that you can use. There is a pure Java client for this. Performance impact is significant, but not massive and the API is the same OJAI API as when you access the database using the thick client.
See the following links for more information:
https://mapr.com/docs/61/MapROverview/MapRDataAccessGateway.html
https://mapr.com/docs/61/AdvancedInstallation/InstallingDataAccessGateway.html
https://mapr.com/docs/61/AdministratorGuide/AdminMapRDataAccessGateway.html
https://mapr.com/docs/61/EcosystemRN/MapR_Data_Access_Gateway_2.0_release_notes.html

Depends upon your definition of "without needing to install any other software".
You don't need to install the mapr-client package to access the MapR Cluster from a Java application - the MapR jars can be installed to your preferred location on the classpath or even shaded into an "uber" jar.
But you do need to be running on a supported client platform (Linux x86-64, MacOS x86-64, Windows i386 or x86-64), because the maprfs jar does contain JNI libraries packaged within it that it unpacks at initialisation time.

Related

Is it possible to coppy weblogic and it's domain from linux to windows using some tools?

I searched about cloning or copying weblogic and it's domain, and found 2 ways that I think is the most nearest to my question.
1, packing and unpacking a weblogic domain
2, Creating Extension Templates .
There is weblogic 12.2.4 installed on Linux server and I want to coppy it's configuration and domain and create my own instance with exact configuration.
If it's possible, pleas give me solution or some clues and key-word to search more.
And do I need to change some configs by hand or provided tool does everything?
Is copying domain different from copying weblogic configuration?
Thanks very much.
If you want to create a domain with the same configuration, but on Windows, you should use Weblogic Deploy Tooling.
The first step is to install Oracle Weblogic on your windows machine(s).
The second step is to use the discoverydomain.sh to introspect the domain, which is running on Linux.
The previous step will generate a model in YAML, which represents your Linux domain as code and then you will have to customize it with proper values for Weblogic's user's passwords, data sources, etc.
Once you have the model ready, you can run createdomain.cmd on Windows to create the domain. By the way, if your domain is distributed on several machines you will have to run pack and unpack after creating the domain with Weblogic Deploy Tooling because it only works on the node, which will host the AdminServer.
Here you have an example about using Weblogic Deploy Tooling with Ansible to create a domain with SOA https://github.com/textanalyticsman/ansible-soa-wldt
Yes, it is theoretically possible to copy $DOMAIN_HOME (WebLogic domain) to or from Windows.
However, I would NOT copy the $WL_HOME directory. Here a fresh installation is the only way.
As you mention the tool recommended by Oracle would be pack and unpack. With the assumption, that there is no WebLogic security realm configured.
Another option would be to create a new domain (preferable with the same name) with the Configuration Wizard and then copy the XML-fragments from the old $DOMAIN_HOME/config/* files in the fresh domain. Watch out for the encrypted passwords. Don't mix the encrypted fields in the old a new domain.
Another option would to use Windows Subsystem for Linux (WSL2). In this case, you can copy your files 1:1. $JAVA_HOME, $WL_HOME and $DOMAIN_HOME in one go. You WebLogic Server will start without any problems, except some DNS-Names or IP-Addresses issues.

How to create an exe file for a Java application which uses Mysql

I have developed a desktop application in java using netbeans and Mysql as my DB.
How can I create an .exe file including the database so that it that my application could be executed on other device?
Starting with MadProgrammer's quote:
AFAIK MySQL is database server, meaning it doesn't operate in
standalone mode. This would mean that you would need to install MySQL
on your target machine - which kind of seems counterintuitive. If you
want a standalone database, then maybe h2 would be a better
alternative, it's a pure Java SQL database system, which doesn't
require any additional installation
The simplest option is to use an internal DB, so that every resources will be bundled into a single application.
Otherwise - How can handle the external DB related issue (it being an application running alongside your java application)?
By creating a dedicated installation flow (running dedicated scripts which will install required 3rd party solutions prior to allowing your application to be executed):
Install the DB of your choice.
Optionally allow initial configurations to be aplied to the DB.
Install your own application.
Finalize the binding between the DB and your application.
Configure the OS to optionally run the installed DB on startup.
As for having an .exe executable for your java application - see the references I have provided. A 3rd party tool should easily create a .exe that will suite your needs.
A batch file which encapsulates the java -jar ... command can also work.
References:
Convert Java to EXE
How do I create an .exe for a Java Program?

MQ Client to use with Python that does not require installing

I am looking for an MQ Client to use with Python \ Jython.
Looking for a stand-alone program so that I dont have to install anything in the machine I am running as it may have to be run on multiple machines. So I guess Websphere is ruled out. Want something which is stand alone, may be a jar that can be imported through Jython but if something could work using Python compiler and additional library that would be great.
As well as the download of the redistributable client that JoshMc mentions, you might be interested in the fact that the MQ jars are also available through Maven https://developer.ibm.com/messaging/2018/01/09/developing-mq-java-applications-maven/
There are also open source ways to talk to MQ with Python. For a simple pub/sub API there is the MQ Light API that talks AMQP to MQ (client can be found here https://github.com/mqlight/python-mqlight).
There's also the PyMQI project (https://pythonhosted.org/pymqi/), this requires an MQ client on the system, so you'd use the same redistributable MQ client package to obtain that.

Webservice for TLS 1.2 testing

Our enterprise datawarehouse (EDW) sources data from many interanal & external sources. We use Oracle data integrator (ODI) as teh ETL tool to extract data from the sources. ETL jobs are executed using an ODI agent which is nothing but a Java process. One of the external sources for the warehouse is a webservice. Data is extracted from this webserice using Jython (wrapped within ODI). Jython as you might know is a Python variant which runs within JVM. The Jython job runs under the ODI agent (java) process and extracts data from the webservice.
Coming to the problem we are facing now- The external webservice provider has indicated that soon they will support only TLS 1.2 and will remove support for older TLS connections. The ODI agent is currently on JDK1.6 Update 33 and support TLS 1.1. We are planning to upgrade the ODI agent to Java 7 (which supports TLS 1.2) so that we will be able to connect to this webservice. The Java upgrade involves lot of work mainly to ensure that it does not break existing ETL jobs. If there are any impacts, we might not be able to upgrade. An alternate option is it create a separate Java process (outside of ODI) running under its own JDK (which can be even Java 8) to connect to this web service.
Are there any risks in the above options? It is going to take a while for the provider to give the webservice which supports only TLS 1.2. Are there any public webservices which support only TLS 1.2 that can be used by for our testing? Can you please share them?
Maybe not entirely what you're looking for, but it might be wise to have two seperate development projects for both the old and the future ODI agent to keep things transparent. Especially when testing the new version. It's also advisable to set up a dedicated testing/QA environment for this.
Be sure to keep your production ODI repository safe, you could use a testing repository with some exported projects for this. Maybe this link below might be useful: https://www.redbridgesoftware.com/products/life-cycle-management-for-odi.html

CloudBees Runtime Classpath

I just read the CloudBees whitepaper "CloudBees Advantages: A Guide for Java Developers". In it there is a sentence that reads:
The database is simply available as a JNDI resource as soon as it is deployed – there is no need to chase down JDBC drivers, connection strings and configure JNDI.
So I assume that means I don't need to include a MySQL JDBC driver in my WAR's WEB-INF/lib directory, as apparently CloudBees provides it to the classpath at run time, yes.
This also prompts a few other questions:
What version of the MySQL JDBC driver (and which type) is provided by CloudBees?
Does the same apply for the Cloudant CouchDB service, or drivers/dependencies used by other service partners?
Are there any other libs that CloudBees makes available to the runtime classpath for its clients?
Thanks in advance!
Cloudbees currently provided version 5.1.16 of the MySQL JDBC driver with the jboss stack, and 5.1.15 with tomcat6 and any other stacks. Unfortunately, this information isn't documented anywhere publicly. Caleb Tennis, one of their developers, informed me of this via their IRC channel, #cloudbees.
Regarding Cloudant, it's more or less just CouchDB, so to connect you can use these libraries from the CouchDB wiki.
Alternatively, CouchDB amounts to a REST API, so it might be easier to use a straight HTTP library to make requests and parse responses. Whatever you're most comfortable with, really :D
As for what other libraries Cloudbees makes available to the runtime path, more from Caleb Tennis:
Other than mysql, there are no "guaranteed" runtime libraries - you will need to put them into your war or other package for deployment.

Categories