Skip to content

Open the README with an example that runs, and needs no network - #30

Closed
ShawnChen-Sirius wants to merge 2 commits into
mainfrom
docs/readme-first-example
Closed

ShawnChen-Sirius wants to merge 2 commits into
mainfrom
docs/readme-first-example

Conversation

@ShawnChen-Sirius

@ShawnChen-Sirius ShawnChen-Sirius commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Review of #29, applied before the preview is tagged — package-preview.sh puts README.md in
every bundle, so this is the copy users get.

The old first snippet had no imports, no main and no run command, and it queried
url('https://example.com/logs.jsonl') three lines below "no server, no network". It also
never said a native package has to match the platform you run on.

Now: a complete file that prints 1, the java -cp line, the four platform artifact ids, and
a link to QuickStart.java
with the command from its own javadoc. The url() example survives one paragraph down, where
it can say what it is — the engine runs in-process, the data does not have to.

Extracted from the README verbatim, compiled and run against the installed preview: prints 1.

🤖 Generated with Claude Code

Note

Replace README intro with a runnable no-network Hello JDBC example

  • Adds a complete Hello class that executes SELECT 1 and prints the integer result, with command-line compile and run instructions
  • Documents automatic driver registration and the platform-specific native package requirement
  • Adds a network-backed url query example and links the longer QuickStart with source-checkout build and run commands

Macroscope summarized 4a5744d.

The first snippet had no imports, no main, no run line, and queried a URL over the network
three lines under a sentence saying there is none. It also never said that a native package
has to match the platform, which is the one thing a first run gets wrong.

Now: a complete file that prints 1, the classpath it needs, the four platform artifact ids,
and a link to QuickStart.java for the longer version. The url() example stays, one line
further down, where it can say what it is -- the engine is in-process, the data need not be.

Extracted from the README and run before committing.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Review of #30, all three right. The jars in a bundle carry versions, so bare
chdb-jdbc.jar names nothing; `java -cp` without `.` cannot find Hello.class even when it
exists; and the class was never compiled. The QuickStart line had the same shape of
problem -- exec:java in a fresh checkout has no native package to load -- so it now carries
the full sequence from QuickStart's own javadoc.

Run verbatim against an installed preview before committing: javac, then java with the
versioned jar names, prints 1.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ShawnChen-Sirius

Copy link
Copy Markdown
Contributor Author

All three fixed, and each was real.

Finding Fix
chdb-jdbc.jar does not exist; bundles carry versioned names chdb-jdbc-<version>.jar, chdb-native-<your platform>-<version>.jar
Hello is never compiled javac Hello.java added — and . added to -cp, which would have failed next
exec:java fails in a fresh checkout with no native package replaced with the four-command sequence from QuickStart's javadoc, plus a link to Building from source

Verified by running the block verbatim against an installed preview: prints 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant