Skip to content

Tag: java

Separate List in Java

I need help on separating List. I am really new to this I have a code that results to this [[a, b, c, d, e], f] setOfLetters() is from a query My question is how can I make my result like this? [a, b, c, d, e, f] Is it by using for loop? Or anything you can suggest. Thanks

How to select by DATE type in jdbc using oracle DB?

In my Database created_date colum of data type is DATE and I want to select by DATE type in jdbc using ORACLE database, but when I run this method like this , I have getting this error. How to solve this problem? I have tried many things, but coludn’t solved. Answer The main problem here is that you are…

Read values from Java Map using Spark Column using java

I have tried below code to get Map values via spark column in java but getting null value expecting exact value from Map as per key search. and Spark Dataset contains one column and name is KEY and dataset name dataset1 values in dataset : Java Code – Current Output is: Expected Output : please me get t…

ClassCastException when declaring class generic as string

I have a GenericList class that must initialise an array with type but it force me to declare it as Object in compile time. When I declare the generic as String in Main, the program stops with ClassCastException when i assign the list.items to a variable called items, which compile time also recognise it as S…

Java 8 stream string manipulation and comparison [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 1 year ago. Improve this question In Java 8, can I use streams to manipulate, filter and compare string? I know how to do in ja…

count non-null numbers of an object

I am making a method that can count non null value of an object, but I have an object inside another object and I have to confirm if that object is empty too, I tried with isEmpty, isNull but it says it is not empty. Object Validation method I have also tried with !ObjectUtils.isNull… Even though the &#…

ActiveMQ batch consumer

I have a requirement to consume the messages from the ActiveMQ topic and persist them in mongo. I am wondering if there is a way/configuration for consuming the messages in batch from the topic instead of reading messages one by one and making a DB call for every message. I am imagining the end solution will …