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
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> |
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
datasources: | |
default: | |
ocid: <YOUR_COMPARTMENT_OCID> | |
walletPassword: <YOUR_WALLET_PASSWORD> | |
username: <YOUR_DB_ADMIN_USERNAME> | |
password: <YOUR_WALLET_PASSWORD> | |
oci: | |
config: | |
profile: DEFAULT |
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
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; | |
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
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 |
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
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; |
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
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); | |
} | |
} |
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
/* | |
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. |
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
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 { |
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
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; |
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
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; |