Posts by ayowole agbedejobi • 557 points
21 posts
-
6
votes1
answer259
viewsQ: Sorting algorithm, Java stream
When working with Stream I currently use the Sorted method to sort, example: Stream<Integer> stream = Stream.of(3, 2, 1); stream.sorted(); // saida será 123 What is the sorting algorithm for…
-
15
votes2
answers2907
viewsQ: What is Jakarta EE?
Only Javaee nomenclature changed or other significant changes will occur? Will be compatible with Javaee 8-? Javaee and Jakartaee will be maintained by the same community?
-
1
votes1
answer285
viewsA: How to separate HTML from Java code from connection to the database?
If you want to do a nice division I recommend studying about the pattern DAO (Data Access Object) Sobre DAO Subsequently on MVC (Model View Controller), for this recommend studying a little more…
-
2
votes1
answer128
viewsQ: What is it for and where should I use "strictfp"
I was reading the Java 9 specification and came across the keyword strictfp, What good is only that it is not clear. What good is that and where I should apply it? Why is it not so used in the…
-
5
votes1
answer334
viewsQ: Raw String Literals Java
I saw that in JDK 12 it is possible to make raw string literals similar to some programming languages like C#, JS, R etc. Ex in C#: "Essa não é uma \n raw string"; Exit: Essa não é uma raw string…
-
1
votes1
answer45
viewsQ: Multiple Returns Pattern Builder
I have a class Builder who is responsible for returning an object he builds: public class ObjetoBuilder { private Objeto objeto; public ObjetoBuilder() { objeto = new Objeto(); } public…
-
1
votes1
answer55
viewsQ: Merge POJO and Entity
I’m studying JPA and I need to serialize an entity: @Entity public class Employee { @Id private Integer id; ... } Is it good practice to serialize an entity directly like I do with a POJO? Or have…
javaasked ayowole agbedejobi 557 -
0
votes1
answer940
viewsA: Store values in vector
A possible implementation with java8 public class App { public static void main(String[] args) throws IOException { List<Aluno> alunos = new ArrayList<>(); long numeroAluno = 11110L; for…
-
1
votes1
answer646
viewsA: I’m trying to read and write an XLS with Apache POI
HSSF - is normally used for Windows Excel 97-2003 type files; XSSF - is normally used for Windows Excel 2007 files - current. reference: apache poi reading and writing tutorial using XSSF In the…
-
1
votes0
answers50
viewsQ: Alternative to the stabbing
I would like to know if you have any Pattern design or alternative approach to Pattern facade. I found interesting his approach in creating a "facade" for a certain "subsystem" but the class that…
-
0
votes0
answers37
viewsQ: ER with implicit relationship
I’m doing an ER where all tables have to have a "log" of who made a record, IE, I have a table user which creates a certain record and in the registry there is a Foreign Key that indicates the user…
databaseasked ayowole agbedejobi 557 -
7
votes1
answer148
viewsQ: Am I using the Pattern bridge design correctly?
I am studying design standards and would like to know if the following approach is correct for the bridge pattern and if it has how to improve:…
-
2
votes3
answers2107
viewsQ: How to print only a part of HTML?
To print a page I know I must use <button onclick="window.print()"> What I need to know is how to print a DIV? Ex: <div id="divtoprint"> //some code </div>…
-
2
votes1
answer509
viewsQ: Arraylist<Obj> java listing
What is the advantage of using in a listing: for(Obj o : lista){ // operacao } instead of: for(int i = 0; i < lista.size(); i++){ // operação }…
javaasked ayowole agbedejobi 557 -
0
votes1
answer1037
viewsA: Dynamic Table with Ajax and JSP
Have you thought about using Ajax? I went through the same problem and with Ajax I was able to solve the asynchronous call issue. I recommend using Ajax with jquery. Follows a great reference of…
-
1
votes1
answer186
viewsA: Scan json object with $.each jquery
The solution to my problem was to put the following command on Servlet: protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try {…
-
0
votes2
answers416
viewsA: Upload files and data SERVLET
Solution of my case: PrintWriter out = response.getWriter(); Map<String, String> fields = new HashMap<>(); Map<String, List<String>> multiValueFields = new HashMap<>();…
-
0
votes1
answer186
viewsQ: Scan json object with $.each jquery
I am making a request to my Servlet and taking the json data according to the code below: $(document).ready(function(){ $.post("MesaController",function(response){ $.each(response,function(i,v){…
-
2
votes2
answers416
viewsQ: Upload files and data SERVLET
How do I receive files and other parameters in Servlet? Follow the sending code: <form action="myservlet" method="post" enctype="multipart/form-data"> <input type="text" name="mytext">…
-
0
votes1
answer9717
viewsQ: Remove data from a div with Jquery
I need to remove the information inside one or remove the div from my web page with Jquery, I tried using the code: $("#myid").html(""); and also $("#myid").remove(); none of the solutions worked,…
-
-1
votes2
answers1797
viewsQ: How to take data from 3 tables with INNER JOIN performatively
I got three tables on the bench, Exercise and Exercise. I need to do the SELECT with the INNER JOIN and differentiate columns with the same name: SELECT t.id AS tid, et.id AS etid, e.id as eid,…