Questions tagged as 'java'

1
answer

Doubts Socket Server

I have a question about the behavior of the code that is creating a socket server, follow the code of the server: public class Server { public static void main(String args[]){ try { ServerSocket server = new ServerSocket(3322);...
asked by 15.06.2018 / 15:51
1
answer

Use profiling of Maven or Spring Boot?

In my research I could understand that there is a way to perform application profiling (eg homologation and production) in two ways, via maven and spring-boot. The big question is that I have multiple profiles and would like to package each one...
asked by 28.03.2018 / 16:14
1
answer

Java - Read file and save output in .txt

I have an application to read a .txt file and select specific columns and generate in the format I need, the application works, however the result is generated in the NetBeans console, there I copy the contents, open Notepad ++ and paste, and so...
asked by 13.02.2018 / 13:13
2
answers

Replicating Binaries with Java

I'm trying to replicate a binary field representing an image in Oracle. Could you tell me the best way to get this data and insert again? The field in Oracle is LONG RAW. What kind of data do you use in Java? I already tried byte and I could not...
asked by 09.02.2018 / 15:03
1
answer

3 doubts of new user post with spring boot

I have the following doubts when saving a user to an api using spring boot. 1) Is the best way to check if email already exists? 2) In case I am sending the id of the user just saved, but it is not being sent as json, it is only sending th...
asked by 01.04.2018 / 04:16
2
answers

Capture the moment the cell phone screen was turned on and when it was deleted

Hello!    I am building a project similar to an alarm clock but I am having some difficulties trying to use the broadcastreceiver class. Problem:     I want to capture the date and the exact time that the cell phone screen was lit, that is, if t...
asked by 31.03.2018 / 15:49
2
answers

How to check if user has already been registered in the database?

How can I check if a user is already registered? For example, when registering a user check if the login has already been saved in the database. DAO looked like this: public boolean validarLogin (String login) throws SQLException, ClassNotFoun...
asked by 15.02.2018 / 20:20
1
answer

SharedPreferences methods not found

I can not save using SharedPreferences , Android Studio accuses methods do not exist. By the official SharedPreferences documentation has the 2 forms, as needed from where find the value: Calling any context ( getSharedPrefere...
asked by 15.02.2018 / 19:50
2
answers

Call method with parameter of View type, in another method

Examples of a method that requires a View public void lista(View v) { Toast.makeText(this, "Ok", Toast.LENGTH_SHORT).show(); } public void botaoAbrir (View view) { Intent i = new Intent(this, NovoRegistro.class); st...
asked by 01.02.2018 / 13:40
1
answer

Reason for process delay and hibernate configuration (persistence)

I'm building a WS server with Java, and I'm seeing some problems, such as login via POSTMAN, it's taking between 6000 and 7500 ms to respond, which it actually does, is around 50 ms. After you can configure log4, most of the delay is in: or...
asked by 31.01.2018 / 17:34