jamell.dev

javax.sql.DataSource doesn't move to jakarta — it's a JDK API, not Java EE

2026-02-25 (7m ago)1 views

#java#spring-boot#jakarta

I was migrating a Spring Boot 2 app to Spring Boot 3 and dutifully renamed all javax.* imports to jakarta.* — including javax.sql.DataSource. That broke the build:

package jakarta.sql does not exist

It turns out the Jakarta EE namespace migration only covers APIs that Oracle handed over to the Eclipse Foundation. javax.sql is JDBC — it's part of the JDK itself, not Java EE, so it was never part of that handover and was never renamed. jakarta.sql simply doesn't exist.

The packages that did move: javax.servlet, javax.persistence, javax.validation, javax.annotation, javax.mail, javax.transaction. Anything that's been in the JDK since forever — javax.sql, javax.crypto, javax.net — stays put.

So even on Spring Boot 3 with Java 17, this is still correct:

import javax.sql.DataSource;

The dividing line I find useful: did Oracle donate the spec to Eclipse? Then it moved. Is it a JDK API? Then it didn't.

References