Questions tagged as 'java'

1
answer

Formatting Data with SimpleDateFormat

My problem is this: I have JTable with several populated columns with data pulled from my database. Some of these columns are time values, for example, 0834 is pulled from the database and I would like it to be displayed 08:34...
asked by 17.11.2016 / 03:40
1
answer

How to make the student's registration number of the logged in account stay in the publication table made?

I'm doing a rating project for a "college", I have the publishing class and in it the method: public String NovaPublicacao(Connection conn){ String sqlInserir = "INSERT INTO Publicacao (Assunto, Conteudo, RA) VALUES (?, ?, (SELECT RA fr...
asked by 17.11.2016 / 01:21
1
answer

How to use JUNIT to test void methods of my DAO class

Hello, I have a DAO class and I want to implement tests with JUNIT, but many of the methods have a void return. Here's a piece of the class that makes up the DAO package public class ExemplarDAO { private Connection connection = null; publi...
asked by 22.11.2016 / 16:02
0
answers

How to make pincode activator via serial?

I'm trying to make pincode validator (serial), but I do not know how to do it. I have two tables: "validation" and "expiration". In the "validation" table, it has the following fields: id(int), data(varchar), pincode(varchar), status(int...
asked by 17.11.2016 / 03:27
1
answer

Why is hibernate deleting before saveOrUpdate ()?

I have a m: n relation between Column and Element. The entity that owns the relationship is Column. however when I'm saving a map of Columns, the following scenario occurs: 1) In the first iteration, Hibernate: 1.1) saves the first Column...
asked by 23.02.2018 / 14:32
1
answer

How to set SELECT values in TextView?

I have the following class for database queries: package com.example.tais.books.Dados; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; /** * Created by Tais on 27/10/2016. */...
asked by 02.11.2016 / 00:16
1
answer

Java's try-catch-resources flush automatically?

When using an object of type FileInputStream and FileOutputStream inside a try-catch-resources java automatically uses the close () but is flush () automatic or not? // Exemplo try(FileOutputStream fos = new FileOutputStrea...
asked by 17.10.2016 / 08:24
0
answers

How to use a two-dimensional array to get the values of the radioButtons? [closed]

I'm developing a quiz game in Android Studio with 10 activities. For each question I have only two alternatives where I would get 1 for the chosen alternative and 0 for not chosen. I'd like to put these values in a two-dimensional array. How wou...
asked by 27.10.2016 / 21:41
1
answer

Error accessing dao class by a test class

I have the following error, when accessing a class dao of a test class: java.lang.NullPointerException This is the controller method: @Post("/consultar_lancamento/{codLancamento}") public int consultarLancamento(int codLancamento) {...
asked by 05.07.2016 / 19:36
1
answer

NullPointerException in java. Save image to bin folder so the software runs without errors?

I'm developing a project in java and putting images in jLabels , however, every time I run the program, it displays a message " Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException " and does not execute, loads up...
asked by 01.09.2016 / 17:17