The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Add Some Spring to Your Oracle JDBC Access iBot Oracle Updates (RSS) 0 04-06-2008 06:10 AM
Script runs fine on UNIX Server...Not through MSK Tool kit on Windows Server madhunk UNIX for Dummies Questions & Answers 5 01-31-2008 01:30 PM
MSSQL JDBC Driver Single Sign On Auth from Unix 0.1 (Default branch) iBot Software Releases - RSS News 0 01-12-2008 07:10 AM
Transfer file from local unix server to remote server indira Shell Programming and Scripting 2 05-03-2007 07:35 AM
postgresql-jdbc on Suse marina SuSE 0 09-15-2005 03:32 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 02-18-2008
cqldba cqldba is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 1
Unix to Sql Server via JDBC

I am trying to connect SQL SERVER VIA JDCB. Following is something I tried and will appreciate any help what I am doing wrong
Here’s what I did, I tried several variations, but I keep getting this error:

Exception in thread "main" java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Unable to connect. Invalid URL

I tried:

Driver d = (Driver)Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();

Connection con = DriverManager.getConnection("jdbc:microsoft:sqlserver://133.5.144.155/:1433/IE;selectMethod=cursor", "jdbc123", "test1456"); replacing ://133.5.144.155 with \\IP

my classpath is :
voyager->whseuser: echo $CLASSPATH

/apps/twhse/scripts/jen:/apps/twhse/scripts/jen/mssqlserver/lib/msutil.jar:/apps/twhse/scripts/jen/mssqlserver/lib/mssqlserver.jar:/apps/twhse/scripts/jen/mssqlserver/lib/msbase.jar
and it’s not giving me a classpath error, so I think my classpath is right.

import java.sql.*;

//import oracle.jdbc.*;
public class HelloWorldApp {

public static void main(String[] args) throws Exception {

System.out.println("Hello World!"); // Display the string.

Driver d = (Driver)Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();

Connection con = DriverManager.getConnection("jdbc:microsoft:sqlserver://133.5.144.155/:1433/IE;selectMeth

od=cursor", "jdbc123", "test456");
}
}
I have never tried this on a sqlserver before, only in oracle.
will appreciate any response at cqldba@gmail.com
thanks
sam
  #2 (permalink)  
Old 02-19-2008
Smiling Dragon's Avatar
Smiling Dragon Smiling Dragon is offline Forum Advisor  
Disorganised User
  
 

Join Date: Nov 2007
Location: New Zealand
Posts: 922
Quote:
will appreciate any response at xxx@xxx.com
Please read the rules before posting, in this particular case, rule 10
Quote:
(10) Don't post your email address and ask for an email reply. Don't send a private message with a technical question. The forums are for the benefit of all, so all Q&A should take place in the forums.
The exact format of the URL will depend on what you are using to connect but the format I know for talking to SQL server instances is:
jdbc:<client>:mssqlserver4:<instancename>@<ip/dns>:<port>
Munging the data in your supplied URL would produce:
jdbc:microsoft:sqlserver:IE@133.5.144.155:1433

You'd probably do better looking at your client config manual for the exact config file syntax to use.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:52 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0