Originally posted by Herman Scheltinga:
hi Scott,
Just a few questions:
-are you sure it's the back-end(SQL/JDBC - part) that freezes
(do you have any logging to prove this?)
-do you use any framework, connection-pooling, what server/database do you use?
-how many simulteanous users does it take to freeze your application: 2, 5, 10...
-are all your sql-queries select-statements or ...
Herman
PS I always close connections, resultsets (and statements) in my programs,
I'm curious if you had a reason not to.
Originally posted by Paul Sturrock:
What does SQL Server say is the cause of the block? Are there processes in the WAITING state?
2007-04-26 10:05:26.25 logon Login succeeded for user 'KSHRC\ch3649'. Connection: Trusted.
2007-04-26 10:05:53.89 logon Login succeeded for user 'KSHRC\sms0123'. Connection: Trusted.
Here's all I'm getting in the log entries for two freezes by both users:
2007-04-26 10:05:26.25 logon Login succeeded for user 'KSHRC\ch3649'. Connection: Trusted.
2007-04-26 10:05:53.89 logon Login succeeded for user 'KSHRC\sms0123'. Connection: Trusted.
but something in the ODBC bridge.
It's the SQL Server error log. I'm not too familiar with stored procedures, so I'm not sure how to do an sp_who. Can you give me the syntax I need to create that stored procedure?
I'm using the JDBC ODBC driver because it's my understanding that you have to have a custom driver written (by the DBMS vendor) to query the database directly with Java.
OCUP UML fundamental and ITIL foundation
Originally posted by Jan Cumps:
If you're using SQL Server 2005, verify if you have enabled TCP/IP protocol. It's not enabled by default.
Here are the instructions.
Regards, Jan
OCUP UML fundamental and ITIL foundation
Originally posted by Jan Cumps:
And when you replace khrcs2/bkupexec by ip address?
OCUP UML fundamental and ITIL foundation
OCUP UML fundamental and ITIL foundation
Originally posted by Jan Cumps:
Or (I'm still puzzled by the forward slash in your connect string. Is bkupexec by any chance the sqlserver instance name?), try this url
jdbc:jtds:sqlserver://khrcs2:1622/Mail_List;instance=bkupexec
OCUP UML fundamental and ITIL foundation
Originally posted by Jan Cumps:
We're close. Your last error is because you do not include user name and password. The driver wants to do nt security.
This person has documented the solution:
Change your connect string to:
jdbc:jtds:sqlserver://khrcs2:1622/Mail_List;instance=bkupexec;user=XXX;password=YYY
[ April 30, 2007: Message edited by: Jan Cumps ]
In order for Single Sign On to work, jTDS must be able to load the native
SPPI library (ntlmauth.dll). Place this DLL anywhere in the system path
(defined by the PATH system variable) and you're all set.
OCUP UML fundamental and ITIL foundation
Originally posted by Scott Florez:
I've decided to try jTDS before I completely rewrite my application. However, I can't figure out the URL I need to use to make this thing work. I've been trying to hours, and I've gotten a whole range of errors. Here's what I'm currently trying:
...
Originally posted by Mr. C Lamont Gilbert:
Your application is written incorrectly.
Lessons will follow...
![]()
You can rewrite it now, or rewrite it later after you add even more improper JDBC code.
[ April 30, 2007: Message edited by: Mr. C Lamont Gilbert ]
Originally posted by Mr. C Lamont Gilbert:
No, you don't have to close it immediately. You close it when your done with it. My connections typically stay open for almost the lifetime of the application. My statements though are closed much sooner. And the resultsets closed very soon.
I think the fundamental issue is dangling statements. If you just keep creating new statements the JDBC driver will eventually get stuck without the ability to create more. So you want to ensure your statements get closed.
As I said, the flaw in your code above is you do not close the resultset ever after you leave the method. There is no way you can still use the resultset after the method exits so as a minimum it should have been closed before the method exited.
OCUP UML fundamental and ITIL foundation
Originally posted by Jan Cumps:
There's also an article on MSDN on how to do pagination in SQL Server.
It's not as straightforward as in MySQL, but it works. Look for the section User-Specific Records.
For advantages and disadvantages for this approach, there is a nice overview on JavaRanch.
Regards, Jan
[ May 02, 2007: Message edited by: Jan Cumps ]
Also, this overview doesn't consider the option of copying the result set into a local data structure such as a two-dimensional array
And inside of my fortune cookie was this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|