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
JdbcDataSourceMetrics.monitor(meterRegistry, dataSource, "myDataSource"); |
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
what's the best setting for basicdatasource in production environment | |
ChatGPT | |
When configuring BasicDataSource (from Apache Commons DBCP) for a production environment, it's crucial to focus on settings that ensure stability, performance, and efficient resource utilization. Here are some recommended configurations: | |
Essential Configuration Parameters | |
Driver Class Name and Connection URL | |
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
spring: | |
datasource: | |
url: jdbc:mysql://localhost:3306/your_database | |
username: your_username | |
password: your_password | |
driver-class-name: com.mysql.cj.jdbc.Driver | |
type: org.apache.commons.dbcp2.PoolingDataSource | |
dbcp2: | |
initial-size: 5 | |
max-total: 10 |
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
public static DataSource createFlexyPoolDataSource() { | |
BasicDataSource basicDataSource = (BasicDataSource) DataSourceConfig.getDataSource(); | |
Configuration<BasicDataSource> configuration = new Configuration.Builder<>( | |
"myFlexyPool", basicDataSource, BasicDataSourcePoolAdapter.FACTORY | |
).build(); | |
return new FlexyPoolDataSource<>(configuration); | |
} |
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
import org.junit.Before; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import org.mockito.InjectMocks; | |
import org.mockito.Mock; | |
import org.mockito.junit.MockitoJUnitRunner; | |
import org.springframework.expression.spel.support.StandardEvaluationContext; | |
import org.springframework.security.access.expression.method.MethodSecurityExpressionHandler; | |
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; | |
import org.springframework.security.core.Authentication; |
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
interviewing.io - Discount code ($100 off)- https://iio.sh/r/EQCv | |
Get $100 off at interviewing.io - https://iio.sh/r/EQCv | |
#FAANG | |
#MockInterview | |
#META | |
#Microsoft |
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
https://app.codecrafters.io/r/calm-serval-779938 |
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
# Created by https://www.toptal.com/developers/gitignore/api/angular,node,intellij,java,maven | |
# Edit at https://www.toptal.com/developers/gitignore?templates=angular,node,intellij,java,maven | |
### Angular ### | |
## Angular ## | |
# compiled output | |
dist/ | |
tmp/ | |
app/**/*.js | |
app/**/*.js.map |
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
User | |
Convert legacy Hibernate Criteria to Spring Boot JPA | |
ChatGPT | |
Hibernate Criteria is a way of building dynamic queries in Hibernate using Java code. JPA (Java Persistence API) is a specification that defines a set of Java interfaces for accessing relational databases. Spring Boot provides a JPA implementation, which makes it easier to work with relational databases in a Spring Boot application. | |
Here's an example of how to convert a Hibernate Criteria query to Spring Boot JPA: | |
Hibernate Criteria query: | |
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
codecrafters.io | |
https://app.codecrafters.io/join?via=sachin-handiekar |
NewerOlder