how to query database from servlet

Uncategorized
Question: I'm new to jsp and servlets, I've only been dealing with them for 2 weeks, so forgive me if this is stupid or essentially a easy fix. I've looked at previous asked questions on here and none have helped. If my question has been answered already on here please share the link to that post. Otherwise any insight on this matter would be appreciated. I took data from a form to create a object. In my servlet I created a new instance of said object and use setters to set the objects values. I created a Instance of a class that handles querying my database in my servlet. I placed my object into a method that adds data to my database. data wasn't added. this method works fine outside…
Read More

How Jelastic “internal” load balancer check nodes health?

Uncategorized
Question: As far as I understand, Jelastic utilizes some kind of load balancer which is deployed behind the nodes. So if I have two nodes and one node is down, how this load balancer will act? I'm thinking about blue-green deployment without traffic distributor add-on. Answer: If you have multiple web application nodes (e.g. Apache servers) you should also add your own load balancer node (in which case you have control over the health check parameters in Nginx or Apache configs). It's also highly recommended to use public IPs for production use. Only use the Jelastic shared resolvers / load balancers for proxying requests to your environment during dev/test (they're shared infrastructure, so can be a bottleneck for your application as well as introducing other bugs / unwanted behaviours re.…
Read More

How to call this method in swift 3.0?

Uncategorized
Question: Here I have an Objective - C Method:+(void)postSaveCoinOrder:(OrderSaveCoinOrderRequestModel *)model returnInfo:(void(^)(OrderSaveCoinOrderResponseModel* resModel))retMode; and I want call it in Swift file. tried many times but don't work. Can someone help me? Answer: Try this... let request = OrderSaveCoinOrderRequestModel.init() CLASS_NAME.postSaveCoinOrder(request) { (response) in } CLASS_NAME is the name of the class where postSaveCoinOrder is defined. Read more
Read More

Parsing my data to search the csv array

Uncategorized
Question: I know the answer might be easy but struggling to get this to work. I have the below code } $csv = array(); // Open File with error handler if (($file = fopen('./csv/file.csv', 'r')) === false) { throw new Exception('There was an error loading the CSV file.'); } else { while (($line = fgetcsv($file, 1000)) !== false) { $csv[] = $line;} fclose($file);} if (isset($_GET['names'])) { $name = $_GET['names']; $results = array(); foreach($csv as $curr) { $Data = explode(',',$curr['1']); if(in_array($names,$Data) $results[] = $curr; } } else { ...... Blah blah blah ?> So what im trying to do is parse the data from the url with get and search the csv array to find matching string in each key and array[1] (its a 2 column csv file), if the name…
Read More

Commands not working after editing bashrc file in ubuntu

Uncategorized
Question: I had added export statements for Hcatalog in my .bashrc file which eventually messed up my .basrc file. Now even if I open bashrc file in my cmd and remove those two export statements, still I am not able to run any of the commands. My current bashrc file:> # ~/.bashrc: executed by bash(1) for non-login shells. > # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) > # for examples > > # If not running interactively, don't do anything > [ -z "$PS1" ] && return > > # don't put duplicate lines or lines starting with space in the history. > # See bash(1) for more options > HISTCONTROL=ignoreboth > > # append to the history file, don't overwrite it shopt -s histappend > > # for setting…
Read More