Posts by Viktor Hugo • 447 points
19 posts
-
1
votes1
answer44
viewsA: Configuration of the Hibernate!
I believe it would be right to change the directory of your scripts to src/META-INF/sql/init.sql would be on the same level as your archive persistence.xml In your persistence.xml file you would get…
-
0
votes1
answer128
viewsA: Spring project not saved in Mysql
If you just want to run a simple code, you can use the interface CommandLineRunner in its main class. Spring itself injects an implementation for its Userrepository class. OBS: Every time you start…
-
1
votes1
answer55
viewsA: Problem showing data Many to Many
Currently I have no way to test in mysql so I did on postgresql In your class Livro change the field autores to receive a list of type Author only with updated gets and sets: public class Livro {…
-
0
votes1
answer206
viewsA: Fluig - Mysql 8 Connector
For more information: Documentation Fluig Datasources The configuration is very simple, the fluig uses jboss as application server. We need to change the file standalone.xml where the settings for…
-
1
votes1
answer259
viewsA: Restriction error in relationship Onetomany Hibernate
In the code you added we can see the problem, the objects P1, P2 and P3 are in the field bookUrl null. Add the object bookvariables P1, P2 and P3. would be something like: BookUrlParameterEntity p1…
-
1
votes1
answer195
viewsA: Restful with Spring, Hibernate, Maven, Postgresql and Wildfly - Createcriteria
Try changing your application-context.xml file to use JPA implementation: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans"…
-
3
votes1
answer1041
viewsA: Java and Mysql - Error - Timezone
Try adding these parameters to your connection url: useTimezone=true&serverTimezone=UTC Will stay like this:…
-
3
votes1
answer55
viewsA: Loop for from index 1 java array
I believe I could do it like this: String arquivo[] = arquivoDecodificado.split("\r\n|\r|\n"); for(int i = 1; i < arquivo.length; ++i ) { String[] linhaQuebrada= arquivo[i].split(";"); Pessoas…
-
0
votes2
answers73
viewsA: problems with consultation in hql
Good morning Luan, as you changed the name of Luan and presented another exception you need to declare an identifier for your entity in the query, try this: hql += " WHERE c.nome like upper…
javaanswered Viktor Hugo 447 -
1
votes2
answers1117
viewsA: Error trying to install PHP 7.2 on Ubuntu
Like Valdeir remembered well, if your Ubuntu is 17.10 or lower follow these steps: Make sure you have the following package installed so you can add repositories: apt install…
-
1
votes1
answer105
viewsA: Connection error while using Hibernate Logs
Change the commands to these: <property name="hibernate.show_sql" value="true" /> <property name="hibernate.format_sql" value="true" /> Using the property value to set value.…
-
0
votes1
answer25
viewsA: I was trying to take the title_bar and the application does not run!
I believe this occurs because you are using AppComatActivity which is not compatible with android:theme="@android:style/Theme.NoTitleBar" try this: In style.xml: <style…
androidanswered Viktor Hugo 447 -
2
votes1
answer689
viewsA: Remove accents from an array
Follows a function I use: function removerAcentos($string){ return preg_replace(array("/(á|à|ã|â|ä)/","/(Á|À|Ã|Â|Ä)/","/(é|è|ê|ë)/","/(É|È|Ê|Ë)/",…
-
2
votes4
answers7785
viewsA: Calculate circle area
Looking at your code, some suggestions. double raio = 0; /* inicialize variaveis que for utilizar em cálculos */ double area = 0; final double PI = 3.1416; When requesting user data: // Não faz…
javaanswered Viktor Hugo 447 -
1
votes1
answer295
viewsA: Enum returns null from the database
You can try that too: // método getLista() ... contato.setTamanho(Tamanho.valueOf(objetoResultSet.getString("size"))); In accordance with described as in your table has null value in some records it…
-
0
votes2
answers906
viewsA: Printing java Boolean attributes
If you used the genereate get and set of the eclipse it puts attributes of type Boolean as isMensalidade()
-
0
votes1
answer111
viewsA: JPA + JSP - Error trying to enter information into database
By your error log, Caused by: java.lang.ClassNotFoundException: Could not load requested class : com.mysql.jdbc.Driver Tomcat cannot find mysql drive. If you’re using Maven to manage dependencies:…
-
2
votes2
answers1785
viewsA: How to configure virtualhost for xampp on Ubuntu
Opa all right ? First you need to uncomment into the /opt/lampp/etc/http.conf file, the following line: #Virtual Host Include etc/extra/httpd-vhosts.conf After that edit the file:…
-
0
votes2
answers800
viewsA: Problem when mapping Servlet in web xml
When mapping Servlets it is not necessary to inform the directory 'src'. Then in web.xml enter the package and class name. <servlet-class>controllers.addContatoServlet3</servlet-class> A…