Questions tagged as 'java'

4
answers

What is the correct way to close connections and statements?

I am developing my first application as a univ project. using MySQL with JAVA, I am realizing that there are methods and routines that do not close the connections and the statements although I give them their respective orders to do it, somethi...
asked by 29.07.2016 / 21:06
1
answer

Problems with .write ... the output is not what was expected

I'm doing a program in which I take the same value of a point in 8 different txt and I want the output to be a txt in which 1,048,576 rows x 8 columns appear, but when it comes to getting the output I the numbers come together with more than 8 c...
asked by 14.07.2016 / 10:42
2
answers

Text for grid without data - Genexus Ev2 U7

In a webpanel, where I have a couple of grids that show me data, I need that, when one of the grids does not show data, I see a text (something like "no data to show") instead of leaving the header of that grid. Ex: That something like this a...
asked by 12.07.2016 / 16:51
2
answers

Split and Join from a text to words respecting the blanks in Java

What is the best way to separate words from a text that can contain multiple concatenated blanks, tabs, and line breaks? Process the array of words and then attach them, respecting the same spaces they would have. Dummy text: Lorem ipsum...
asked by 26.06.2016 / 21:11
3
answers

How to remove elements from an array of objects in java

The problem I'm having is the following: I'm modeling a basketball team with some functions like agaregarTitular() and agregarSuplente() . Now I want to implement the cambiarSuplenteComoTitular() method, for that I defined...
asked by 12.12.2018 / 16:51
2
answers

hasMoreElements () in StringTokenizer returns true only

Good morning. I have the following code in java, I am developing an Android application. The code is: bajaRepostajeSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSel...
asked by 24.05.2017 / 11:05
1
answer

Error deleting a SQLite Database

Good I have a java program that creates a sqlite database when I finish the program I want the database to be deleted so that there is no record of it on the computer. I have the following code: public void borrarSQLite() { try {...
asked by 09.11.2018 / 17:27
2
answers

instantiate objects

There is some way to instantiate an object n number of times, that is, the instance is Objeto nombre_var = new Objeto(); that is, if you want to instantiate an undetermined number of objects within a for cycle for(i=0;i<5;i++){ Objeto...
asked by 14.11.2018 / 15:08
2
answers

Because I get Nullpointerexception when I save an attribute of a node

I am trying to show an XML file on the screen through the DOM, but after converting the aforementioned file, when I want to save the data of each node in a array I get the error: Exception in thread "main" java.lang.NullPointerExcep...
asked by 23.11.2018 / 14:42
2
answers

Delete a row of a two-dimensional Array in JAVA

I have the following Bidimensional arrangement called info : Laura,9,8,10,10,10,10,20 Pedro,10,50,10,35,10,10,90 Luis,10,60,10,70,10,41,17 Mario,10,10,10,43,10,10,23 Blanca,10,89,41,10,10,85,17 What would be the code to be a...
asked by 22.11.2018 / 09:26