Questions tagged as 'java'

1
answer

How to show interstitial ads after loading the home screen?

I need help, I'd like to display an interstitial ad after the initial screen load, but my code is giving the following crash:    java.lang.IllegalStateException: isLoaded must be called on the main UI thread. Here is my code: public cla...
asked by 22.01.2018 / 23:00
1
answer

Doubt listing database data JAVA - JSF

Good afternoon, I have a question about listing data in a datatable, coming from DB. I do not know how to return the DB data to the view. Follow my code so far package br.com.racionalgames.pta.mbean; import java.io.Serializable; import java.u...
asked by 08.02.2018 / 18:51
1
answer

Error in persistence.xml when connecting oracle database

I have this file to perform oracle database persistence. But do not connect! <?xml version="1.0" encoding="UTF-8"?> <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
asked by 16.01.2018 / 15:40
1
answer

How do I get PrintWriter to write a String variable in the .txt file?

My idea is to create a small .txt database to save a user's data. public void menuContato(){ try{ FileWriter fw = new FileWriter("usuarios.txt"); PrintWriter pw = new PrintWriter(fw); System.out.println...
asked by 16.01.2018 / 13:43
1
answer

Error in matrix 3x3

I'm having trouble with a java code. I am trying to make a code which generates a 3x3 array. I made a code which at first sight works okay. matrix3x3 public static void main(String[] args) { // TODO code application logic here...
asked by 10.01.2018 / 19:56
1
answer

unmount objects in an array

I have a search method in the database that brings me the following result: NotethatinsidetheObject[4]comesanotherarraythatcontainsPeople,People,andPeople.Iwouldlikeittoreturnonlythiswayandnotinsideanotherarrayasitishappeningnow,itshouldlook...
asked by 14.01.2018 / 16:30
1
answer

ManyToMany Hibernate - study

I am studying hibernate and I am having some doubts .... in this example site: link we have the post table with the ID and TITLE fields, we have the table tag also with the ID and TITLE fields and finally the ManyToMany table that...
asked by 30.01.2018 / 14:47
1
answer

Insert accented word in MYSQL

How can I correctly insert accented words in MySQL? Example: if you try to insert "John" you are recording John. MySQL is as Collation utf8-default collation I get the input data "name" below: <%@page contentType="text/html" pa...
asked by 29.01.2018 / 02:22
1
answer

error in report - unknown property in class

I'm using jaspersoft to create a report and I get the following error message: Unknown property 'RelTraceAccess' on class 'class sda.profiles.model.report.RelPadraoAcesso' Error retrieving field value from bean: RelTraceAccess. My class...
asked by 30.01.2018 / 15:07
1
answer

Convert String to INT

How to convert the string of the variable fg to an integer? if (connectionIsOpened) { String s = "INSERT INTO jogador(nome) VALUES " + "('" + this.playerName + "'" + ")"; connection.executeUpdate(s); String fg = "SE...
asked by 04.02.2018 / 17:08