Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Netbeans and SqlServer

Author  Topic 

dzina
Starting Member

4 Posts

Posted - 2005-08-03 : 10:49:01
I'm using netbeans4 and would like to connect to a sql server installed on my pc. I have download the driver from the microsoft sql server site. The driver name is : com.microsoft.jdbc.sqlserver.SQLServerDriver.

After I added the driver to netbeans I wanted to connect to the sql server. I don't know which database url I have to use. In the the Database Url field in netbeans is written: sqlserver://<HOST>:<PORT>[;DatabaseName = <DB>]. In the host fiels I put 127.0.0.1 and in port 1403 and then I try to connect and the ide is trying to connect for a long time and nothing happens. I wait and wait but after some minutes I quit. Can anybody explain what I am doing wrong?!
Thanks,
dzina

dzina
Starting Member

4 Posts

Posted - 2005-08-03 : 11:53:24
Now, I have seen that when I try to connect to sql server netbeans gives me this message: "Exception occured in Request processor". Hope this can help you to help me.... bye
Go to Top of Page

eyechart
Master Smack Fu Yak Hacker

3575 Posts

Posted - 2005-08-03 : 14:50:10
from the help file that is included with the jdbc driver install:

quote:
Connecting Through the JDBC Driver Manager

One way of connecting to a database is through the JDBC driver manager using the method DriverManager.getConnection. This method uses a string containing a URL. The following is an example of using the JDBC driver manager to connect to Microsoft SQL Server 2000 while passing the user name and password:

Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
Connection conn = DriverManager.getConnection
("jdbc:microsoft:sqlserver://server1:1433;User=test;Password=secret");

URL Examples

The complete connection URL format used with the driver manager is:

jdbc:microsoft:sqlserver://hostname:port[;property=value...]

where:

hostname

is the TCP/IP address or TCP/IP host name of the server to which you are connecting.
NOTE: Untrusted applets cannot open a socket to a machine other than the originating host.
port

is the number of the TCP/IP port.
property=value

specifies connection properties. See "Connection String Properties" for a list of connection properties and their values.

The following example shows a typical connection URL:

jdbc:microsoft:sqlserver://server1:1433;user=test;password=secret





-ec
Go to Top of Page

eyechart
Master Smack Fu Yak Hacker

3575 Posts

Posted - 2005-08-03 : 14:51:44
I suspect the problem is you are using port 1403 instead of 1433. Unless this was a typo in your initial post.




-ec
Go to Top of Page
   

- Advertisement -