Questions tagged as 'java'

1
answer

Do not let date include 50 years back in the database

I have a JSF and PrimeFaces 4.0 system and I have a <p: calendar> field in which I made the treatment not to load dates in the current day's calendar up to -50 years old. But even so, the user can type it through the keyboard and...
asked by 25.10.2018 / 16:01
2
answers

How do I select in specific columns and continue to get a list of the entity and not an array of Object?

Having the following class: public class Usuario { private Integer id; private Email email; private String nome; private String sobrenome; private String senha; private String usuario;...
asked by 30.01.2018 / 10:10
1
answer

Error javax.naming.NoInitialContextException - console application

I'm trying to make a simple EJB, I followed some tutorials, I looked at the Wildfly sample code, and even then, I'm facing a mistake. Could anyone help me? The error: ejb:/Adder//Addition!com.labs.AdditionRemote javax.naming.NoInitialCon...
asked by 02.02.2018 / 21:51
1
answer

Error deleting data in Mysql by Java

In the database I have three tables, where one of them holds the foreign keys. Error Displayed: Error: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Can not delete or update parent row: a foreign key constraint fail...
asked by 13.05.2018 / 21:32
1
answer

I want to know how to pass an object to the activity using the following code

public class PessoasDAO extends DataBase { public PessoasDAO(Context context) { super(context); public Pessoas findByPass(String senhaLogin) { String sql = "SELECT * FROM pessoas WHERE SENHA_PESS = ?"; String[] argumentos = new Str...
asked by 17.04.2018 / 20:03
1
answer

AlarmManager is not repeating

I have an alarm that is triggered every 5 minutes, and it calls an intentService to test a condition that if true, sends notification to the user, otherwise it does nothing. But the intentService is only being called once, and only if I open...
asked by 05.03.2018 / 18:35
2
answers

Problem Handling LocalDate Dates

I'm making an application for work calculations. I need to receive two dates and know the amount of days / months / years. Ex: 08/03/2017 to 07/03/2018 is for 12 months accurate, in my code of 11 months and 27 days someone knows how to fix it....
asked by 07.03.2018 / 23:40
1
answer

AlarmManager does not run on configured

In a method that registers a AlarmManager to run every 30 seconds the BroadcastReceiver : public void play(View view) { Log.i("lgg", "Botão: broadPlay"); Calendar calendar = Calendar.getInstance(); calend...
asked by 09.03.2018 / 19:51
1
answer

Doubts about the Graphics and Graphics2D classes in Java

I'm having a lot of questions about Java graphical libraries, which are as follows: What is the difference between overwriting the paint(Graphics) method or the paintComponent(Graphics) method? What is the Graphics2D...
asked by 12.03.2018 / 02:15
1
answer

How to pass a class with BigDecimal and Date attribute via intents (Bundle)?

I have a ArrayList<MinhaClasse> with a BigDecimal attribute and I'm going through an intent from one activity to another. The problem is that the BigDecimal attribute passes with null value. Can not pass a BigDecimal attribute? I...
asked by 11.03.2018 / 00:06