Skip to content
Advertisement

Tag: jdbc

How to return deleted rows using jdbi?

How do I return the deleted rows using jdbi? For example, I’d like to do something like this: Answer Postgresql has a returning keyword… https://dbfiddle.uk/?rdbms=postgres_13&fiddle=25d284309745e40c8ea29945481d1aa2 You can then execute that query in the same way as you would a normal SELECT statement, and get a result set back; containing the records deleted.

MySQL Java prepared statement Syntax error

I need to select rows from mysql table based on various criteria, for example Colour= Black, or size= L. The code works without the preparedstatement and the question marks, but whenever I attempt to use the question marks the code does not run. I have read something about typing the question mark like ‘?’// but I am not sure about

Is that possible that access to a sql table with question mark?

I have 3 sql tables customer, employee and manager. I want to access dynamically to my tables. I had a statement like this, But in this situation i can only access to customer. I need to access all of the tables for different operations. Is that possible to write this, or what can i do to access for example employee

can I place a sql query in a sql hana place holder

can I place a sql query in a sql hana place holder? the following query works: I am trying to pass something like the following: Currently getting a syntex error Answer As error says you, expressions are not supported for column view parameter: Can’t use column expression as column view parameter. However, there are options to calculate it: If your

Creating JDBC Application

I have this piece of code: but I have this error: Answer Since you commented out your print statement, your loop is now closing the connection (and all of its dependent resources). Your code, without the commented out line:

Why should we always close a connection to a database?

I was asked this question in an interview. Why is it important to close a database connection? Is it just good practice because it might be wasting resources or there is something more to it? Answer You already mentioned first reason: resource leaks. This would mean that the usage of memory, sockets and file descriptors on your system is constantly

Efficient way to ignore whitespace in DB2?

I am running queries in a large IBM DB2 database table (let’s call it T) and have found that the cells for column Identifier tend to be padded not just on the margins, but in between as well, as in: ‘ ID1 ID2 ‘. I do not have rights to update this DB, nor would I, given a number of

Advertisement