Posts by Aline • 3,739 points
129 posts
-
4
votes1
answer113
viewsQ: Doubts about formatting hexadecimal numbers in java for use in MD5
I would like to know why the author of the article put this part: senha = String.format("%1$032X", i); I was curious how he got this string: "%1$032X" Follow the full code: import…
-
0
votes2
answers88
viewsQ: How to update the last name of a person who starts with the initial 'Fabio%'?
It is possible to do this, I have a name of a person who is 'Fábio Mello' and I want to update the name that starts with 'Fábio%' to have the last name '%Borges' as I do this query? update pessoa…
-
1
votes1
answer4298
viewsQ: How do I edit the email in git?
I had put an email as the default in the github account, and consequently in the git global config, but the problem that I closed the yahoo account and included Hotmail as the main one in the github…
-
3
votes2
answers5103
viewsA: Error to connect to sql server 2014 database with java and connection string problem
The problem was the sql connection string which was incomplete, this is the correct form: private String conexao = "jdbc:sqlserver://localhost:1433;user=sa;password=123;databaseName=fj21"; I managed…
-
1
votes1
answer8462
viewsQ: How to configure an existing field for auto-increment?
I would like to define the field id already created as auto-increment, because I created the table and did not put this option to it, how could I do this?
-
2
votes2
answers5103
viewsQ: Error to connect to sql server 2014 database with java and connection string problem
I put the jar and made the build path . I’ve been trying for a while to connect with the microsoft bank but gives this error: Exception in thread "main" java.lang.RuntimeException:…
-
1
votes1
answer1682
viewsQ: java.lang.Runtimeexception: java.lang.Classnotfoundexception: org.postgresql.Driver
I created the DAO, MODEL, CONTROLLER packages and a test It runs normal with the server, persists in the normal bank but through the viewing layer. I wanted to test in main running with java…
-
0
votes1
answer12434
viewsQ: Doubt with checkbox value true and checked
I have a form and to update I have this code snippet. I can’t understand what he means. Like, if the student is not active in the system he puts value="true"? Otherwise it also puts value="true" but…
-
1
votes0
answers102
viewsQ: I’m having trouble persisting the data in the BD
I am connected to the postgresql database, I put the postgresql-9.4-1201.jdbc4.jar driver. When I click to register this window appears this is not listing or persisting. The problem is that no…
-
7
votes2
answers327
views -
1
votes1
answer163
viewsQ: Using Connection is polymorphism?
Connection connection; connection = new ConnectionFactory().getConnection(); I can say that doing this is polymorphism? The Connection receive the class connection ConnectionFactory.…
-
13
votes1
answer568
viewsQ: Would it be right to leave the attributes of the abstract class as private or protected?
I don’t know how I should leave these attributes.
-
4
votes1
answer2107
viewsQ: Questions with the Connectionfactory and DAO class
I want to make a crud simple I am basing myself on some ready classes. My doubt follows: public class ConnectionFactory { private String url = "jdbc:postgresql://localhost:5432/aluno"; private…
-
7
votes3
answers454
viewsQ: Why was the parameterized class attribute <T> not instantiated?
I have this class that implements the IDAO interface package DAO; import java.util.ArrayList; public class BdApp<T> implements IDAO<T> { ArrayList<T> lst = new…
-
0
votes1
answer124
viewsQ: Error generating jar project
I wanted to generate a JAR of the project I made in Maven(simple). But it generates this error. Why generated this error? [INFO] --- maven-war-plugin:2.2:war (default-war) @ teste-MODEL --- [INFO]…
-
0
votes1
answer78
viewsQ: Doubt with public class Listatbproductodto : List<tbProdutDTO> what is it for?
I have this DTO class: using System; using System.Collections.Generic; using System.Linq; using System.Web; public class tbProdutoDTO { public tbProdutoDTO() { this.dsDescricao = "";…
-
9
votes1
answer139
viewsQ: How does the data capture of a form work?
I have this code to get data from a form: @WebServlet(name = "computador", urlPatterns = {"/computador"}) public class computador extends HttpServlet { @Override protected void…
-
-4
votes1
answer202
viewsQ: How does this class work?
DataSet OleDbConnection OleDbCommand OleDbDataAdapter OleDbDataReader I still can not understand this class in .net. What are these datasets and etc? I’m wearing this: using System; using…
-
6
votes3
answers175
viewsQ: Why is my Array item not changed in foreach?
In the call of the method: AlunoPrivado aluno = new AlunoPrivado(); aluno.addCursos("Portugues", "matemática", "história", "física"); boolean result = aluno.changeCurso("Portugues", "ciências");…
-
20
votes2
answers1468
views -
7
votes2
answers238
viewsQ: Doubt with recursiveness
I took a table test but the results will never come 0 because I subtract 1 of n but then adds the result with n. The result of this question was 36 and I don’t understand why. public class…
-
1
votes1
answer2026
viewsQ: What is the use of get and set methods in a String array?
I am not able to fill them and show the result on the screen with the use of these methods. To show what you have in the array I used another method the listArray and to insert data in the array I…
-
2
votes1
answer74
viewsQ: Would it be possible to identify 2 larger numbers in a sequence of 5 numbers typed by the user?
I tried to do, I researched about it, but I could not. I wonder if it is possible to identify two larger numbers without the use of vectors? Follow my attempt: int maior1 = 0, maior2 = 0; for(int i…
-
7
votes1
answer950
viewsQ: Vector within vector. What does it do in this context?
Forty students were asked the level of quality of food in the student canteen, on a scale from 0 to 10. ( 1 meaning horrific and 10 meaning excellent). Put the 40 responses into an entire array and…
-
4
votes2
answers3727
viewsQ: Greater and lesser number
I need to sort three numbers I can’t use for and neither vectors. I know it’s easy but I can’t do it. My problem is, I can’t keep the highest value. public static void main(String[] args) { Scanner…
-
3
votes3
answers104
viewsQ: About inserting names into an array. The user puts the course name as argument in the method
I have this method: public void inserirCurso(String nome){ System.out.println(" Cadastre seus cursos aqui."); for(int totalCursos = 0; totalCursos < cursos.length; totalCursos++){…
-
7
votes2
answers3006
viewsQ: How to capture the first letter of a String name and if the letter is 'C' save the name in an array?
I have an algorithm that reads a name of someone and if the name starts with the letter "C" should capture the name and save in the vector. I’ve tried it anyway but I can’t do it. public static void…
-
3
votes2
answers9108
viewsQ: How to insert multiple values into an array?
A student can take several courses such as "English", "Portuguese" etc. How do I put multiple course names in one array? I don’t want to set an example with ArrayList. It’s just to take a question…
-
4
votes4
answers7150
viewsQ: In inheritance with private attributes, does not the daughter class take its attributes from the mother class?
The devmedia article says the modifier private does not give access to its attributes in its child classes. It has a table with modifiers. In inheritance with private attributes, the daughter class…