티스토리 뷰
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
- object key
- Javascript
- sumifs
- getter
- CSS
- lombok
- 전후방탐색
- element위치
- $.each
- 프로젝트명변경
- 정규식
- PostgreSQL
- springboot
- $.extend
- devtools
- excel
- 여러 컬럼 update
- DatePicker
- caniuse
- 진열사랑
- QueryDSL
- setter
- @ExceptionHandler
- ul li로 테이블
- draw.io
- spring
- border-collapse
- Keycode
- oracle
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
29 | 30 |