Simplify JDBC classes and interfaces

Aperta
#767 7 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
18/100
Tipo di issue
Refactoring
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
databases, java, postgresql, sqlite
Ambito
backend, database

Direzione di ricerca

Start by reading the JDBC class hierarchy in org.sqlite.core, org.sqlite.jdbc3, and org.sqlite.jdbc4, including the Statement and PreparedStatement examples named in the issue. Then trace dependencies from core into jdbc4 and review the history of Java and JDBC support. The issue asks for architectural direction on consolidating packages and deciding where other org.sqlite classes belong; it does not define a specific completion criterion.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

review wanted

While looking at #735 i noticed that we have similar classes in org.sqlite.core, org.sqlite.jdbc3 and org.sqlite.jdbc4.

For example for Statement:

  • abstract class CoreStatement
  • abstract class JDBC3Statement extends CoreStatement
  • class JDBC4Statement extends JDBC3Statement implements Statement

And for PreparedStatement:

  • abstract class CorePreparedStatement extends JDBC4Statement
  • abstract class JDBC3PreparedStatement extends CorePreparedStatement
  • class JDBC4PreparedStatement extends JDBC3PreparedStatement implements PreparedStatement, ParameterMetaData

That seems like a mess to me:

  • JDBC3Statement implements some methods from Statement while it doesn't implement the interface
  • CorePreparedStatement in core package depends on jdbc4 package

I'm not sure what's the intended use of the core package, as it would always have dependencies on java.sql anyway.

There are also some classes within org.sqlite like SQLiteConnection or SQLiteDataSource.

I suppose there's some history behind that:

  • JDBC 4 was introduced in version 3.8.2 along with Java 6
  • moved to Java 8 in version 3.32.3.3

While i am no expert in JDBC, it seems JDBC 4.2 shipped with Java 8.

Given we only support Java 8, we could probably remove the JDBC3 package, and have a single JDBC4 package instead.

I'm not sure what to do with the core package or the classes that are in org.sqlite to be honest.

If anyone wants to chime in, I would be interested to hear your thoughts.

Lingua principale
Java
Stelle
3.3k
Fork
676
Merge medio
1g 15h
PR unite (30g)
18

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di xerial/sqlite-jdbc

Tutte le issue di xerial/sqlite-jdbc

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.