Most voted "java" questions
Use this tag when the question refers to some resource, information, or problem relating exclusively to the Java programming language. Java is a class-based, statically typed, reflective, and execution environment (JRE) language. Java programs are compiled to bytecode and run on a virtual machine (JVM), allowing a "write Once, run Anywhere" philosophy (WORA).
Learn more…14,468 questions
Sort by count of
-
0
votes1
answer98
viewsMount Query with JOINS
I have a query executed on DB2: SELECT f.* FROM Fat f INNER EFat ef ON f.id = ef.id AND f.seq = ef.seq How do I reverse it in Java? I tried this way, but it’s wrong, all my classes are with their…
-
0
votes1
answer112
viewsJXL generate excel spreadsheet with decimal value in the Brazilian standard
I am using Java and Jsf on my system and there is a screen where you have the option to generate an excel spreadsheet. Worksheet generation is ok. The problem I’m encountering is in columns that…
-
0
votes0
answers52
viewsArraylist JAVA doubts
I have an object "Itemsoliccompra" and within that object has another object called "Product" and product has attributes (name, id, etc...). I have a list that sometimes these products repeat (id,…
-
0
votes1
answer31
views -
0
votes1
answer118
viewsPick item contained in a Listview item by clicking on the item
My situation is as follows, my listview loads the items into an xml I created for each listview item At the time listing is like this: What I want to do is, by clicking, take these items circled in…
-
0
votes1
answer955
viewsWebview Android Studio giving error to open mailto email links:
I created an application using the WebView in Android Studio. On my website where the WebView opens has email links that when clicking should open the default email application of the mobile. Only…
-
0
votes1
answer48
viewsAndroid - Notification bar hangs while updating progress
I have an application that uses a custom download manager, I’m trying to show a progress bar in a notification, but every time you enter the while loop I can’t scroll down the notification bar and…
-
0
votes2
answers692
viewsHibernate, JPA, does not save the new data in the database
I have a Java Spring MVC application, with Hibernate and JPA and HTML interface. I have two forms that depend on the Notebooks class and its attributes. In the first form I enter the data of a new…
-
0
votes1
answer94
viewsData scraping with jsoup and saving in txt
Whoa, way to go, guys. I’m trying to learn data scraping on my own, and as my English doesn’t help, I’m turning 30. Basically this is it. In executing my code, he lists the athletes of the…
-
0
votes1
answer119
viewsError reading txt file line by line
I’m having trouble reading the dist1.txt file and can pass the values of each line and pass to an array of the other class. The file has the following format . txt: 1;1;00 1;2;14 1;3;05 1;4;05…
-
0
votes1
answer1597
viewsHTTP Status 400 - Bad Request - Spring MVC
When trying to call a Controller method this returns the error below: HTTP Status 400 - Bad Request Type Status Report Description The server cannot or will not process the request due to Something…
-
0
votes1
answer30
viewsGet permission status when user has given permission to Runtime location access on Android
I’m getting the location data using the LocationManager on Android and would like to know how I can catch the action only if the user allow the app accesses your location data. For example, using…
-
0
votes0
answers24
viewsError filling in Jsf datatable Primefaces
My Entity: package Entidades; public class Aluno { private String nome; private int idade; public String getNome() { return nome; } public void setNome(String nome) { this.nome = nome; } public int…
javaasked 6 years, 6 months ago Leandro Moraes 1 -
0
votes0
answers78
viewsJava JDBC Mysql syntax error
I have a syntax error here in the mysql query inside the Java code, in the repository. The error is both in the CHANGE method and also in the Delete. package…
-
0
votes1
answer183
viewsHow to resolve: Column "id" not found [42122-197]?
Guys, I’m creating an API that will display random phrases from a table in the database. The problem is that whenever I access the route, on the console, I get this exception:…
-
0
votes1
answer105
viewsGenerating correct json with p-dropdown primeng?
I’m new to Angular and I’m in the following situation using the API java: I have the class "Lancamento" where the category NAY is mandatory (class Category) @Entity @Table(name = "lancamento")…
-
0
votes1
answer332
viewsDelete only lines with selected checkbox in a Jtable
How to delete from a JTable lines that are marked in a Checkbox that is in a table cell? I am using AbstractTableModel. The code I was able to create, erases only part of the selected records,…
-
0
votes1
answer87
viewsHandle invalid characters inside a switch
hello, I have a code that registers people and performs some functions according to the option selected in the menu that opens at the beginning of the program, the options go from 1 to 7, the…
-
0
votes1
answer116
viewsError deserializing a Java List Json
The following is, I get a list in JSON format. However, it seems that there is some kind of non-conformity in the way JSON is mounted. It follows the code... I have a client class that is as…
-
0
votes1
answer677
viewsConvert URI to Bitmap
Good afternoon, I am as a doubt, how can I convert a URI to Bitmap and then convert to Base64 so I can send to the Database. private void abrirCamera() { fileUri = getOutputPictureUri("GRP"); if…
-
0
votes2
answers44
viewsQuery syntax error with RFID code filter
Syntax SQL error on the part from estoque where cod_rfid = 102. Note: 102 is the value that is in the RFID tag. String dadoRFID = new String(readBuffer); String Del_inc = dadoRFID.substring(0,1);…
-
0
votes0
answers363
viewsAPPLICATION FAILED TO START: Persistence error while starting the application
Projeto Completo: https://github.com/codenome/ponto-inteligente-api I am developing an application with Spring Boot, and when starting the application I found an error that I could not solve after…
-
0
votes1
answer250
viewsR cannot be resolved android Studio
I’m facing a problem, it seems to be a bit simple, but I’m already a few hours into it. I’m mounting a project on android Studio and the Same is giving in the field private UserLoginTask mAuthTask =…
-
0
votes1
answer48
viewsWith creating a Archbar without the arrow icon in the left corner?
I need to create a Toolbar with a searchview that works like the first two images: When this searchview opens it needs to overlap the image(logo) and extend all over Toolbar. If in my menu I use…
-
0
votes1
answer88
viewsService in Jboss does not log and does not work properly
I have a service that is deployed inside my Jboss EAP 6.4, when I try to access the end-points of the service is returned a replacement, along with the status 500, but nothing is logged in the…
-
0
votes0
answers81
viewsHow to pass data from a Jtextfield to a Postgresql Date field
I urge you to help me solve a problem of entering data type Date (SQL) to register new students in the Crud project developed by me in the code below. The method containing the INSERT INTO command…
-
0
votes1
answer88
viewsDoubt about foreign key Ibernate
insert image description here The diary_place table is being created with 2 user_id field, I want it to be only a user_id referenced as foreign key for Diary and place tables. I want the result to…
-
0
votes1
answer270
viewsandroid.database.sqlite.Sqliteexception: near "SQL": syntax error (code 1): , while compiling: SQL * FROM Employers WHERE id =?
I’m trying to do the SELECT below passing a value as parameter in the query, only it keeps giving the same error. android.database.sqlite.Sqliteexception: near "SQL": syntax error (code 1): , while…
-
0
votes2
answers3450
viewsDifference between Requestmapping and Postmapping
I was taking a look at the requisitions from Spring Boot and I saw that you can make a requisition POST, in two ways: //primeira forma @RequestMapping(value = "/dev", method = RequestMethod.POST)…
-
0
votes2
answers434
viewsError server Timezone is unrecognized wildfly 14 Connector/J 8.0.13
I am configuring my environment using wildfly 14.0.1.Final and mysql-Connector-java-8.0.13. I have the following error when I set up the Connection profile and do a connection test:…
-
0
votes2
answers302
viewsHashmap to pick a value
I have the following code: it is used to count how many seconds it takes to type a sentence. If I type BABA the result is 10. BUT I WISH THAT WHEN THERE WAS THE JOINING OF THE LETTER 'Q' + 'U,' (AS…
-
0
votes2
answers95
viewsChanging an entity by passing a list
Hello, I have a registered teacher class and want to change it by passing an array of subjects. I have the following code: teacher class: //... atributos não importantes ao problema @ManyToMany…
-
0
votes1
answer385
viewsSwap the first and last element of an array by creating a new array
Why the value of Numbers[0] changes to 3 after executing the code line below? New_Numbers [0] = Numbers [Numbers.length - 1]; The complete code: public static void main(String[] args) {…
-
0
votes1
answer37
viewsERROR: Function to insert word in string
I wrote a function to receive a string, a character and a position . /** * Funcao para inserir um simbolo em certa posicao valida ENTRE outros * em dada cadeia de caracteres. * @param a - cadeia de…
-
0
votes1
answer43
viewscheck elements does not work
I want to do a method that will check if an element has already been added to a list, if it will already increment 1. This is the class I made, but it is a mistake. public class Rascunho { private…
javaasked 6 years, 6 months ago John R. Daniel 1 -
0
votes1
answer112
viewsHow to Do Treatment to Prevent Nullpointer Error
I need to create a treatment for, if no investment fund record is found, avoid error and nullpointer. You’re making me wrong again: java.lang.Illegalargumentexception: id to load is required for…
javaasked 6 years, 6 months ago aleestevao 133 -
0
votes0
answers631
viewsSpring Data jpa save() method does not work, returning an object with nullid
Personal I have Rest Api developed with Spring, Hibernate and springboot, I am with a problem when making a post call to persist the data of a particular client, does not generate any error and also…
-
0
votes1
answer850
viewsHow to organize an array for odd numbers before even numbers?
I’m trying to make a program that organizes an array to put the odd numbers before the even numbers, this was my attempt, what I’m doing wrong. Code: System.out.print("Indique o número de elementos…
-
0
votes1
answer84
viewsHow to know which list an object belongs to?
I’m having a problem, and I’m having trouble figuring out which list an object belongs to. I have to make a game of truce in java, I have the player class, and each player has a list of cards (the…
javaasked 6 years, 5 months ago Matheus Carvalho 11 -
0
votes1
answer99
viewsAjax Request Returning in White
all right ? My doubt is as follows: I am making an ajax request to my Serrvlet and its return is being blank. JS: $('#pesquisar').click(function() { $.ajax({ url: '../UsuarioController', type:…
-
0
votes1
answer31
viewsNot registered with Banco Javaweb Primefaces
Productive: public class ProdutoDao implements IDao<Produto> { @Override public List<Produto> listar() { Session session = null; try { session =…
-
0
votes1
answer188
viewsHow to view Servlet’s list in jsp?
Good evening. People, I have a question that after N attempts is not clarified, so I decided to ask the masters for help. Basically, I have the following Servlet: @Override protected void…
-
0
votes1
answer156
viewsXML parser error with JAXB
I’m trying to parse an XML file provided by a Webservice with open data of the acting Senators on Senado Federal The XSD file can be found directly by that link. This xsd does not specify a root…
-
0
votes1
answer37
viewsAndroid app opens and soon stops working
I want to create an application to trigger a rele from Arduino. I made the code but when I pass it to my mobile to test it gives the following error: App Has Stopped Working Follows the code. MAIN…
-
0
votes2
answers62
viewsDatabase Image Inclusion - Longblob
I am coding a simple register, where it also needs to record a photo in the database, which should be the Tibo BLOB. This is my Class Person: public class Pessoa { private Integer idPessoa; private…
-
0
votes0
answers305
viewsCompress files into independent parts ( no need to be tight to unzip)
In my application I can compress a folder and its contents, this content is the result of manipulation of pdf, jpg and xls. But I needed to split it into parts ( the compressed file cannot be larger…
-
0
votes1
answer27
viewsSelect me returns null, in the second iteration of the FOR loop, on
I have a database, ROOM, I make a select right after the return of a asyncTask. I take the U-turn and make a select, awaiting the return of this select. Works normally in the first iteration of for,…
-
0
votes1
answer545
viewsConversion error when setting''to'null Converter'. - JSF
I am doing a program that registers and relates a customer to a credit card. I am using JSF and Primefaces. It is not necessary to use the Database, so I am storing the data in a same Arraylist.…
-
0
votes1
answer83
viewsProblem when holding a button event in Java Swing
I’m having a problem doing an event on a button (using textfield to set values) and calling a method to calculate BMI (I haven’t finished this method yet). Code: (java screen.) package…
-
0
votes1
answer62
viewsPrint contents of an object belonging to a Treeset (Collection)
I have a Treeset that will store several objects of a class "Products", this class has 3 attributes: int commodity; String descProduct; float precoProduct; After storing some "Product" objects in…