Questions tagged as 'java'

1
answer

Leakage of connections with Hibernate

My system had sporadic crashes and I discovered that this happened due to processes that opened a connection but, due to some error, they did not close it (connection leak). I solved involving the problematic code in try/catch and forc...
asked by 05.02.2015 / 16:31
1
answer

How to pass the contents of a composite object to a DynamicReports column. being that the DataSource is a list of this object

I'm making a report using DynamicReports For this I am passing a list to be used as DataSource List<VisaoViagemQuadroMensal> linhas = new ArrayList<VisaoViagemQuadroMensal>(); where: public class VisaoViagemQuadroMensal {...
asked by 15.01.2015 / 21:38
1
answer

Manipulate onPostExecute from another Activity

I have both classes below: DataLoad.java public class DataLoad extends Activity { SQLiteDatabase mDatabase; Session session; public static String jsonString = ""; @Override protected void onCreate(Bundle savedInstanceS...
asked by 15.01.2015 / 18:24
1
answer

Convert .raw file to .mp3 file or other audio format

I have an application that does audio recordings and stores it on a server. I need these files to be converted from the .raw extension to any audio format, preferably to the .mp3 extension, so that it can be downloaded to the client computer....
asked by 20.01.2015 / 15:22
2
answers

Extend findAll with custom filters

I'm trying to extend findAll from my JPA repository to make custom filters. I did some research and found some ideas of use with Predicates and related but did not identify something that worked in a practical way. I would like to know if...
asked by 26.05.2015 / 16:16
1
answer

How to return the value according to the received parameter?

I needed to do mocking with DAO, but the method receives a worksheet object and according to the id attribute of the Worksheet needs to return a different value. How do I compare the worksheet ID correctly? I want to test the readMeta...
asked by 26.05.2015 / 20:42
1
answer

Analysis of complexity

I have a question about the complexity analysis of this code in Java: public static int cont; public static int recursive(int base,int numb,ArrayList<Integer> lista){ if(lista.size()>base) return 0; if(numb<0 || numb>ba...
asked by 19.04.2015 / 05:12
1
answer

Catch the attributes of a Thread object?

Is it possible to get the attributes of a Thread object? because I am using threads to read several files (one per thread) (which has float numbers separated by \ n) storing the floats do the sum of floats and doing the average of values, but it...
asked by 20.04.2015 / 18:17
1
answer

NamedQuery with Collection as Parameter

I'm using JPA NamedQuery to create a DTO. And in my Query I have as condition an IN and as parameter IN has values with white spaces in the middle. (Ex: 9292-929). and these values with whitespace, returns nothing. Only values with no...
asked by 05.01.2015 / 17:50
1
answer

Java 8 - Collect elements from a list

Good morning. I would like to collect specific elements from a list. I could do the Java 7 style, but I'm curious how I would do it in the Java 8 style. For example: [1, 2, 3], [1, 2, 3], [4, 5, 6]] = An ArrayList of Object [] Collec...
asked by 02.01.2015 / 12:07