Skip to content

Tag: java

Get max value sql in Java

*I don’t get value of max in function other. Value return is “0”. I trying but not success 🙁 Image Help!!! Answer You’re not using it as it should be. First of all, you use AVG but want MAX so change it to MAX(GiaSP). Second, you must use rs.next() to have your cursor go to the first r…

“not Implemented by SQLite JDBC driver”

I have a database with User information, and I wanted to make a public static to return the database integers at any given time without having to make a void for every single one, but it’s giving me this error: And this is my code: Does someone understand what I’m doing wrong? I tried to Google th…

Hibernate Check Annotation

I have a table with three fields, say a, b, c. I would like to add a constraint ensuring that if a is not null, then also b and c are not null. I have done that using following SQL Is there a way to achieve same effect using hibernate annotation @Check? I can’t find a helpful example with that

Reuse a parameter in a PreparedStatement?

I am passing a parameter to a PreparedStatement like this : And the query looks like this : Now I want to modify my query like this, and reuse the first parameter (both ? would use the runId parameter) : Is that possible without doing this : Answer This cannot be done with plain JDBC. You could instead use Sp…

Catch SQL RaiseError in jsp

I am developing a database and some JSP Pages to perform CRUD operations on it. I cannot catch exceptions related to my SQL Code in my JSP Code. For Example: I have this part of code where I raise an error in T-SQL: I need to call the function where I raise those errors in JSP code. Heres a part