I have just updated my Eclipse to Version: 2024-09 (4.33.0) and now I am getting the error "java.sql.Blob cannot be resolved to a type" on the line "java.sql.Blob imageBlob = result.getBlob(1);". In fact all instances of "java.sql.Blob" are now in error. The code is:
Normally when I do a web search for Javadocs what comes back applies to some long-ago Java version.
So I tracked down the Java 21 docs specifically. And Blob is alive and well. Blob is an interface, not an instantiable class, though. I don't think that matters for your sample code.
So chances are that you haven't got Eclipse set up properly. Note that the JVM version setup for a project doesn't have to be the same as the one used by Eclipse itself, though.
Education won't help those who are proudly and willfully ignorant. They'll literally rather die before changing.
I don't have access to my copy of Eclipse right now, but "Java SE21 (jdk22.0.1)" looks weird to me. Java 21 or 22 or some weird mashup? Look at where that comes from.
Paul Clapham wrote:I don't have access to my copy of Eclipse right now, but "Java SE21 (jdk22.0.1)" looks weird to me. Java 21 or 22 or some weird mashup? Look at where that comes from.
I think it's JDK 22 running at compatability level 21. ?
Education won't help those who are proudly and willfully ignorant. They'll literally rather die before changing.
Thank you everyone for your help. As suspected by you it was an Eclipse bug. When I just started up Eclipse, ready to re-connect the JRE, there was only one error message instead of the many tens of error messages (one for each use of Blob) yesterday. Strangely this was an error in relation to the "import java.sql.Blob"; however, it was against the first line ("package server;"). This then disappeared before I could get a screen grab to prove it! I did a clean of the project and the error(s) did not reappear. So, all is good for now.
Once again, thank you for your help.
Kind regards,
Glyn
Capture.PNG
She's brilliant. She can see what can be and is not limited to what is. And she knows this tiny ad:
Gift giving made easy with the permaculture playing cards