오라클 could not extract ResultSet

Yunny.Log ·2022년 3월 22일
0

Debugging

목록 보기
23/69
post-thumbnail

1.could not extract ResultSet

org.hibernate.exception.SQLGrammarException: could not extract ResultSet]


Spring Boot Basic Configuration for Oracle
Spring Boot Properties
Configuring a different datasource in Spring Boot is very simple. When you supply datasource properties in Spring Boot’s application.properties file, Spring Boot will use them to configure the datasource. To configure Spring Boot for Oracle, add the following lines to your properties file.

#Basic Spring Boot Config for Oracle

spring.datasource.url= jdbc:oracle:thin:@//spring.guru.csi0i9rgj9ws.us-east-1.rds.amazonaws.com:1521/ORCL
spring.datasource.username=system
spring.datasource.password=manager
spring.datasource.driver-class-name=oracle.jdbc.OracleDriver
#hibernate config
spring.jpa.database-platform=org.hibernate.dialect.Oracle10gDialect

Spring Boot Advanced Configuration for Oracle
Oracle is a highly advanced and highly configurable RDBMS. There is a reason Oracle is the #1 database in the enterprise. The basic example above will work for just about any JDBC data source you need to configure for use with Spring Boot. They will all have a url, user name, password, and driver class. But with Oracle, there are a number of advanced properties you may need to set. Especially if you’re using Oracle RAC.

Spring Boot will set vendor specific properties using spring.datasource.. And you absolutely can go this route. However, based on my experience, it might be time to switch to a Java based configuration. Spring Boot will create the data source from just the properties file, or will forgo the automatic data source creation if you’re doing a more traditional method in Spring to define the data source bean.

In this section, I’m going to show you how to use a Spring configuration bean to create the Oracle JDBC datasource.

Oracle Properties
In this example, I’m going to show you how to externalise the Oracle connection properties to a properties file.

In our Spring Boot application.properties file we want to set the following properties.

#Oracle connection

oracle.username=system
oracle.password=manager
oracle.url=jdbc:oracle:thin:@//spring.guru.csi0i9rgj9ws.us-east-1.rds.amazonaws.com:1521/ORCL

Next, on our Configuration class for Oracle, we want to add the following annotation:


2. 무결성 에러

ORA-00001: unique constraint (ECI2.UK_TJX3YIGQVKPOOIXVCHECMCPT3) violated

https://itprogramming119.tistory.com/entry/Oracle-Error-ORA-00001-unique-constraint-violated

  • 중복된 키값의 데이터를 자꾸 생성해서 나는 에러였음, 따라서 데이터 한번 갈아주면 됩니다.

0개의 댓글