Questions tagged as 'java'

1
answer

BufferedReader always returns null

Although some questions already exist with the similar subject, I did not get an exact answer, so I turn to Stack again. I'm developing a client-server system, I already had the most advanced project, and I decided to start from the beginni...
asked by 08.12.2017 / 00:38
1
answer

RestController Spring, how to limit the number of requests! [closed]

Dear friends, I have an API Rest with RestController of Spring, it receives hundreds of concurrent posts, and with each post, I need to query and store data in the database. The problem is that this is generating an absurd processing on...
asked by 08.12.2017 / 06:04
1
answer

Save text with line breaks in the DB

See below a java code to save a SQL command return in PostgreSQL. The command is EXPLAIN ANALYZE. The problem is that by saving this to the database, it loses the line breaks. Someone would know how to help me solve this, that is, so that when d...
asked by 16.01.2018 / 03:50
1
answer

Mockar non-static method of a class containing a call from another static method

Hello, The title was a bit confusing, but come on. I have the class below: public class ClasseA { public static final int constA = ClasseB.metodoB(); public int metodoA(){ System.out.println("Passei no metodo A");...
asked by 15.01.2018 / 11:41
1
answer

Pick product prices in an array, add them and display the sum total in a TextView

Hello, guys, so I'm having a hard time solving a problem here, I'm using a MultiAutoCompleteTextView to get products and their prices in the app's Firebase database, I can already display all the products inside the autocomplete, however, I I wou...
asked by 16.01.2018 / 05:24
1
answer

Create a Spinner from a fixed list with more than 1 field

How do I add values to this Spinner? I need to create a Spinner that contains 2 "fields" (cod, option). Default values will be added, but the codes can not be changed later, so I need the cod field when adding other values,...
asked by 25.01.2018 / 19:38
1
answer

Spinner error when popular with SQLite

Error:    Caused by: java.lang.IllegalStateException: Could not read row 0, col   -1 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it. Classes NewRegistration: Activity class that will...
asked by 25.01.2018 / 12:10
1
answer

Android Studio - Doubt over String Comparisons

I have the following code static String q1 = "select * from faculdade"; if(edit.getText().toString().equals(q1)) { bar.setCurrentPosition(++position); Toast.makeText(getApplicationContext(), "Certa Resposta!", Toast.LENGTH_LONG).show...
asked by 25.01.2018 / 04:19
1
answer

java.lang.ClassNotFoundException: Could not load requested class: com.mysql.jdbc.Driver

I have a Dynamic Web Project in Eclipse and I have been constantly receiving this error: java.lang.ClassNotFoundException: could not load requested class: com.mysql.jdbc.Driver. My persistence.xml file: <persistence-unit name="casos">...
asked by 24.01.2018 / 21:53
1
answer

How to get other values from the selected Spinner item in addition to that shown?

Doubt: How do I find the value of the handle field for nome that was selected in Spinner ? Scenario: Table clientes Fields _id, handle, nome The ArrayList of Spinner is created a...
asked by 25.01.2018 / 13:56