How should I delete a row using a java variable in SQL table? I am trying to delete a record from table member (with two columns, name and year) using what the user has input (variable newName and …
Tag: java
hibernate multiple @OneToMany relationships generating more results in parent relationship
I will start with the result. In the next image I am displaying the result content of company.userAccount. In the database I have only two companies assigned to the same user and 7 services attached to one of the companies. The generated query (simplified) is This will generate Expected result: I was expectin…
How to access database on Android app without root
I’m developing a small app with a database of 100 elements. I import the database but only in one emulator (of 3 witch I have) runs correctly. I found that it runs without problems because the “Songs….
Filter rows in DataSet using JPA/Hibernate
I have the following code which is used to retrieve data from multiple tables (using joins) and then mapping every row into a DTOList but I also need to apply filters based on user preferences: per …
Creating dynamic query using jpa criteria
I created dynamic query using jpa criteria but an extra pair of parentheses gets added to columns to be selected when I do userGroupSubquery.select(userGroupsRoot); generated query select (…
paging and sorting with Jpa returns only around 10% records from db
When I try to retrieve data from JpaRepository with Pageable request it only return 10% from all records. as example I had 68 records in MySQL database and pageble request only return first 10 records. when i try to get 2nd resultset it returns empty page content object. but if I request 100 records in one re…
How to get rid of many placeholders (question marks) in java sql statements
I want to insert a row to table using JDBC. But table has a big number of columns, so I don’t want to specify all of them into a statement. Is there another way of specifying column values? INSERT …
Validate a value that already exists in database in JavaFX
When i am registering members with a memberId, how to check that the user id is already exists in the members table or not ? I have tried in below method. Primary key is the MemberID MemberDbController.java MemberUiController.java } Its Throws an Already Exists Alert for both Duplicate & New Entry. Answer…
Reading data from a sql database with spring data fails
I’m having a database with existing tables. One of these is called AKTIVE_AUFTRAEGE with the id “AKTIVE_AUFTRAGE_ID” and the second field “ROBOTER_AUFTRAG_ID”. I want to read the data using Spring …
Is there a way that i can highlight or colour various table rows based on data entered in textfield?
What i’m trying to do it’s highlight the serial number that i scan from a box of items. So when i scan the S/N. My idea is that the table, which contains the items in the box, change their color. My …