| Author |
connet to sql server and run query
|
James Ajewole
Greenhorn
Joined: Apr 02, 2003
Posts: 19
|
|
This is what i want to do but i dont know how possible it is: I want to write a program to connect to an sql server database over a lan and execute a select query and have the results returned to me and displayed in a table in the java program. Any ideas? thanks james
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24057
|
|
|
Quite possible, but offtopic for this forum. Moving this post to "JDBC", the forum that deals with the Java DataBase Connectivity API, which lets you talk to databases.
|
[Jess in Action][AskingGoodQuestions]
|
 |
Jason Steele
Ranch Hand
Joined: Apr 25, 2003
Posts: 100
|
|
Use url connection string: jdbc:microsoft:sqlserver://yourServerName:1433;user=yourUser;password=yourPwd found atHOWTO: Connect to a SQL Server 2000 Named Instance with JDBC Good Luck
|
An egg is a chicken's house!
|
 |
Jason Steele
Ranch Hand
Joined: Apr 25, 2003
Posts: 100
|
|
|
Note: Port may be different!
|
 |
James Ajewole
Greenhorn
Joined: Apr 02, 2003
Posts: 19
|
|
|
how can i connect to an sql server 7 server from a java program. and what do i need to configure on the server?
|
 |
Dana Hanna
Ranch Hand
Joined: Feb 28, 2003
Posts: 227
|
|
You need to purchase a SQL Server 7 driver (MS does not provide one, and the 2000 driver does not work) or use the ODBC bridge driver (sun.jdbc.odbc.JdbcOdbcDriver) with URL jdbc dbc:<odbc name>. Note that with ODBC you need to make an ODBC entry on the machine for the database. Also note that the odbc bridge driver performs very poorly, and gives unexpected results. It's not meant for production use.
|
 |
 |
|
|
subject: connet to sql server and run query
|
|
|