Questions tagged as 'java'

1
answer

Check if the field is null in java and mysql

How do I check if a database field is populated or is null? Do you have a ResultSet method that does this? In case it is a date field. PreparedStatement ps = connection.prepareStatement("SELECT * FROM tarefas"); ResultSet result = p...
asked by 22.09.2017 / 00:40
2
answers

I'm having trouble trying to list data from a mysql table

Manufacturing Class import java.sql.Connection; import java.sql.DriverManager; public class Fabrica { public Connection getConexao() { Connection conn = null; try { Class.forName("com.mysql.jdbc.Driver");...
asked by 19.09.2017 / 22:45
1
answer

Error RecyclerView: No layout manager attached

I could not find the error. My activity: private AdapterPacientes adapterPacientes; private static MVP.Presenter presenter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setConte...
asked by 09.02.2017 / 05:00
2
answers

Encryption with Java

I need to do data encryption in a user authentication session, and I would like to know the best, and safest way to work with Java encryption. If it's using Salt, MD5, AES, SHA, or other? What API's recommended for this job? What are the advanta...
asked by 17.07.2014 / 15:23
3
answers

Access data from classes already instantiated

I need to access data contained in class variables already instantiated from other classes User_Info info = new User_Info() I think I would need the address of the memory that is the "info" right? public class User_Info { private int...
asked by 09.07.2014 / 19:32
2
answers

JPanel width exceeding the dimension defined in getPreferredSize ()

I'm trying to create a breakout game, I've already done a lot of logic, but I've discovered an annoying problem regarding the size of the "scene" panel of the game. Here is my class Board , which is the panel where all the components of...
asked by 11.05.2017 / 16:33
1
answer

Lambda expressions in nested classes with multiple methods

I was reading about lambdas and out of curiosity, I wanted to know why it is not allowed to use when the class / interface has more than one method, which forces us to do things like below: component.addMouseListener(new MouseListener() {...
asked by 12.07.2017 / 15:13
2
answers

Are Java lambdas equivalent to JavaScript Closures?

I started to study functional programming and I'm a bit confused about these two items. My question is: Is Java lambdas equivalent to JavaScript Closures? If not, what is the difference between them? Thank you.     
asked by 25.05.2017 / 18:22
2
answers

Verify that the attributes of an object are null in a less manual way

How to fix this: Objeto obj = new Objeto(); if(obj != null){ //executa o codigo } The question is: did I instantiate the object, beauty? But I did not set any value for it so all its attributes are empty. If I make a comparison to see...
asked by 10.03.2016 / 04:55
2
answers

Socket- does not receive the message completely

I have these codes: I'm still testing ... Client system: private void btComunicarActionPerformed(java.awt.event.ActionEvent evt) { List<PessoaMOD> pessoas = new ArrayList<PessoaMO...
asked by 25.02.2016 / 19:57