• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need Suggestion ? JDBC Connection

 
ram kumar
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have two classes,

#1 . One for logging
#2 . One for reading configuration

Logging and the reading configuration are all done at the oracle.

To perform these operation at oracle, both classes need to get a connection to oracle. Right ?

Shall i create a single connection object to do this ?

'means' can Connection con = one connection for both the OPerations (loging and reading configuration)

It is in a threaded environment.

Logging and reading configuration extends thread and runs as thread.

Do i have to create seperate connections to oracle for each thing or i can use one for both ?

Its a DAO Pattern code , and its too heavy if i post right now.

Could some one give me a suggestion on this scenario !
 
Shailesh Chandra
Ranch Hand
Posts: 1082
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using any connection pooling ?


Thanks,
Shailesh
 
ram kumar
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Shailesh Chandra:
Are you using any connection pooling ?


Thanks,
Shailesh


No, am not pooling the connection.
 
Shailesh Chandra
Ranch Hand
Posts: 1082
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok,I would suggest keep separate connection for both.

I guess reading configuration is one time process.You will reuse value read in configuration. you can cache the configuration in Maps, refresh the Map on regular interval in your threads.

For logging you can use separate connection, also try to go for some connection pooling.

Thanks,
Shailesh
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic