text blocks with JDBC

I got a twitter request to show using text blocks with JDBC. Here you go:

 run(conn, """
                CREATE TABLE names (
                   id INTEGER PRIMARY KEY,
                   species_id integer REFERENCES exhibits (id),
                   name VARCHAR(255))""");

The key is what isn’t here. No sprint concatentation. No escaping. Just clear text

Leave a Reply

Your email address will not be published. Required fields are marked *