Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

why db is taking so long time to respond ?

 
naved momin
Ranch Hand
Posts: 692
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have coded my final year project which is a bussiness management system which process a lot of database work but my problem
suppose you want to add a new employee to the database you will fill the correct details and then you will click on submit which will submit the details into the database but the thing is after you clicked on the submit button it takes actually 10 to 11 sec to do this work and same when you retrieve the employee details from the system it again took 10 to 12 minutes to retrieve just the details

so where exactly it is taking huge time , in connecting to the database or at the time of retrieval of info from the db
can you help me so that my processing work will be as fast as possible


this was just the sample db i was checking with i have to code the full BMS db for my project
 
Daniel Doboseru
Ranch Hand
Posts: 57
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, there could be many causes for your very big delays. But first, some things must be clear to rule out obvious reasons. I suppose you don't have many entries, regarding is just an educational project, then, you use an application to consume the database, is it locally, or remote? Which DBMS you use for mantaining it? If you run the queries from within, still takes that long for the results?
 
naved momin
Ranch Hand
Posts: 692
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Daniel Doboseru wrote:Well, there could be many causes for your very big delays. But first, some things must be clear to rule out obvious reasons. I suppose you don't have many entries, regarding is just an educational project, then, you use an application to consume the database, is it locally, or remote? Which DBMS you use for mantaining it? If you run the queries from within, still takes that long for the results?


i m using ms sql server 2005 in my home pc , local ,...and in sql server the quaries run fine but in ide's the quaries are dam slow even if i go to print just
empid empname
1 naved

for this much it takes the time which i have told you in my earlier post
anything else can i provide you ?
can you tell me why it is dam slow
 
Daniel Doboseru
Ranch Hand
Posts: 57
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, if in SQL queries run fine, then the problem is definetely in the IDE. I'm not an expert at benchmarking, but basically is something la this:

Initiate connection -- (time1 - establishing connection) -- Connected; Send query -- (time2) -- Processing the query on the DB; Generating response -- (time3) -- Processing response in the IDE.

Now, from experience I can tell that time1 is likely to be the problem. Anyways, a quick check could be done by using some println() messages in the console, just after initiating the connection, then after the connection is done, then when the query is sent and of course when is received. That way you can see which one takes longer to appear, so could locate the problem.
But still, I'm betting on time1, so could you please provide more info about the driver used and the connection statement which you used?
 
naved momin
Ranch Hand
Posts: 692
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Daniel Doboseru wrote:Well, if in SQL queries run fine, then the problem is definetely in the IDE. I'm not an expert at benchmarking, but basically is something la this:

Initiate connection -- (time1 - establishing connection) -- Connected; Send query -- (time2) -- Processing the query on the DB; Generating response -- (time3) -- Processing response in the IDE.

Now, from experience I can tell that time1 is likely to be the problem. Anyways, a quick check could be done by using some println() messages in the console, just after initiating the connection, then after the connection is done, then when the query is sent and of course when is received. That way you can see which one takes longer to appear, so could locate the problem.
But still, I'm betting on time1, so could you please provide more info about the driver used and the connection statement which you used?




now please help to reduce this time to atleast 2 to 3 sec
 
Tim Moores
Bartender
Posts: 2730
36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you using an ODBC connection if you want good performance?
 
naved momin
Ranch Hand
Posts: 692
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Moores wrote:Why are you using an ODBC connection if you want good performance?

so which driver should i use for good performance ?
 
Paul Clapham
Sheriff
Pie
Posts: 20955
31
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
naved momin wrote:so which driver should i use for good performance ?


How about the one commented out in line 3 of the code you posted?
 
naved momin
Ranch Hand
Posts: 692
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:
naved momin wrote:so which driver should i use for good performance ?


How about the one commented out in line 3 of the code you posted?

getting an exception , note that i have set the path in the environment variable but still it not working can you help ?

[/code]
 
Paul Clapham
Sheriff
Pie
Posts: 20955
31
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll need to get the jar which contains the driver and make sure the jar is in your classpath.

Also make sure you don't confuse the path with the classpath.
 
naved momin
Ranch Hand
Posts: 692
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:You'll need to get the jar which contains the driver and make sure the jar is in your classpath.

Also make sure you don't confuse the path with the classpath.

ya i have to write classpath in the path name in the environment variable right ? i have done that
and i have also added jar to libraries which is called as Junit 3.8.2 - junit 3.8.2.jar , Junit 4.5 - junit 4.5.jar
 
Paul Clapham
Sheriff
Pie
Posts: 20955
31
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are several ways to set the classpath.

I don't know what's in your classpath, but if your last post was meant to contain useful information, let me just say the the JDBC driver you are trying to use will not be in any of those JUnit jars.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic