Skip to content

Instantly share code, notes, and snippets.

View juarezjuniorgithub's full-sized avatar

Juarez Barbosa Junior juarezjuniorgithub

View GitHub Profile
@juarezjuniorgithub
juarezjuniorgithub / application.properties
Created November 10, 2023 12:19
application.properties
micronaut.application.name=micronautguide
flyway.datasources.*.enabled=true
flyway.datasources.*.baseline-on-migrate=true
datasources.default.dialect=ORACLE
datasources.default.ocid=<YOUR_COMPARTMENT_OCID>
datasources.default.username=<YOUR_DB_ADMIN_USERNAME>
datasources.default.password=<YOUR_PASSWORD>
datasources.default.walletPassword=<YOUR_WALLET_PASSWORD>
@juarezjuniorgithub
juarezjuniorgithub / application-oraclecloud.yml
Created November 10, 2023 12:19
application-oraclecloud.yml
datasources:
default:
ocid: <YOUR_COMPARTMENT_OCID>
walletPassword: <YOUR_WALLET_PASSWORD>
username: <YOUR_DB_ADMIN_USERNAME>
password: <YOUR_WALLET_PASSWORD>
oci:
config:
profile: DEFAULT
@juarezjuniorgithub
juarezjuniorgithub / ThingRepository.java
Created November 10, 2023 11:26
ThingRepository.java
package com.oracle.dev.jdbc.micronaut.repository;
import io.micronaut.core.annotation.NonNull;
import io.micronaut.data.jdbc.annotation.JdbcRepository;
import io.micronaut.data.model.query.builder.sql.Dialect;
import io.micronaut.data.repository.CrudRepository;
import java.util.List;
import java.util.Optional;
@juarezjuniorgithub
juarezjuniorgithub / Things.java
Created November 10, 2023 11:26
Things.java
package com.oracle.dev.jdbc.micronaut.domain;
import io.micronaut.core.annotation.Creator;
import io.micronaut.data.annotation.GeneratedValue;
import io.micronaut.data.annotation.Id;
import io.micronaut.data.annotation.MappedEntity;
import io.micronaut.serde.annotation.Serdeable;
@MappedEntity
@Serdeable
@juarezjuniorgithub
juarezjuniorgithub / ThingsController.java
Created November 10, 2023 11:24
ThingsController.java
package com.oracle.dev.jdbc.micronaut.controller;
import io.micronaut.http.annotation.Controller;
import io.micronaut.http.annotation.Get;
import io.micronaut.scheduling.TaskExecutors;
import io.micronaut.scheduling.annotation.ExecuteOn;
import jakarta.validation.constraints.NotBlank;
import java.util.List;
import java.util.Optional;
@juarezjuniorgithub
juarezjuniorgithub / Application.java
Created November 10, 2023 11:24
Application.java
package com.oracle.dev.jdbc.micronaut;
import io.micronaut.runtime.Micronaut;
public class Application {
public static void main(String[] args) {
Micronaut.run(Application.class, args);
}
}
@juarezjuniorgithub
juarezjuniorgithub / JDBCStoredProcHqEmployee.java
Created September 16, 2023 18:54
JDBCStoredProcHqEmployee.java (code sample) - The new BOOLEAN data type in Oracle Database 23c with PL/SQL and the JDBC Drivers (21c, 23c) @ OracleDevs on Medium.com
/*
Copyright (c) 2022, 2023, Oracle and/or its affiliates.
This software is dual-licensed to you under the Universal Permissive License
(UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License
2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose
either license.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
package com.oracle.dev.jdbc;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import oracle.jdbc.pool.OracleDataSource;
public class QueryWithBooleanDataTypeColumn {
package com.oracle.dev.jdbc;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.concurrent.ThreadLocalRandom;
import org.eclipse.microprofile.config.inject.ConfigProperty;
import org.slf4j.Logger;
package com.oracle.dev.jdbc;
import org.eclipse.microprofile.config.inject.ConfigProperty;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import jakarta.annotation.PostConstruct;
import jakarta.annotation.PreDestroy;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.json.JsonObject;