Skip to content

Instantly share code, notes, and snippets.

View gist:55a517b0a37c4d85cf17d0e09aa767e7
max_connections = 100
max_prepared_transactions = 100 # defaultでコメントアウトされている
View gist:becca38f282e74ea0a959e5b4f119b60
Caused by: org.postgresql.util.PSQLException: ERROR: トランザクションの準備は無効にされているためできません。
ヒント: max_prepared_transactionsを非ゼロに設定してください。
View gist:ef2b4bf4b0fd5268129502a7fbc1c621
compile group: 'org.springframework.boot', name: 'spring-boot-starter-jta-bitronix', version: '2.2.4.RELEASE'
View gist:3543ff8bffe5f3e7cda50128a6fdefc0
const moment = require('moment-timezone');
exports.handler = async (event) => {
const dateTimeJst = moment().tz('Asia/Tokyo').format();
console.log(dateTimeJst);// JST
};
View gist:81cd5abbd0883bf7d2d2fc67d6f921d3
package com.example.demo.config;
import java.util.Properties;
import javax.sql.DataSource;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Qualifier;
View gist:85ad0b30997fb280ee3cdd4ac4b10d76
// この3行が必要
Properties props = new Properties();
props.setProperty("dbschema", "schemaname");
sqlSessionFactory.setConfigurationProperties(props);
View gist:542fa82c821708b2d11da4b1cbd152f2
@Select(value="select * from ${dbschema}.Employees ")
public Employees findByEmployee();
View gist:95ca4c8f80d67bbb1682be8a8768848a
package jp.co.confrage.config;
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder;
import org.springframework.context.annotation.Bean;
View gist:ce99e80f2771e9792bd24843baea4055
package jp.co.confrage.config;
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder;
import org.springframework.context.annotation.Bean;
You can’t perform that action at this time.