Questions tagged as 'java'

2
answers

Paste sql Hibernate

Good morning. I have the following problem, I need to get the sql executed by hibernate and save it to a string. But I have no idea how to do this, could anyone help?     
asked by 29.08.2016 / 17:45
1
answer

Split (), using | (pipe) as a separator, does not separate the text correctly

I'm developing an app for android and I've now done the part of HttpURLConnection , put everything right, pointed to the url and did a test with% my string with all data coming from my hosted php file. private class MyAsyncTask extends Asy...
asked by 28.05.2016 / 21:34
1
answer

How to use a counter within a HashMap?

Is it possible to do this? public static void main(String[] args) { Scanner in = new Scanner (System.in); Map <String,Integer> mapa = new HashMap <String,Integer>(); mapa.put("45 - Jose" , ? ); //A "Key" deve ser o...
asked by 16.05.2016 / 04:36
1
answer

Is it necessary to repeat the dependencies (JAR)?

I have a "project A" that uses a .JAR library, which is inside the dependencies. I've exported this project to .JAR for use in "Project B". This project B must also use the same library. Do I need to use both or just one of them?     
asked by 11.01.2016 / 12:15
3
answers

Increase Accuracy with BigDecimal Java

Tickets R = new BigDecimal(2.79E+00); Dxm3d = new BigDecimal(3.99E-04); Wmd = new BigDecimal(2.39E-03); x = new BigDecimal(3.2); t = new BigDecimal(365); Follow the formula below BigDecimal segundoTermo = (R.multiply(x).subtract(Wmd.m...
asked by 22.12.2015 / 19:43
1
answer

BigDecimal result comparison with Float (Java)

I have two formulas implemented, one with the BigDecimal type and the other with the double primitive type, but the results diverge and I can not find the solution. Here are the formulas: BigDecimal x = new BigDecimal(3.2d); //TODO: entradas...
asked by 22.12.2015 / 17:48
2
answers

Add the 5 largest values to an array

I have the following method: public static void topFiveSales(int idEmpresa) { List < Entidade > allList = Entidade.findByEmpresa(idEmpresa); float totalVendasByEntidade; Float[] totais = new Float[5]; for (Entidade ent:...
asked by 30.07.2015 / 16:55
1
answer

How to Create Cover in a Report Using iReport

I'm using iReport 5.5.2 and I've tried in many ways to add a cover to the report, which is necessary, but to no avail. I've already tried adding the isTitleNewPage attribute in the Title band of iReport, but that did not work and I looked for so...
asked by 13.05.2014 / 19:02
1
answer

Thread Safe and your connection to Collections

What is thread safe, and what is your connection to data collections?     
asked by 05.06.2014 / 22:36
2
answers

How to identify if an XML is BOM?

I have the following problem regarding XML encoding: Erro: Byte inválido 2 da sequência UTF-8 do byte 3. This error occurs when trying to canonize an XML. I do not know exactly what the error might be, I guess it's because the String has...
asked by 04.02.2014 / 11:58