File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 19693
    
  20

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: 19693
    
  20

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: 19693
    
  20

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SQL Server express 2008 jdbc connection problem