Questions tagged as 'java'

1
answer

Remove Demoiselle pagination

I'm using the Demoiselle and its paging feature, but when I need to use all the objects listed, ie use the full return, it does not leave, it keeps paging. My pagination: @Override public LazyDataModel<NotaFiscal> getDataModel() {...
asked by 16.06.2015 / 18:34
1
answer

Pre-development question about android app with data synchronization

I would like to make a simple user registration application using java. However, this application should maintain a local database for offline data access and a database in the cloud to synchronize information when I click a "sync" button....
asked by 15.06.2015 / 21:08
1
answer

How do I make an abstract java standard DAO class to inherit in dao classes?

I want to make an Abstract Class in Java for use in the Dao classes that I will use in various projects, not to repeat the selection, insertion, deletion, and update methods in all dao classes. I did not want to use hibernate and others. T...
asked by 16.06.2015 / 20:48
1
answer

JDBC + mysql remote connection error

Introduction I'm developing a java program that can change the database connection, I have 1 local bank (127.0.0.1:3306) and a remote bank (192.168.25.75:3306) that would be a my computer, I made the connection using jdbc. connDb.java im...
asked by 15.09.2014 / 02:43
1
answer

How to manipulate Labels using a loop

How can I use these labels using a loop, instead of creating 40 lines of code repeated? jLabel1.setIcon(new ImageIcon(getClass().getResource("/cards/"+cards.get(1)+".png"))); jLabel2.setIcon(new ImageIcon(getClass().getResource("/cards/"+cards...
asked by 12.09.2014 / 11:57
2
answers

When should I save data from my application to the system registry?

I need to store some information from my application so that when the user starts it again, the last use data will be loaded. At first I thought about using the Windows registry (in that case I'm sure the application will only run in the Win env...
asked by 26.01.2015 / 13:54
2
answers

Android custom listview working but with problems

Hello, I am doing a binding and I have only one of the properties of my Model that are appearing in my listView. Here is the code: Adapter: public class ProjectAdapter extends ArrayAdapter<Project>{ private List<Project> _p...
asked by 14.08.2014 / 18:25
1
answer

Call external file by Div

In the script below it is possible to call an external file through this <div> <div id="script" class="#"></div> Look at this snippet of the script: https://'+id+'?= How do I get through <div>...
asked by 19.08.2014 / 18:05
1
answer

How to delete a record without affecting the query?

I have two PRODUCT tables and CUSTOMERS. I am using inner join to link them in my queries. I call the product and it displays the product, takes the customer from the CLIENTS table and displays it together in the query. After deleting th...
asked by 20.11.2014 / 03:19
2
answers

___ ___ erkimt error occurs when performing resource injection in Bean ______ qstntxt ___

Bean:

%pre%

Page:

%pre%

Exception:

  

javax.servlet.ServletException: An error occurred when performing resource injection on managed bean MBfabricantes       javax.faces.webapp.FacesServlet.service (FacesServlet.java:659)       org.apache.tomcat.websocket.server.WsFilter.doFilter (WsFilter.java:52)

    
______ ___ azszpr28385

The resolution of this was:

In the factory connections, specifically in the method, I put the following command (although my Java version is 7):

%pre%     
______ azszpr31582 ___

An additional to your own answer (This should be a comment, but strangely in some questions I am unable to comment (I am a new user)).

You make DriverManager.registerDriver (Driver driver) redundant. What was happening is that your application's DriverManager was not being notified to register the driver. See the static startup section of the com.mysql.jdbc.Driver class:

%pre%

Not that this is important, but it's the way JDBC Drivers work (they only need to be triggered once to be automatically registered). To avoid a strong direct coupling of your class with the driver, choose to do

%pre%

Usually on an application server, this code snippet is not required.

    
___

Bean: package br.com.drogaria.bean; import java.sql.SQLException; import java.util.ArrayList; import javax.annotation.PostConstruct; import javax.faces.bean.ManagedBean; import javax.faces.bean.ViewScoped; import javax.faces.model.ListDataMode...
asked by 07.08.2014 / 07:08