Posts by electus • 971 points
26 posts
-
0
votes1
answer30
viewsQ: For Each with Where and Break By
I couldn’t find a suitable title for my doubt, but come on... Consider the code snippet below as an example: def temp-table tt-test field id as int field customer as int field added as char. create…
progress-4glasked electus 971 -
7
votes2
answers223
viewsQ: In SQL queries should I follow the order of the index?
If in my table X an index is created with the fields A, B and C (in this order), in the SQL queries I must follow exactly this order? Example following the order of the index: SELECT * FROM X WHERE…
-
-1
votes2
answers418
viewsQ: Software that needs license for commercial use
At XYZ the software Inforapid Search & Replace was downloaded to use in the IT department for when, for example, it is necessary to change the same line of code in several sources of the…
-
3
votes1
answer243
viewsA: Get cookies/browser
See if the method below helps you: Cookie[] cookies = request.getCookies(); if (cookies != null) { for (int i = 0; i < cookies.length; i++) { Cookie c = cookies[i]; System.out.println("Nome: " +…
-
15
votes1
answer37878
viewsQ: Xms, Xmx, XX:Maxpermsize, XX:Permsize - What’s the difference?
I need to improve the performance and availability of my Glassfish application server that from time to time causes the application to launch Outofmemory error. Searching the internet, I checked…
-
1
votes1
answer2589
viewsA: How to open a dialog by passing an object as a parameter in the primefaces?
You were very little detail in your question, but assuming you have a button and this button opens a dialog. To pass an object as a parameter, just do so: <p:commandButton value="Abre Dialog"…
-
4
votes2
answers856
viewsQ: @Predestroy on @Viewscoped
I noticed that @Predestroy in @Viewscoped scoped Beans is only called if the session that was active expires or if I force a page redirect (?faces-redirect=true). Without these conditions, the bean…
-
5
votes4
answers2869
viewsA: Is it recommended to use natural primary key?
Not a good idea. See some arguments: 1 - A person can be both a natural person (CPF) and a legal person (CNPJ). 2 - If the person does not have the document in hand, or the user who is registering…
-
3
votes3
answers8755
viewsA: What is the best way to replace a character in a given String position?
An alternative would be to use the StringBuilder instead of StringBuffer, because the second uses synchronized methods and the first does not, and as we know, the synchronization of methods affects…
-
2
votes3
answers8406
viewsA: ORA-01036: illegal variable name/number
The first column represents the names in insert and the second represents the names in command.Parameters (where you feed each field of the Insert): 1) iANOMES ----------------> iANOMES 2)…
-
0
votes1
answer475
viewsA: Search for Postgresql similarity
I don’t think any database natively has any function that returns results by similarity. But from the research I’ve done, there are several algorithms that can solve your problem. Read the posts of…
postgresqlanswered electus 971 -
3
votes1
answer118
viewsA: Error while reading characters
What’s happening is this: You’re typing enter to each character typed. Do not enter, just type one character next to the other. And add a system("pause") so you can view the output: #include…
-
4
votes2
answers352
viewsA: Understanding class instantiation
In my view: Instantiating the first way, when you create the object PerfilController 3 more objects will also be created in memory (PerfilDTO, Perfil and Recurso) even if they are never used.…
-
0
votes2
answers479
viewsA: I cannot insert in related tables
In the INSERT INTO dell... realized that you are entering 17 values in 16 fields. The number of fields must be exactly equal to the number of values passed in the VALUES. This may be the reason for…
-
3
votes3
answers1701
viewsA: Return of SQL SELECT
You could do it like this: SELECT count(1) FROM USUARIOS WHERE LOGIN = '$LOGIN' The select will return 1 find the user and 0 if not found. Similar to true and false.…
-
3
votes1
answer569
views -
3
votes3
answers2325
viewsA: Order By - Leave specific record for first
select * from tabela order by case when store_name = 'Boston' then 1 else 2 end;
-
2
votes2
answers869
viewsA: Validation with JSF
You can do what you want. First add this to your XHTML: <p:growl id="messageGrowl" /> Then in the method triggered by the button Add, after doing the proper validation, add the following line…
-
1
votes1
answer126
viewsA: Returning NULL
I don’t know if this is exactly what you need, but take a test: select group_concat(ifnull(coluna1, 'x')) as valores from (select 21 coluna2 union select 22 ) tab_aux left join arquivos on…
-
0
votes2
answers1761
viewsA: Database image displayed in primefaces does not appear
Instead of: sc = new DefaultStreamedContent(in); Tries: sc = new DefaultStreamedContent(in, "image/png"); It’s just a detail, but often that kind of detail is the "x" of the question. Another thing,…
-
2
votes1
answer7688
viewsA: Error comparing ORA-00932 dates
All the results of your marry must return the same data type. The error occurs because in a situation it returns a number and in another situation returns a date. The W_REG.DAT_ENVIO_CALCULO is a…
-
4
votes2
answers1174
viewsA: Instantiating an Object with a different reference
When you do: Animal umAnimal = new Gato(); It means that the variable umAnimal, type Animal, will behave like a Cat. If you create a method walk in class Animal, and then overwrite that method walk…
-
2
votes1
answer155
viewsA: Query that selects last line of each device?
I could not test the code, I did "in my head". See if you do what you want: select l.* from ( select d.imei, max(l.codigo) cod_local from clientes c join dispositivos d on d.client = c.codigo join…
-
3
votes2
answers972
viewsA: Encryption with Java
From what I read in your comments, the encryption will serve a web system developed in Java. Have you heard of the framework Spring Security? It enables you to implement authentication rules and…
-
0
votes3
answers3004
viewsA: Access data from already instantiated classes
Your class User_info certainly has attributes and these attributes are encapsulated in getters and setters, correct? To access the attribute data just call the getters. For example: User_Info info =…
-
1
votes4
answers3435
views