Questions tagged as 'java'

2
answers

Make JPA name the tables in capital letters

I am using JPA with spring boot, hibernate and sql server, it works fine, but I would like the names of the tables and their fields in the database to write them in lowercase, how can I make it uppercase? This is how I have my properties:...
asked by 23.08.2018 / 19:29
1
answer

How can I eliminate the line breaks generated by a String?

This would be the code that gives me the line break. miString = miString.replaceFirst("texto a reemplazar", ""); miString = misString.trim(); What happens to me is that when I save it in the .txt it generates that annoying line break. I nee...
asked by 28.08.2018 / 23:49
2
answers

Java iterator accumulates

I want to make a program that adds elements type int to a list and with the help of an iterator add the elements that meet certain characteristics. The problem is that when I give several conditions, the results accumulate. Example: I add 1 2 3...
asked by 21.03.2018 / 18:26
1
answer

Pass data from a matrix to a vector

I have a problem, I have a matrix 5x5 with random numbers from 0 to 1000, I must take the odd numbers from the matrix, add them to a vector and return that vector. This is the method that should return the vector with the odd numbers...
asked by 05.02.2018 / 05:47
1
answer

Error 405 HTTP method POST is not supported by this URL

I'm doing a web application (JSP) with eclipse with the google app engine plugin and it throws me an error when I press the send button:    "Error 405 HTTP method POST is not supported by this URL" I've tried with "get" and if it works, b...
asked by 02.02.2018 / 19:34
1
answer

How to align the elements of a matrix when printing it?

My question is how I could align the elements of an array so that they are aligned to the right. This is the code I had done so far: for (int i=0; i < matrix.length; i++) { System.out.print("|"); for (int j=0;...
asked by 16.12.2017 / 22:55
1
answer

What is the difference between a failfast iterator and failsafe in JAVA?

My question is more conceptual, I have been looking for answers on this question but I am not understanding them. What is the difference and what do they mean in each case? Can you give examples? Thanks.     
asked by 03.12.2017 / 16:36
3
answers

HashMap Get if the key exists from possible candidates in Java

I have the following variable to save properties with its clave:valor Map<String, String> properties = new LinkedHashMap<>(); properties.put("lat","48.756189"); properties.put("longitude","94.218750"); properties.put("name"...
asked by 30.11.2017 / 19:19
3
answers

How to stop scheduleTaskExecutor process?

Good afternoon! I'm working with Executors, I have a button that when pressing it makes a toast every 5 seconds, my question is if there is a way to kill that process by pressing the button again. I read that with future.cancel() but I...
asked by 05.12.2017 / 18:11
3
answers

Access to arraylist fields individually

I have a class called Product () which has the following form: public class Producto { private String nombre; private float precio; private float iva; private int unidades; public Producto(String n, float p, float i, int u){ this.nombre...
asked by 12.12.2017 / 20:00