• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

java.sql.Blob cannot be resolved to a type

 
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

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:

   

Kind regards,
Glyn
 
Glyndwr Bartlett
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using JavaSE-21 (jdk-22.0.1).

Java21.PNG
[Thumbnail for Java21.PNG]
 
Saloon Keeper
Posts: 28319
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 28323
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Tim Holloway
Saloon Keeper
Posts: 28319
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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. ?
 
Glyndwr Bartlett
Ranch Hand
Posts: 204
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

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
[Thumbnail for 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
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic