Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes JDBC and the fly likes SQL Server express 2008 jdbc connection problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "SQL Server express 2008 jdbc connection problem" Watch "SQL Server express 2008 jdbc connection problem" New topic
Author

SQL Server express 2008 jdbc connection problem

Pavani Kokkiragadda
Greenhorn

Joined: Jan 19, 2011
Posts: 20
Hi,

I want to practice jdbc scenario now. For that, I installed SQL Server Express 2008 edition(freeware). I want to develop a desktop database application.
What is connection URL for SQL Server?
How to connect SQL Server to NetBeans?

Please help me!!

-nskp
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19649
    
  18

Download the JDBC 3.0 driver. Unpack it; the EXE gets unpacked by executing it. Inside, check for folder enu\help\samples\connections. There are two examples for connecting there.

Or check out their JDBC FAQ; item 11 has a link to a very useful site.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Pavani Kokkiragadda
Greenhorn

Joined: Jan 19, 2011
Posts: 20
Hi,

I am getting error while creating New Database connection to SQL Server from NetBeans.

Error:
Unable to add connection, cannot establish a connection to jdbc:microsoft:sqlserver://localhost:1433 using com.microsoft.jdbs.sqlserver.SQLServerDriver.Connection refused:connect.

I enabled TCP/IP and set dynamic port to 1433. I also checked firewall too. And My SQL Service is running.

Please suggest me!!
-nskp



Rob Spoor wrote:Download the JDBC 3.0 driver. Unpack it; the EXE gets unpacked by executing it. Inside, check for folder enu\help\samples\connections. There are two examples for connecting there.

Or check out their JDBC FAQ; item 11 has a link to a very useful site.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19649
    
  18

And the server is running on the same machine as you're running the code on?
Pavani Kokkiragadda
Greenhorn

Joined: Jan 19, 2011
Posts: 20

Hi, I solved the connection problem by making the Windows Authentication into mixed authentication.

I could create new Connection with 'sa' user.

But now the problem is, it is not showing the tables in the database while creating Desktop project.
What could be the problem?
Please suggest!!

-nskp

Rob Spoor wrote:Download the JDBC 3.0 driver. Unpack it; the EXE gets unpacked by executing it. Inside, check for folder enu\help\samples\connections. There are two examples for connecting there.

Or check out their JDBC FAQ; item 11 has a link to a very useful site.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19649
    
  18

How are you trying to retrieve the databases? DatabaseMetaData provides a uniform way to do this, with its getTables method.
Pavani Kokkiragadda
Greenhorn

Joined: Jan 19, 2011
Posts: 20
Hi,
Thank you Rob.
I found the solution myself. It was a silly mistake( did not select the right schema!!).
Now my project is perfectly working!!

-nskp

Rob Spoor wrote:How are you trying to retrieve the databases? DatabaseMetaData provides a uniform way to do this, with its getTables method.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: SQL Server express 2008 jdbc connection problem
 
Similar Threads
JDBC connection with SQL Server 2008 R2
SQL Server - netbeans Connection problem
jtds error while connecting to MS SQL server 2008
No access to SQL Express 2005/2008 database
Problem in output