Simplify JDBC classes and interfaces

Đang mở
#767 7 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
18/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
databases, java, postgresql, sqlite
Lĩnh vực
backend, database

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Java
Star
3.3k
Fork
676
Merge trung bình
1 ngày 15 giờ
Pull request đã merge (30 ngày)
18

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của xerial/sqlite-jdbc

Tất cả issue của xerial/sqlite-jdbc

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.