Latest Added Tutorials
Before using the script below, an empty database is created and then it scans all the tables in the other database and transfers them with their data.
Note: If you are using a custom schema, for example sm_log, you must create it first!Continue Reading
Introduction:
Soft delete is a technique used in database management to mark records as "deleted" without physically removing them from the database. This approach is particularly useful when you want to retain data for historical or audit purposes. In a Spring Boot application using Hibernate as the JPA provider, implementing soft delete functionality can greatly enhance data management. In this article, we will explore how to truly implement soft delete in Spring Boot Hibernate using the CustomInspector class.
Implementing Soft Delete with CustomIn...Continue Reading
This is the kafka 3.4 docker compose file for multiple brokers cluster with kafka connect, schema registry configurations
We should have following roles to publish GCR image:
Cloud Build Service Agent
Cloud Run Admin
Cloud Run Service Agent
Service Account User
Also, please update the cloudbuild.yaml file as follows:
steps:
# Build the container image
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/${PROJECT_ID}/spring-hello-world', '.']
# Push the container image to Container Registry
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/${PROJECT_ID}/spring-hello-world']
# Deploy container image to Cloud Run
- name:...Continue Reading
20-11-2022
docker run -d -it -e DB_URL='jdbc:sqlserver://localhost;databaseName=Demo' -e DB_USERNAME='sa' -e DB_PASSWORD='12_34_TRS_398?' -p 9090:9090 -t imageName:latest...Continue Reading
20-11-2022
FROM mcr.microsoft.com/azure-sql-edge:latest
EXPOSE 1433
ENV SA_PASSWORD "12_34_TRS_398?"
ENV SQLCMDPASSWORD "12_34_TRS_398?"
ENV ACCEPT_EULA "Y"
RUN mkdir -p /opt/mssql-tools/bin && cd /opt/mssql-tools/bin && wget https://github.com/microsoft/go-sqlcmd/releases/download/v0.8.0/sqlcmd-v0.8.0-linux-arm64.tar.bz2 \
&& bzip2 -d sqlcmd-v0.8.0-linux-arm64.tar.bz2 && tar -xvf sqlcmd-v0.8.0-linux-arm64.tar && chmod 755 sqlcmd
RUN /opt/mssql/bin/sqlservr & sleep 20 && opt/mssql-tools/bin/sqlcmd -S localhost -U sa -d master
#ADD test.bak var/test.ba...Continue Reading
version: "3.2"
services:
zookeeper:
image: bitnami/zookeeper:3
ports:
- 2181:2181
environment:
ALLOW_ANONYMOUS_LOGIN: "yes"
kafka-0:
image: bitnami/kafka:2
ports:
- 9092:9092
environment:
KAFKA_CFG_ZOOKEEPER_CONNECT: zookeeper:2181
ALLOW_PLAINTEXT_LISTENER: "yes"
KAFKA_LISTENERS: >-
INTERNAL://:29092,EXTERNAL://:9092
KAFKA_ADVERTISED_LISTENERS: >-
INTERNAL://kafka-0:29092,EXTERNAL://localhost:9092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: >-
INTERNAL:PLA...Continue Reading
HTML form
<div class="flex flex-col flex-auto min-w-0">
<div class="flex-auto p-6 sm:p-10 ">
<p-table #dt2 [value]="users" [loading]="loading" dataKey="id" [paginator]="true"
[rows]="10" [rowsPerPageOptions]="[10,25,50]" styleClass="p-datatable-gridlines"
[globalFilterFields]="filterColumns">
<ng-template pTemplate="caption">
<div class="flex">
<span class="p-input-icon-left ml-auto">
<i class="pi pi-search"></i>...Continue Reading
07-09-2022
HTML file
<div class="flex flex-col flex-auto min-w-0">
<!-- Main -->
<div class="flex-auto p-6 sm:p-10 ">
<p-table [value]="users" [lazy]="true" (onLazyLoad)="loadCarsLazy($event)" dataKey="id" [paginator]="true"
[rows]="10" [totalRecords]="totalRecords" [loading]="loading">
<ng-template pTemplate="header">
<tr>
<th *ngFor="let col of cols">
{{col.header}}
</th>
</tr>
<...Continue Reading
01-07-2022
We can integrate JWTS token for Spring REST API by using following component:
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.JwtParser;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.impl.DefaultClaims;
import io.jsonwebtoken.io.Decoders;
import io.jsonwebtoken.security.Keys;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.function.Function;
@Component
public class JwtUtils {
private static final Logger logger = LoggerFactory.getLogger(J...Continue Reading
Normally Glassfish looks at the cacerts.jks certificate file stored in the GLASSFISH_SERVER\glassfish\domains\domain1\config location.You can change this configuration or replace cacerts.jks file with your cacerts file.
There are some default JVM Options which Glassfish is used:
-XX:+UnlockDiagnosticVMOptions
-XX:NewRatio=2
-XX:MaxPermSize=192m
-Xmx512m
-client
-javaagent:C:/glassfish5/glassfish/li...Continue Reading
2022-06-15
First Step: localhost:8081 when you encounter a user login screen, run this code:
- select account_status from dba_users where username = 'ANONYMOUS'; if you encounter this error: SP2-0640: Not connected, firstly run this code: sqlplus /nolog
- alter user ANONYMOUS identified by anonymous;
- alter user ANONYMOUS account unlock;
We can use above dockerfile to build gradle project. After build process, generated war file will be moved to /usr/local/tomcat/webapps/ directory.
If you need to add a custom certificate, you should copy the new certifacete to /etc/ssl/certs directory. Otherwise, Java Keytool is not importing the custom certificate from another location. (It took me 5 hours to reach this information.)
The last commands, for loop in this case, automatically imports existing certificates into cacerts.
FROM gradle:7.3.3-jdk8 AS build
ENV TIS_DATA=/home/tis-data
#W...Continue Reading
We can use following codes to run gradle build in docker image then copy generated war file to Tomcat directory
FROM gradle:7.3.3-jdk8 AS build
COPY --chown=gradle:gradle . /home/gradle/src
WORKDIR /home/gradle/src
RUN gradle build --no-daemon
FROM tomcat:8.5.73
WORKDIR /app
RUN rm -fr /usr/local/tomcat/webapps/ROOT
COPY --from=build home/gradle/src/build/libs/ktbyigm.war /usr/local/tomcat/webapps/ROOT.war
CMD ["catalina.sh", "run"]
EXPOSE 9090...Continue Reading
26-09-2021
What is Injectable decorator?
Marks a class as available to Injector for creation.
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root',
})
export class UserService {
}
The service itself is a class that the CLI generated and that's decorated with @Injectable().
What exactly does providedIn do?
Determines which injectors will provide the injectable, by either associating it with an @NgModule or other InjectorType, or by specifying that this injectable should be provided in the 'root' injector...Continue Reading