• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SQL Server express 2008 jdbc connection problem

 
Pavani Kokkiragadda
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20494
54
Chrome Eclipse IDE Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Pavani Kokkiragadda
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20494
54
Chrome Eclipse IDE Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And the server is running on the same machine as you're running the code on?
 
Pavani Kokkiragadda
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Pie
Posts: 20494
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are you trying to retrieve the databases? DatabaseMetaData provides a uniform way to do this, with its getTables method.
 
Pavani Kokkiragadda
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic