You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by loredana loredana <lo...@yahoo.com> on 2007/10/01 10:16:41 UTC

tomcat and jdbc connector

Hi, I have a small jsp file that test a connection to an sql server 2000 database using ms jdbc drivers. the file is pretty basic:


    DriverManager.registerDriver(new com.microsoft.jdbc.sqlserver.SQLServerDriver());
    Connection connection = DriverManager.getConnection("jdbc:microsoft:sqlserver://12.345.67.890\\InstanceName:1433;databaseName=DbName;selectMethod=cursor;","user","pass");
    if (connection != null) {

      out.println("Successfully connected");

this jsp file works ok on my computer where I have tomcat 6 installed. I tried the same project with this jsp to a different computer on the same network that has Tomcat 6 as well(only that computer runs on Ubuntu, mine on win xp). And on that computer I get 

"javax.servlet.ServletException: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]The requested instance is either invalid or not running."

I posted this message here because a lot of people told me that since both computers have access to the db(they are on the same network, I tried pinging etc) and the project is the same, it is most probably from Tomcat(maybe some configuration files different?).

My tomcat is freshly installed and haven't made any modification to the configuration files or anything. What could be different on the other Tomcat instalation that could generate the error?
Anybody had this kind of problem before? 10x in advance







      ____________________________________________________________________________________
Fussy? Opinionated? Impossible to please? Perfect.  Join Yahoo!'s user panel and lay it on us. http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: tomcat and jdbc connector

Posted by David Smith <dn...@cornell.edu>.
I doubt this is tomcat's fault in any way given the code snippet is pure 
java and doesn't access the api except for the success message.  Can you 
verify the Ubuntu machine really has access to the MS SQL server (no 
firewall on either system)?  Also I'm guessing you also verified the 
version of Java on that system is really Sun's JVM and not some variant 
like GNU Java or Kava.

--David

loredana loredana wrote:
> Hi, I have a small jsp file that test a connection to an sql server 2000 database using ms jdbc drivers. the file is pretty basic:
>
>
>     DriverManager.registerDriver(new com.microsoft.jdbc.sqlserver.SQLServerDriver());
>     Connection connection = DriverManager.getConnection("jdbc:microsoft:sqlserver://12.345.67.890\\InstanceName:1433;databaseName=DbName;selectMethod=cursor;","user","pass");
>     if (connection != null) {
>
>       out.println("Successfully connected");
>
> this jsp file works ok on my computer where I have tomcat 6 installed. I tried the same project with this jsp to a different computer on the same network that has Tomcat 6 as well(only that computer runs on Ubuntu, mine on win xp). And on that computer I get 
>
> "javax.servlet.ServletException: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]The requested instance is either invalid or not running."
>
> I posted this message here because a lot of people told me that since both computers have access to the db(they are on the same network, I tried pinging etc) and the project is the same, it is most probably from Tomcat(maybe some configuration files different?).
>
> My tomcat is freshly installed and haven't made any modification to the configuration files or anything. What could be different on the other Tomcat instalation that could generate the error?
> Anybody had this kind of problem before? 10x in advance
>
>
>
>
>
>
>
>       ____________________________________________________________________________________
> Fussy? Opinionated? Impossible to please? Perfect.  Join Yahoo!'s user panel and lay it on us. http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 
>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>   


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: tomcat and jdbc connector

Posted by Ognjen Blagojevic <og...@etf.bg.ac.yu>.
Hi,

loredana loredana wrote:
> "javax.servlet.ServletException: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]The requested instance is either invalid or not running."

Can you try to do the same outside Tomcat, in a main method of a test 
Java class? It doesn't look like a Tomcat issue.

Regards,
Ognjen

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org