Sponsored Content
Full Discussion: Unix to Sql Server via JDBC
Top Forums Shell Programming and Scripting Unix to Sql Server via JDBC Post 302168493 by cqldba on Monday 18th of February 2008 02:24:05 PM
Old 02-18-2008
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:

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

I tried:

Code:
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
thanks
sam
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Installing Ms Sql Server 2000 On Unix

Hello As per requirements, can i Install a MSSQL SERVER on UNIX , is it possible., can i install or not.., could u plz give me reply with some installation details.......... Regards&Thanking You sreedhar G (1 Reply)
Discussion started by: sreedhargunda
1 Replies

2. UNIX for Dummies Questions & Answers

MS SQL Server on UNIX

Hi GURUs, I have following queries: 1) If its possible to configure Microsoft SQL Server database on a UNIX machine, if yes, can any body pls point me to the guide to acheive the same. 2) I know Oracle runs perfectly on UNIX based machines, can any body point me to the guide to achieve the... (6 Replies)
Discussion started by: patras
6 Replies

3. Shell Programming and Scripting

From Solaris UNIX to MS SQL Server

Hello, my problem is, that I want to send an SQL-Statement via ksh-Shell to an MS-SQL-Database based on SQL Server 2005. I want to receive a file, which can be used for further actions on UNIX (Sun OS 5.9). ODBCUnix and JDBC and FreeTDS are not allowed. Does anybody have a suggestion? Br,... (0 Replies)
Discussion started by: usagi67
0 Replies

4. Programming

JDBC code to pass the SQL query as parameter and execute?

Below i have the sample code. i need to pass the entire query from file or as parameter and read the results and write into a output file. here the number of columns are unknown. some times it may be 2,3 or entire columns from the table. read all the column results and write into a comma... (0 Replies)
Discussion started by: laknar
0 Replies

5. Shell Programming and Scripting

Unix with sql Server 2005

Hello All I am getting a problem.What i want to do is to connect unix(korn shell) and sql server 2005. But it is not happening. The task is to schedule a job using crown or something else that connect with sql server 2005 and run the query and save the result in a text file. (5 Replies)
Discussion started by: parthmittal2007
5 Replies

6. Emergency UNIX and Linux Support

How to connect Unix and Sql Server 2005?

Hi All Can any one please help me about How to connect Unix with Sql Server 2005 I want to do it urgently and i didn't find the way. (14 Replies)
Discussion started by: parthmittal2007
14 Replies

7. Shell Programming and Scripting

Unix and SQL server

Hi All, I am accessing Unix through putty (i.e. unix is installed on other server and i am accessing it remotely through putty). I am having SQL Server 2008 installed on my computer. Now i want to access sql server via. unix. Could some one please help me in this!!! Thanks (2 Replies)
Discussion started by: preetpalkapoor
2 Replies

8. Shell Programming and Scripting

Invoking sql server from UNIX

I would like to invoke a procedure in SQL server which will return some results of a select query from UNIX script. I would like to invoke this procedure and load the data into a flat file in UNIX. Can you please help? I am not able to find any sample programs in Internet. (1 Reply)
Discussion started by: madhu.sushmitha
1 Replies

9. IP Networking

Connection to DB from client server through jdbc:Oracle:Oci8 fail

We tried to use to connect to DB using jdbc:Oracle:Oci8:@<SERVICE-A>. Connection fail / refuse with one DB .But its working with other databases. But through toad, jdbc thin client were able to connect. But this has happen suddenly and were able to connect previously. How to navigate this... (0 Replies)
Discussion started by: udara
0 Replies
asadmin-get(1AS)						   User Commands						  asadmin-get(1AS)

NAME
asadmin-get, get - gets the values of the monitorable or configurable attributes SYNOPSIS
get --user admin_user [--password admin_password] [--host localhost] [--port 4848] [--secure|-s] [--passwordfile filename] [--terse=false] [--echo=false] [--interactive=true] [--monitor=false] dotted_attribute_name Gets the values of attributes. If the --monitor option is set to true, the monitorable attributes are returned. If the --monitor option is set to false, the configurable attribute values are returned. On Solaris, quotes are needed when executing commands with * as the option value or operand. OPTIONS
--user authorized domain application server administrative username. --password password to administer the domain application server. --host machine name where the domain application server is running. --port port number of the domain application server listening for administration requests. --secure if true, uses SSL/TLS to communicate with the domain application server. --passwordfile file containing the domain application server password. --terse indicates that any output data must be very concise, typically avoiding human-friendly sentences and favoring well- formatted data for consumption by a script. Default is false. --echo setting to true will echo the command line statement on the standard output. Default is false. --interactive if set to true (default), only the required password options are prompted. --monitor defaults to false; if set to false, the configurable attribute values are returned. If set to true, the monitorable attribute values are returned. OPERANDS
attributename attribute name in the dotted notation. Example 1: Using get asadmin> get --user admin --password adminadmin --host localhost --port 4848 "server.resources.jdbc-resource.jdbc/PointBase.*" server.resources.jdbc-resource.jdbc/PointBase.description=<null> server.resources.jdbc-resource.jdbc/PointBase.enabled=true server.resources.jdbc-resource.jdbc/PointBase.jndi-name=jdbc/PointBase server.resources.jdbc-resource.jdbc/PointBase.object-type=user server.resources.jdbc-resource.jdbc/PointBase.pool-name=PointBasePool EXIT STATUS
0 command executed successfully 1 error in executing the command asadmin-set(1AS), asadmin-list(1AS) J2EE 1.4 SDK March 2004 asadmin-get(1AS)
All times are GMT -4. The time now is 01:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy