Questions tagged as 'java'

1
answer

Error fetching the database

My application is integrated with my bank and it makes several queries, but in one of them is happening something unexpected, because the search is not done. Note that my statement line is simple and correct (it works when I run MySql manuall...
asked by 27.11.2016 / 21:56
1
answer

How do I know if the cpf field does not exist in the database?

Example of what I'm trying to do: vRS = sql.executeQuery(); while(vRS.next()) { nome = vRS.getString("nome"); cargo = vRS.getString("cargo"); } What I want to do is when the registry does not exist to di...
asked by 21.10.2016 / 18:17
2
answers

Scanner is not reading all the text it receives

I'm creating a program whose idea was to get a text with a few words and break them in "," . Only you're reading only part of the text. Follow the code and text below: public static void main(String[] args) { String colunas = "";...
asked by 10.10.2016 / 14:51
2
answers

When should I create a class? [closed]

I know it sounds like a pretty silly question, but I'm starting now in the programming world (focused on mobile). When I create an app it gets all the functions within the Activities, so I never know when I should take methods and attributes...
asked by 11.10.2016 / 23:25
1
answer

I can not fix this error java.lang.NullPointerException

I'm creating a simple app to show the images in a kind of gallery but I am not able to show the images in the view by the adapter. Always give this error NullPointerException Class Adapter: public class AdapterGaleriaFragment extends BaseAd...
asked by 12.10.2016 / 22:37
1
answer

Interpreting code with packaged classes

I have 3 classes in the com\scja\exam\planetas package. I also have a class with method main in pacote com\scja\exam\teste . The main method is responsible for printing the name of the planets. I've usually compiled...
asked by 28.02.2017 / 09:42
1
answer

Only prints the first element of the ArrayList

My problem right now is in printing the various elements that are inside an ArrayList that I created. The workings of my app are as follows: I use a Cursor, and I fetch the information from the table to the database. Then I pass in an Arra...
asked by 26.02.2017 / 04:12
2
answers

How to load the persistence.xml settings in ComboPooledDataSource?

I configured C3P0 via persistence.xml, however, when I try to retrieve the configuration values via ComboPooledDataSource, the received values differ from what was configured in the configuration file. <properties> <!...
asked by 28.02.2017 / 21:34
1
answer

Close ad when you click the close button

I would like to know how to close the adview of the layout if the user clicks the "X" of the ad. My ad code is below and I use it in the main activity_main layout: MobileAds.initialize(getApplicationContext(), getString(R.string.ID_AP...
asked by 10.11.2016 / 03:32
1
answer

Error: error: class, interface, or enum expected

Why my code is giving the error:    error: class, interface, or enum expected Follow the code: import java.util.Scanner; public class teste175 { public static void main (String[] args) { Scanner sc = new Scann...
asked by 09.11.2016 / 00:01