meruva surendra

Ranch Hand
+ Follow
since Jul 28, 2013
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
6
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by meruva surendra

Hi JavaLovers,

I am trying to display customized error message in the response in spring boot rest . But it's not showing message in the response and handleAllException method is also  not being called at all. Can you please some help me.

Thank in Advance

ProductController.java

@RestController
public class ProductController {

   @RequestMapping(value = "/say/{hello}",method = RequestMethod.GET)
   public void sayHello(@PathVariable String hello) throws ProductNotFoundException {
       if(hello.contains("a")){
           throw new ProductNotFoundException();
       }else{
           System.out.println("Hello..."+hello);
       }
   }
}

ProductExceptionHandler.java

@ControllerAdvice
public class ProductExceptionHandler {

    @ExceptionHandler({ProductNotFoundException.class})
   public ResponseEntity<Object> handleAllExceptions(ProductNotFoundException ex)  {
    return new ResponseEntity<>("Hello Exception", HttpStatus.NOT_FOUND);
   }
}

ProductNotFoundException.java

@ResponseStatus(HttpStatus.NOT_FOUND)
public class ProductNotFoundException extends Exception{
   private static final long serialVersionUID = 1L;

   public ProductNotFoundException() {

   }
}
2 months ago

Tim Holloway wrote:Since you're annoying Oracle itself, I think we need to see your connection URL. Your classpaths and network definitions are probably OK, or you'd never have been able to contact the Oracle server.




Note:Security purpose i modified the password and hostname
Connection Properties:

gibItg.jdbc.url=jdbc:oracle:thin:@(DESCRIPTION=(SDU=32768)(enable=broken)(LOAD_BALANCE=yes)(ADDRESS=(PROTOCOL=TCP)(HOST=zc4t01234.itcs.houston.nynetwork.net)(PORT=1525))(CONNECT_DATA =(SERVICE_NAME = ABCDI)))
gibItg.jdbc.user=log4j
gibItg.jdbc.password=f5NCYRqKd7HKv9KIavABCDEF==
gibItg.jdbc.maxStatements=250
gibItg.jdbc.maxPoolSize=5
gibItg.jdbc.minPoolSize=1
gibItg.jdbc.initialPoolSize=2
gibItg.jdbc.schema=STAGING
gibItg.jdbc.loginTimeout=7200
gibItg.jdbc.sid=ABCDI
2 years ago

German Gonzalez-Morris wrote:Are you using 12.2  JDBC drivers ?

Check if you are using the same jar files in both situations.



Yes.. I am using 12.2 jdbc drivers, In both server and local i am using the same ojdbc8.jar file.
2 years ago
Hi All,

Thanks in advance!!!

I am facing database connectivity problem, can you please help me!!

Description:

I was connecting to oracle database server using db connection required properties . It is connecting to db server in local. Next I created ExecutableJar using ant build tool and ran that jar in Linux redhat server using command java -jar myjar.jar , then i am getting below error while connecting to db server.

Note: From local its connecting and from server its not connecting. Oracle TNS properties are same in both local and server.


org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (ORA-28040: No matching authentication protocol
)
       at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1225)
       at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
       at com.hp.gib.dao.CiTMonImpl.loadLogFileRecord(CiTMonImpl.java:32)
       at com.hp.gib.monitor.CiTitgMonitor.checkAppLog(CiTitgMonitor.java:20)
       at com.hp.gib.monitor.CiTMonitor.checkDbLog(CiTMonitor.java:108)
       at com.hp.gib.monitor.CiTMonitor.monCit(CiTMonitor.java:79)
       at com.hp.gib.monitor.CiTMonitor.executeInternal(CiTMonitor.java:69)
       at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
       at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
       at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
Caused by: java.sql.SQLException: ORA-28040: No matching authentication protocol

       at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:494)
       at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:441)
       at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:436)
       at oracle.jdbc.driver.T4CTTIoauthenticate.processError(T4CTTIoauthenticate.java:546)
2 years ago

O Shea wrote:The query which you have written is correct which is an inner join and the output is also correct.
What is happening here is that for every row in table 1 is checking with every row in table 2.
You have given condition that a.id=b.id as well as a,name=b.name so what is happening is that every row's (id+name) of 1st table is comparing with every row's (id+name) of 2nd table.
See-> First you have id 1 and XXX of table 1(see 1st row) is matching with id 1 and XXX of table 2(see 1st row) hence it gets printed on the console.
         Next you have id 2 and YYY of table 1(see row 2) is matching with id 2 and YYY of table 2(see 2nd row) hence it gets printed on the console.
         Next you have  id 3 and ZZZ of table 1(see row 3) is matching with id 3 and ZZZ of table 3(see row 3 as well as row 4) hence you got it printed 2 times.
         Next again you have  id 3 and ZZZ of table 1(see row 4) is matching with id 3 and ZZZ of table 3(see row 3 as well as row 4) hence you got it printed 2 times again.

Hope it would help.



yeah. Thank you. Is there any way to get my expected result.

Dave Tolls wrote:There ought to be a defined relationship.
For example, if these are 1-to-1 mapped tables (ie the ID is the same) then just join on the ID.

But, as an exercise, that query looks correct and I'm not sure why you would end up with such an odd result.
What database are you using?



I am using oracle database.

But i want 4 rows of data...but i am getting 6 rows of data. Is there any way to get 4 rows of data.??

meruva surendra wrote:Thanks for Prompt reply.

Actually I tried to get common data of both tables.

I used below query

"SELECT * FROM TEST_TABLE1 A, TEST_TABLE2 B WHERE A.ID=B.ID AND A.NAME=B.NAME";

Thanks for Prompt reply.

Actually I tried to get common data of both tables.

I used below query

"SELECT * FROM TEST_TABLE1 A, TEST_TABLE2 B WHERE A.ID=B.ID AND A.NAME=B.NAME";
Hi ,

I have some issue with SQL joins. Can anyone please suggest which join will give my expected result.

Tables structures and expected results images are attached.

Advanced Thanks,
Surendra Meruva
Hi Mark,

Can you please tell me, how much time its taken for processing 1 million records.

Because I am going to propose this framework to our project.

Waiting for your valuable reply.

Advance Thanks,
Surendra
3 years ago
Hi All

I have 1 million of records in text file, i want to insert the data into Oracle DB.

So  if i use spring batch framework how much time it will take to insert data. Any one have any idea on this.

advanced Thanks,
surendra
3 years ago
Its solved. Because of space, it is causing the issue.

Actually my property is like below "hibernate.dialect=org.hibernate.dialect.Oracle10gDialect " . In the end there is space so it throws the exception.

As per My understanding i mentioning the other scenarios also when this exception occurred:

1. If hibernate.jar is not under the WEB-INF/lib folder.

2. mentioned dialect class might not be existed in the hibernate.jar file, so check the jar file whether class existed or not.

3. While giving property not contaning the exact fully defined dialect class or  property containing the spaces in the end

4. In case of Oracle database , If you not choose the proper dialect class for the appropriate oracle version.



Thanks
3 years ago
It is already in web- INF/lib folder only.
3 years ago
Hi JavaLovers,

Below error i am getting while reading properties from hibernate propeerties file. Even I checked the hibernate3.jar file also it contained the this class. But still its thrwoing the same error. Can anyone please help me.

Advance thanks

3 years ago
Hi All,

I am getting below error while start the jboss server. I tried in all the ways but i didnt get any solution.In Jboss sever i deployed the Oracle 10g ojdbc6.jar and i tested the connection there it was successfull. Can you please help me ?