Questions tagged as 'java'

1
answer

Use a connection for several methods in the same class and in others

Would you like to have only one connection and use it in multiple methods? For example: The prepared statement needs an open connection to run, so I do getConnection() , and another method also needs, so I have to do another getConnec...
asked by 17.12.2017 / 08:43
1
answer

Copy only superclass content in java

Is there a way to copy only the contents of the superclass into another class of the same type through a subclass instance in Java, without accessing getters and setters one by one? Example: public class A { private Integer id; priv...
asked by 20.06.2018 / 14:40
1
answer

Recursion in Java Queue

My teacher says that it is a bad programming practice, passing the variable that interests us as a parameter of a recursive method, eg: int getMaior(Celula i, int maiorV) It says that it is better to do the following method: publi...
asked by 19.06.2018 / 15:01
1
answer

Request Post API Messenger with Spring Boot

I need to create a post method that returns this information to the Messenger API with Spring Boot, if anyone can give a light thanks. The example below is found in the Facebook Developers documentation curl -X POST -H "Content-Type: applic...
asked by 20.06.2018 / 07:08
1
answer

HttpURLConnection Android + Msyql

The code works perfectly but I need it without using AsyncTask because I call my code several times each time it finishes executing (onPostExecute) I call different methods or functions ... I need something more generic ... Can someone help me...
asked by 12.12.2017 / 12:39
1
answer

Test with junit

I developed a simple banking system, now I want to know how I can use Junit only in the withdraw and deposit methods. package CaixaEletronico; import java.util.Random; import java.util.Scanner; public class Caixa { public static voi...
asked by 14.12.2017 / 02:46
2
answers

error c3p0 - bad pool size config start 3 min 5. using 5 as start

Hello everyone! can someone help me how to solve this error below? I tried a lot and nothing. Error: 12-Dec-2017 20:27:27.908 INFO [http-nio-8084-exec-6] org.springframework.web.servlet.FrameworkServlet.initServletBean FrameworkServlet 'dis...
asked by 13.12.2017 / 00:38
1
answer

Firebase Insertion Problems

I'm developing a native application on Android that uses maps, insertion is usually happening through the code below. Location is a variable of type LatLng . mDataBase.child("location").child("Roubo").child(String.valueOf( new Date()....
asked by 18.11.2017 / 14:32
1
answer

Android pick up data from the ImageButton to send in a post

I have a Fragment view with a form, in this form I have an imagebutton in which I upload images from the Android gallery when I save this form I need to get this image and post it to Base64. public class EditarPerfilActivity extends Fragment {...
asked by 14.11.2017 / 23:55
1
answer

How to create a folder browser in java swing?

I want to create a window and it has a button, when the user clicks that button, that "windows folder browser" will appear for the user to select a folder of his machine and the address of the folder is saved in a variable. It is possible? I do...
asked by 18.11.2017 / 00:56