티스토리 뷰
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
@SpringBootApplication
public class SpringBootPostgresApplication implements CommandLineRunner {
@Autowired
private DataSource dataSource;
public static void main(String[] args) {
SpringApplication.run(SpringBootPostgresApplication.class, args);
}
@Override
public void run(String... args) {
try (Connection connection = dataSource.getConnection()) {
try (Statement statement = connection.createStatement()) {
// Set statement_timeout to 30 seconds
statement.execute("SET statement_timeout TO '30s'");
// Now execute your query
statement.execute("SELECT * FROM your_table");
}
System.out.println("Successfully executed the query!");
} catch (SQLException e) {
System.err.println("Failed to execute the query: " + e.getMessage());
}
}
}
- Total
- Today
- Yesterday
- JQuery
- 프로젝트명변경
- element위치
- object key
- CSS
- PostgreSQL
- caniuse
- $.extend
- border-collapse
- spring
- DatePicker
- @ExceptionHandler
- lombok
- devtools
- $.each
- QueryDSL
- Javascript
- 전후방탐색
- Keycode
- springboot
- 정규식
- excel
- 여러 컬럼 update
- setter
- 진열사랑
- ul li로 테이블
- oracle
- getter
- sumifs
- draw.io
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |