Reputation: 61
I'm new to Spring Boot. I've stucked in the problem of creating new data (POST) for a whole day. The error shows that I did not connect successfully to the db (ORA-00942).
Due to some privacy issues, I cannot copy-paste my work through my device. Therefore, I'm going to try my best to describe my logic and type out part of my codes. Any ideas would be a huge help! Thanks a million!
@Autowired private ExRepository exRepository; @Overrride public TitleOfMyDb createExampleMethod(String a, String b){ TitleOfMyDb titleOfMyDb = new TitleOfMyDb(); titleOfMyDb .setA(a); titleOfMyDb .setB(b); return exRepository.save(titleOfMyDb) //save method is originated from Repository instinctively.
@Autowired private ExService exService; @GetMapping("/test") public TitleOfMyDb createSomething (@RequestParam(value="aa") String a, @RequestParam(value="bb") String b){ TitleOfMyDb object = exService.createExampleMethod(a, b) return object; }
Afterwards, when I try to run my spring boot, it shows error of ORA-00942. Also, when I type http://localhost:8080/test through my browser, I can only see nothing but error. The error message was quite complex, sorry that I really cannot copy-paste it through my device. Basically, it does not connect to my db properly. Any help or guide on my logic and thinking process is really appreciated. Thank you!!!
Upvotes: 0
Views: 309
Reputation: 1
Error mean you don't have permision or your table incorrect. Please check entity. Make sure table : TitleOfMyDb exist in database. If you don't specific table with anotation @table hibernate automatic pick your name entity TitleOfMyDb
Upvotes: 0
Reputation: 270
"You tried to execute a SQL statement that references a table or view that either does not exist, that you do not have access to, or that belongs to another schema and you didn't reference the table by the schema name."
I'd see if the database table is correct and double check the SQL query.
Ref: https://www.techonthenet.com/oracle/errors/ora00942.php
Upvotes: 0