-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
增加StatementConfiguration,支持对Statement进行额外的配置。
- Loading branch information
1 parent
a87d524
commit 4babae6
Showing
2 changed files
with
65 additions
and
5 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
jdbc/src/main/java/com/github/fantasy0v0/swift/jdbc/StatementConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.github.fantasy0v0.swift.jdbc; | ||
|
||
public record StatementConfiguration(Integer queryTimeout, | ||
Integer maxFieldSize, | ||
Integer maxRows) { | ||
|
||
public static class Builder { | ||
private Integer queryTimeout; | ||
private Integer maxFieldSize; | ||
private Integer maxRows; | ||
|
||
public Builder() { | ||
} | ||
|
||
public Builder queryTimeout(Integer queryTimeout) { | ||
this.queryTimeout = queryTimeout; | ||
return this; | ||
} | ||
|
||
public Builder maxFieldSize(Integer maxFieldSize) { | ||
this.maxFieldSize = maxFieldSize; | ||
return this; | ||
} | ||
|
||
public Builder maxRows(Integer maxRows) { | ||
this.maxRows = maxRows; | ||
return this; | ||
} | ||
|
||
public StatementConfiguration build() { | ||
return new StatementConfiguration(queryTimeout, maxFieldSize, maxRows); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters