Skip to content
Advertisement

Tag: sql

Validating credentials using JDBC against PostgreSQL

So I’ve been trying to get my credentials to be validated when I log in to my server. This is the simple set of data I am trying to validate. (456789, ‘Dave123’, ‘password’, ‘Dave’, ‘Davidson’, ‘dave@dadavid’, 2), (123456, ‘John456’, ‘123456’, ‘John’, ‘Johnson’, ‘john@jojohn’, 1), (456878, ‘Kate789’, ‘abcdef’, ‘Kate’, ‘Kateson’, ‘kate@kitkat’, 1) So when it finishes validating, if the username and

Spring Find by unique properties

Given 1 relational table Doctor_ID Client_ID 2 2 2 3 2 4 3 5 4 2 4 3 And I want all the occurrences where client_id is not equals to 3, ignoring the same doctor_id. In this example, I would only get the 4th row… Doctor_ID Client_ID 3 5 How could I achieve something like that? Answer This query with

Passing a query as a query parameter in JPQL Native Query

I’m trying to pass a query as a string parameter in another JPQL native query. So the resulting query would be something like the query below that returns me a value but what I’m getting in return is only the string of :query parameter and not the result of the executed complete query. Answer Create an interface for a custom

SQL Insert query not storing upon button press

I am creating a project in which a database can be read and modified through an app. The tutorial for the insert section has lost me though. Using lowercase to begin a word causes a syntax error, fine. But, when capitalising the first letter it is accepted. The page then closes and takes you back to the main menu without

iText PDF: the document has no pages

I’m trying to do a date range based filter to export a report into a PDF; however, when I click to export the PDF, I get the following message: ExceptionConverter: java.io.IOException: The document has no pages. Here’s my PDF class’ code: And here’s the code of the PDF generation button: I believe there’s a problem with SQL and JDateChooser, since

oracle sql date errors

I need your help! I have a sql query that is executed within a jdbcTemplate like shown here : Then i just make a call : I made the same steps for a Update query and it works perfectly fine!! BUt in Insert query, it shows this error : I think i don’t need TO_TIMESTAMP or TO_DATE because jdbcTemplate makes

Why is it not updating

I’m trying to update my database where in the Book copies will be updated to 5 depending on the Book code. The Book copies I initialize in the database was 10. For now, I have a fixed value of 5 to change it. My plan is to decrement the copies by 1 if users borrowed it. But for now, I’m

JPA query to filter before, after and between optional start and end dates

I’d like to write a JPA Repository query that can findBy with two optional query parameters, startDate and endDate: startDate endDate Return null null All null endDate Before End startDate null After Start startDate endDate Between Start and End How can this be implemented concisely? For example, using a single JPA @Query method with a SQL statement that can handle

Advertisement