Questions tagged as 'java'

1
answer

Using SeekBar in a simple way

I am, for study purposes, developing a player in Android Studio . The player is ready. Now I want to control it. Searching, I discovered the SeekBar component. But I'm not finding a way to tell her that the source of the sound is...
asked by 25.12.2018 / 15:13
1
answer

How to separate the HTML from the Java code of connection to the bank?

I have a database and an html code that finally managed to make a connection but the code is a bit messy because it mixes html with java and mysql ... Here's an example: <%@page import="java.io.*,java.sql.*" %> <% Class.forNa...
asked by 22.12.2018 / 19:09
2
answers

How to create a Postgresql stored procedure from a Java code

Searching the internet for a solution to create a database on a Postgresql server for my Spring project, I found the following topic in StackOverflow: link where the following Stored procedure exists for this task: DO $do$ BEGIN IF EX...
asked by 07.05.2014 / 16:01
2
answers

Check character and value repeated in array of strings

I have an array of strings String[] jt = { "João Mendonça", "Mário Andrade", "João Mendonça"}); What you are supposed to do is verify if the array contains at least one character and has no repeated name , or in this specific case it...
asked by 30.04.2014 / 15:01
2
answers

___ ___ erkimt Unable to build entity manager factory (JPA Hibernate) ______ qstntxt ___

I am trying to make a connection with Hibernate and JPA, but when trying to create the connection or persist some data it executes the following error:

  

Dec 04, 2018 2:02:45 PM org.hibernate.ejb.HibernatePersistence   WARN: logDeprecation HHH015016: Encountered to deprecated   javax.persistence.spi.PersistenceProvider   [org.hibernate.ejb.HibernatePersistence]; use   [org.hibernate.jpa.HibernatePersistenceProvider] instead. Dec 04, 2018   2:02:45 PM org.hibernate.ejb.HibernatePersistence logDeprecation WARN:   HHH015016: Encountered to deprecated   javax.persistence.spi.PersistenceProvider   [org.hibernate.ejb.HibernatePersistence]; use   [org.hibernate.jpa.HibernatePersistenceProvider] instead. Dec 04, 2018   2:02:45 PM org.hibernate.ejb.HibernatePersistence logDeprecation WARN:   HHH015016: Encountered to deprecated   javax.persistence.spi.PersistenceProvider   [org.hibernate.ejb.HibernatePersistence]; use   [org.hibernate.jpa.HibernatePersistenceProvider] instead. Dec 04, 2018   2:02:45 PM org.hibernate.jpa.internal.util.LogHelper   INFO: HHH000204: LogPersistenceUnitInformation   PersistenceUnitInfo [name: context ...] Dec 04, 2018 2:02:45 PM   INFO: HHH000412: hibernate Core   {4.3.0.Final} Dec 04, 2018 2:02:45 PM org.hibernate.cfg.Environment    INFO: HHH000206: hibernate.properties not found Dec 04, 2018   INFO: 2:02:45 PM org.hibernate.cfg.Environment buildBytecodeProvider   HHH000021: Bytecode provider name: javassist Dec 04, 2018 2:02:45 PM   org.hibernate.annotations.common.reflection.java.JavaReflectionManager    INFO: HCANN000001: Hibernate Commons Annotations   {4.0.4.Final} Dec 04, 2018 2:02:45 PM   org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl   configure INFO: HHH000402: Using Hibernate built-in connection pool   (not for production use!) Unable to build entity manager factory

My pom.xml

%pre%

My persistence.xml

%pre%

My Main class

%pre%     
______ azszpr348573 ___

I am trying to make a connection with Hibernate and JPA, but when trying to create the connection or persist some data it executes the following error:    Dec 04, 2018 2:02:45 PM org.hibernate.ejb.HibernatePersistence   WARN: logDeprecation H...
asked by 04.12.2018 / 18:06
1
answer

Consumption WS Rest returns null

I'm consuming a WS to get vehicle data, the API that was passed to me returns a JSON: { "success": true, "message": "", "result": [ { "Codigo": "1013", "Placa": "ABC1234", "Ano": 2016, "Uf": "SP", "Marc...
asked by 29.12.2018 / 16:44
1
answer

Java and MySQL - Error - Timezone

I try to connect to MySQL with the code below. I do not use Hibernate, or anything. It's just to connect to the bank and run a simple SQL clause. I get the error below. I've seen some questions with answers here, but I confess I did not under...
asked by 28.12.2018 / 19:48
1
answer

How to reduce the spacing between items in BoxLayout?

In my example, class Teste is JPanel with BorderLayout . Within the middle of this layout is a JScrollPane containing another JPanel with BoxLayout vertically. The intent is for items I add to this...
asked by 28.11.2018 / 18:27
1
answer

Incompatible types when trying to start a class with the value of the "switch" of another Java

I have the following: public class Bullet { public enum Direcao { UP,DOWN,LEFT,RIGHT }; // Posição do tiro em pixels. private int x,y; // Direção do tiro. private Direcao direção; // Este tiro está ativo? private b...
asked by 30.10.2018 / 21:07
1
answer

Two AsyncTasks running in parallel while requesting with HttpClient

I have two classes extending AsyncTask, in which they return a JSON from a server. I'm using the following code to run them simultaneously: if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) AsyncTaskExemplo1.executeOnExecutor(...
asked by 20.02.2014 / 21:37