Questions tagged as 'java'

1
answer

Return results of a query

How do I return a value from a "SELECT" method ?? I have this code: public void SELECT(String Colunas,String Tabela,String Condicao) { String QUERY=null; if(Colunas!=null && Condicao!=null) QUERY=" SELEC...
asked by 10.04.2016 / 17:46
1
answer

Problems getting ResultSet value

I'm trying to get the values from a select in the derby but they only correctly return a field from the ResulteSet. Here is the code for the DB access class: import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet;...
asked by 09.06.2016 / 15:17
1
answer

Hibernate - Dynamic Instantiation using factory

I know that using Hibernate Dynamic Instantiation I can instantiate an object according to a constructor. The Problem: I need to optimize the system as much as I can, and I'm done creating 5+ constructors in the same class. I want to know...
asked by 28.03.2016 / 16:12
1
answer

Rendering problem

On my registration screen I have 2 buttons: Save and Back . If I'm editing a record, the New button is enabled. My problem is when I click this New button the screen gives the refresh but what I want is to clear the data for a new one. A...
asked by 09.06.2016 / 03:13
2
answers

I can not assign value to an ArrayList of an Object

My intention is to register the data typed in the window in the object's arraylist, but I can not! Client class (model): Normal class, with name and address getters and setters. Main class: package br.projeto.view; import java.ut...
asked by 28.03.2016 / 00:28
3
answers

Compare an integer entered with each enum value

Hello. I want to check if the option that the user entered matches an option in the menu. I am using enum to show the options and the user types a corresponding number. But I can not. Let's look at the menu enum and the class I'm testing. p...
asked by 19.05.2016 / 18:38
1
answer

Using CDI in the app

I have a problem, on my login screen I can inject the em into a good one, when I go to the second screen that would be dash, I can not inject, p> Follow the link: /* * To change this license header, choose License Headers in Project Pro...
asked by 18.05.2016 / 21:16
1
answer

Creating columns in tables through variables in java

Hello, I would like the help to solve the following problem: I have a table, but its columns can be defined by user-defined variables. For example, the user sets a1, b1 and c1, from there the program creates a table that must contain a column fo...
asked by 07.07.2016 / 16:47
1
answer

DrawerLayout - control visibility

When the app is run the first drawer presented is correct ie; comes with only one visible option item. This option when selected activates an activity that is normally executed but at the end of its execution the other options are not visible....
asked by 08.07.2016 / 16:17
1
answer

Java Android - Save Events

How do I save events in an Android java app? For example, a program has a checkbox, I open it in the box and exit, when it returns it will be unchecked. How do I make the information that it is checked thanks?     
asked by 09.07.2016 / 15:05