Skip to content
Advertisement

Tag: jdbc

Error while querying tables using hibernate

I am trying to query a table called student in MySQL. This is the structure: Here is the java code which I use to query: This is the error message: Here is the image of the referenced libraries: Insertion into table is working correctly. Only querying isn’t. What is the error here? Please comment if extra information is needed. UPDATE:

Can’t automatically obtain ID for a record in database

My entity is: Method to write a record to the database. I just want to send it to the database and automatically obtain an ID for every record in this table, but every time when I do this – “status”: 500, “error”: “Internal Server Error”. And nothing changing in table. My table is: Why it doesn’t work so? Answer You

Result set is empty but query works in Postgres

I’m trying to get some results from Postgres into my Java application. As of now, I always used PreparedStatements with ResultSets to get data from my database in memory. But today my code refuses to work, although I use the same code as usual. Here is my piece of code: Here is the log: The ArrayList explicitCollectionsIds is empty/not filled

Compiling a function or procedure using JDBC removes all records from all_statements view

After I execute/compile a stored procedure/function, I query the all_statements view to extract the statements that were in the stored procedure/function like below: However, one of my applications run the following code: Whenever this code is run, the all_statements view is cleared. Even if I execute this same function like below: There are no new entries in all_statements showing the

Java Melody does not show any sql data on xampp tomcat8

On Xampp Tomcat on Windows 11, I am trying to monitor java-web-app with java melody. However, sql data is not detected by java melody. Could you figure out what i am missing? I have created a library project, not to do same settings on every app Here is the projects code… pom.xml: TGS_ProfileServletUtils.java: TS_ProfileMelodyUtils.java: a helper class On another api,

Why can’t a bind variable be used from ojdbc with Oracle JSON_ARRAY() in the presence of FORMAT JSON

In Oracle, the following query: Produces the following JSON document: When I try to run this query with bind variables from JDBC like this: Then I’m getting: I’m using these versions: Database: Oracle Database 21c Express Edition Release 21.0.0.0.0 – Production ojdbc: com.oracle.database.jdbc:ojdbc11:21.5.0.0 Is this a bug? Can it be worked around? Answer In my opinion, it’s a bug in

List of Java Connection (JDBC) non-db specific properties?

Where can I find a good (maybe official) source (list) of non-db specific properties (keys)? Answer See the DriverManager.getConnection(String url, Properties info) Javadoc: info – a list of arbitrary string tag/value pairs as connection arguments; normally at least a “user” and “password” property should be included Other than that, neither the Java API documentation nor the JDBC 4.3 Specification make

Advertisement