Access denial on connecting SQL server 2000 with Microsoft JDBC driver
Hi guys,
I am developping a BMP invoking procedures stored in a SQL server 2000 instance on the Sun RI platform. I am using the Microsoft type 4 JDBC driver.
the connection pattern is something like
jdbc:microsoft:sqlserver://ambassador:1433;User=sa;Password;DataBase=Forethought;SelectMethod=cursor
An type-like "access denied" exception is raised when trying to get the connection from the DataSource object with some code similar to :
DataSource objDS = (DataSource)objCtx.lookup("jdbc/Forethought");
Connection objConn = ds.getConnection();
I have realised a CMP to access the database and everything works fine.
It seems that the SunRI tries to get the db connection with an "impersonated " user even if i have specified the user name and password in the connection string.
Does anyone have an idea how to force the connection with SQL Server user name and password ??
I come accorss the same problem too,
my URL jdbc:microsoft:sqlserver://ambassador:1433;User=sa;Password=123;DatabaseName=pubs
and the password is right.I can establish connection to SQL server 2000 by JDBC Driver Manager,the code as follow:
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
Connection conn = DriverManager.getConnection
("jdbc:microsoft:sqlserver://localhost:1433;User=sa;Password=123");
Similar Messages
-
Cant create connection Pool for MS SQL Server 2000 with Microsoft Driver
i am using bea weblogic server 6.1, i cant create connection pool while using MS
SQL Server 2000. i have installed JDBC Driver SAP1 from microsoft website. when
i give the following class name for JDBC driver and the connection url and click
apply while selecting the available server, a number of exception appears in default
server (that is the connection pool cannot be created..... cannot load the driver
class).
URL= jdbc:Microsoft:sqlserver://127.0.0.1:1433;DatabaseName=MyDB
Driver= com.microsoft.jdbc.sqlserver.SQLServerDriver
when i use the above setting in a JDBC simple application in Jbuilder
7.0 the application runs successfully and fetches the data deom MS SQL database
but in at Bea connection Pool is not created with these settings. i do give appropriate
username and password in properties field in connection pool. Thankx for any help!khabbab wrote:
That was the original code part from "startweblogic" :
:runWebLogic
echo on
set PATH=.\bin;%PATH%
set CLASSPATH=.;.\lib\weblogic_sp.jar;.\lib\weblogic.jar;
echo off
and i changed it to :
:runWebLogic
echo on
set PATH=.\bin;%PATH%
set CLASSPATH=.;.\lib\weblogic_sp.jar;.\lib\weblogic.jar;D:\Program Files\Microsoft
SQL Server 2000 Driver for JDBC\lib\msbase.jar;D:\Program Files\Microsoft SQL
Server 2000 Driver for JDBC\lib\msutil.jar;D:\Program Files\Microsoft SQL Server
2000 Driver for JDBC\lib\mssqlserver.jar;I suggest moving or copying the three ms driver jars to a directory that has no blanks
in it so the classpath doesn't have blanks in it. Ie:
go to the "D:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib"
directory and do this:
mkdir D:\microsoft_jdbc_driver
cp *.jar D:\microsoft_jdbc_driver
Then make the classpath include D:\microsoft_jdbc_driver\msbase.jar etc.
Joe
>
>
echo off
when i save and run the bat file, server appears then disappears.
Joseph Weinstein <[email protected]_this> wrote:
khabbab wrote:
The class path which is echoed at server startup does not include thepaths to
driver jar files. when i edited the "startweblogic.bat" file and includedthe
driver class paths to jar files, now the server doesnot even run. tellme what
to do now???Show me what change you made to the startweblogic file.
Joe
Joseph Weinstein <[email protected]_this> wrote:
khabbab wrote:
kindly tell me how can i check that the class paths for driver jarfiles are included
in that string? thanks. also tell me can not i use the jdriver forsql server
2000?.The startup script will echo what it's doing, including printing out
the classpath
it will use. Yes you can use the jDriver for MS SQL2000. It is sufficient
for
basic JDBC, but the MS drivfer is preferable in some ways.
Joe
Joseph Weinstein <[email protected]_this> wrote:
khabbab wrote:
i am using bea weblogic server 6.1, i cant create connection
pool
while
using MS
SQL Server 2000. i have installed JDBC Driver SAP1 from microsoft
website.
when
i give the following class name for JDBC driver and the connectionurl and click
apply while selecting the available server, a number of exception
appears
in default
server (that is the connection pool cannot be created..... cannot
load
the driver
class).The server startup script creates a string that will become the
classpath
for the server.
This string is part of the java call to start the server with a-classpath
argument. You need to
make sure the MS driver jars are part of that classpath string.
Joe
URL= jdbc:Microsoft:sqlserver://127.0.0.1:1433;DatabaseName=MyDB
Driver= com.microsoft.jdbc.sqlserver.SQLServerDriver
when i use the above setting in a JDBC simple applicationin Jbuilder
7.0 the application runs successfully and fetches the data deom
MS
SQL database
but in at Bea connection Pool is not created with these settings.
i
do give appropriate
username and password in properties field in connection pool.
Thankx
for any help!
khabbab wrote:
The class path which is echoed at server startup does not include thepaths to
driver jar files. when i edited the "startweblogic.bat" file and includedthe
driver class paths to jar files, now the server doesnot even run. tellme what
to do now???
Joseph Weinstein <[email protected]_this> wrote:
khabbab wrote:
kindly tell me how can i check that the class paths for driver jarfiles are included
in that string? thanks. also tell me can not i use the jdriver forsql server
2000?.The startup script will echo what it's doing, including printing out
the classpath
it will use. Yes you can use the jDriver for MS SQL2000. It is sufficient
for
basic JDBC, but the MS drivfer is preferable in some ways.
Joe
Joseph Weinstein <[email protected]_this> wrote:
khabbab wrote:
i am using bea weblogic server 6.1, i cant create connection
pool
while
using MS
SQL Server 2000. i have installed JDBC Driver SAP1 from microsoft
website.
when
i give the following class name for JDBC driver and the connectionurl and click
apply while selecting the available server, a number of exception
appears
in default
server (that is the connection pool cannot be created..... cannot
load
the driver
class).The server startup script creates a string that will become the
classpath
for the server.
This string is part of the java call to start the server with a-classpath
argument. You need to
make sure the MS driver jars are part of that classpath string.
Joe
URL= jdbc:Microsoft:sqlserver://127.0.0.1:1433;DatabaseName=MyDB
Driver= com.microsoft.jdbc.sqlserver.SQLServerDriver
when i use the above setting in a JDBC simple applicationin Jbuilder
7.0 the application runs successfully and fetches the data deom
MS
SQL database
but in at Bea connection Pool is not created with these settings.
i
do give appropriate
username and password in properties field in connection pool.
Thankx
for any help! -
How to connect to SQL server 2000 with Oracle Form
Hi,
I'm looking for the document of how to connect "SQL Server 2000" with Oracle Form 6i. Anyone knows that?Shay or other knowledgeable folks,
Is there a way to utilize the wizard for "Business Tier > ADF Business Components > Business Components from Tables" for SQL Server 2000, 2005 or 2008. I can successfully execute sql via java programmatically or import a table from SQL Server with "Business Tier > ADF Business Components > Entity Object" wizard, but the Business Components from Tables simply doesn't see any tables under any schema. Without the "Business Components from Tables", i don't get the referential constraints imported into the application and to code all those from scratch is just not as elegant. So far i have only utilized the sql server jdbc driver from Microsoft (versions, 1.1, 1.2 and 2.0). Is there an alternative client that i need to use to enable selecting tables from that "Business Components from Tables" wizard. Is this a limitation of SQL Server, the jdbc driver or the wizard itself? Did anybody else experience the same issues? I am using Jdeveloper 11.1.1.0.1 against SQL Server 2005 (currently)
Thanks,
Andy -
Hi
Im wondering if anyone has connected SQL Server 2000 with the J2EE RI 1.3. If so what are the changes to be done in the resources.properties file..
ThanksFor unknown reasons nothing will make them work. You have to download some other third person jdbcdriver. I use http://www.j-netdirect.com/Downloads.html jsqlconnect. If anyone knows of a free unlimited use driver let me know also. This one is a one month trial period. which is a pain for someone just learning EJB. But hey.
-
How to connect MS SQL Server 2000 with JDeveloper 11g
Hi,
I am new to JDevleoper, Is it possible to connect MS SQL Server 2000 with JDeveloper 11g.
If possible can anyone help me in doing that?
waiting for ur reply...
Thanks in advance
Regards,
reddyShay or other knowledgeable folks,
Is there a way to utilize the wizard for "Business Tier > ADF Business Components > Business Components from Tables" for SQL Server 2000, 2005 or 2008. I can successfully execute sql via java programmatically or import a table from SQL Server with "Business Tier > ADF Business Components > Entity Object" wizard, but the Business Components from Tables simply doesn't see any tables under any schema. Without the "Business Components from Tables", i don't get the referential constraints imported into the application and to code all those from scratch is just not as elegant. So far i have only utilized the sql server jdbc driver from Microsoft (versions, 1.1, 1.2 and 2.0). Is there an alternative client that i need to use to enable selecting tables from that "Business Components from Tables" wizard. Is this a limitation of SQL Server, the jdbc driver or the wizard itself? Did anybody else experience the same issues? I am using Jdeveloper 11.1.1.0.1 against SQL Server 2005 (currently)
Thanks,
Andy -
JDBC Connection String for MS Sql Server 2000 with Instance Name
Hi All,
I am having problems connecting to a MS Sql Server 2000 database using MSSqlServer4
driver when the database server has an Instance Name. If the database server has
no instance name then I am able to connect using the connection string
connection=jdbc:weblogic:mssqlserver4:hansa:1433
But when I have the MS Sql Server DB with an instance name such as "TestInstance",
then I am unable to connect with any of the connection strings given below
connection=jdbc:weblogic:mssqlserver4:hansa\TestInstance:1433 or
connection=jdbc:weblogic:mssqlserver4:hansa\\TestInstance:1433 or
connection=jdbc:weblogic:mssqlserver4:hansa:TestInstance:1433 or
connection=jdbc:weblogic:mssqlserver4:hansa:1433:TestInstance
Can anybody help me in resolving this issue. Appreciate your help.
Thanks in advance.
VikramVikram wrote:
Hi All,
I am having problems connecting to a MS Sql Server 2000 database using MSSqlServer4
driver when the database server has an Instance Name. If the database server has
no instance name then I am able to connect using the connection string
connection=jdbc:weblogic:mssqlserver4:hansa:1433
But when I have the MS Sql Server DB with an instance name such as "TestInstance",
then I am unable to connect with any of the connection strings given below
connection=jdbc:weblogic:mssqlserver4:hansa\TestInstance:1433 or
connection=jdbc:weblogic:mssqlserver4:hansa\\TestInstance:1433 or
connection=jdbc:weblogic:mssqlserver4:hansa:TestInstance:1433 or
connection=jdbc:weblogic:mssqlserver4:hansa:1433:TestInstance
Can anybody help me in resolving this issue. Appreciate your help.Hi. No type-4 jdbc driver is going to be able to use a name for a DBMS instance.
Let's assume you have two DBMS instances running on the machine hansa. One
of them may be listening for tcp connections on port 1433, but the other must not.
The other most be listening on some other port number you have chosen.
Therefore, to choose which DBMS instance you want to connect to, use the
working URL you have, and switch the port number as desired.
Joe Weinstein
>
>
Thanks in advance.
Vikram -
SQL server 2000 with Java Problems
Dear Sir.
I am a new user for SQL server 2000 with java. Nevertheless, I developed an application for store images and text data into SQL 2000 database using java. Presently my system is running 12-client computer with one server computer, I installed SQL server 2000 into server then I access (save, insert, select, and get report) through ODBC diver to server using java application, system is ok but some time the server computer is getting struck.
Please let me know if there is a solution to overcome this problem.
My client computer configuration
Windows xp
1.8 MHz CPU � 512 � 768 RAM
My Server computer configuration
3.0 Dual core Intel - 1 GB RAM
Window 2000 serverbut some time the server computer is getting struck.Can you measure which application is eating up the resources? Anyway, the hardware sounds OK for that number of clients, but of course it depends on the intensity they work with.
The suspicious part is the ODBC driver. Is there a reason not to use the JDBC driver for SQL server provided by microsoft? I guess it will speed things up.
Mike -
I need to syncronize MS SQL Server 2000 with Oracle DB
Hello
I need to syncronize MS SQL Server 2000 with Oracle Database. I have created both DB connections succesfully.
1. Oracle DB: Oracle (JDBC)
2. SQL Server JDBC-ODBC (bridge)
When i create a partner link and select a DB Adapter i try to query SQL Server but it never brings the tables back to me.
I´ve tried to configure connection 2 (MSSQL) using thrid party but i really don´t know how.
Driver Class??
Library?
Library Name??
Location??
Class Path?
Source Path??
Doc Path??
URL??
help is appreciated. Thank you.
F.Here is my setup:
Driver Class: com.microsoft.jdbc.sqlserver.SQLServerDriver
Library: SQLSERVER
ClassPath: Depends on where your jar file is.
URL: jdbc:microsoft:sqlserver://your ip address or DNS name goes here.
The above is how my database connection is defined.
When I create a partner link and it gets to the screen where it imports tables it takes a while for the "Querying Database Ojects..." to finish. When it does I have not tables. I then select <all schemas> AGAIN and this time I get the tables.
If you get succeed when you do a test on the connection then I assume the connection is setup right. Perhaps the problem is like mine above and you have to select <all schemas> a second time. -
How to connect Sql Server 2000 using JDBC ODBC Driver
How to connect Sql Server 2000 using JDBC ODBC Driver ?
plz Send Syntax.
thanksIn SQL Server 2000 the driver class is com.microsoft.jdbc.sqlserver.SQLServerDriver
The connection URL for the default SQL Server 2000 database is jdbc:sqlserver://localhost:1433
Class.forName(
"com.microsoft.sqlserver.jdbc.
SQLServerDriver");
String url =
"jdbc:sqlserver://localhost:1433";
Connection conn = DriverManager.
getConnection(
url, "sa", "sqlserver"); -
SQL Server 2000 SP3 and jdbc type 4 drivers
hi all,
Has anybody had any problems using the type 4 jdbc drivers for SQL Server2000 after you upgraded the SQL Server 2000 with the latest Service Pack SP3 ??
Please reply..
cheers,
-Jerhi shilohcity,
i did have some problem when i updated my sql server to sp3. The driver i was using.., Atinav's aveConnect3, didn't connect and was throwing exceptions. But after contacting their tech support, they provided me with an updated version, which they had released recently, and that solved the problem. I now believe that with that support, what i paid for that driver was worth it.'cos I would've been kept waiting for the updates if i was using some free driver with poor tech support.
see these links..
http://forum.java.sun.com/thread.jsp?forum=48&thread=351239
and another one
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=e4774458.0301270610.134f9e5d%40posting.google.com&rnum=1&prev=/groups%3Fq%3DaveConnect%26hl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26selm%3De4774458.0301270610.134f9e5d%2540posting.google.com%26rnum%3D1
I do think this is some problem that could be solved by the driver vendors. the M$ 's TDS version is still a mystery as far as i know. and the driver should communicate with sql server using this TDS protocol. I dont know, may be SP3 would've introduced updates in the TDS protocol.. and the drivers should be able to support it, or new updated versions released.
It can happen in future too... M$ may change their stance anytime.. better be wise in choosing your DB Server and even be more careful while chosing JDBC drivers.
cheers,
-Jer -
Does setQueryTimeout still spawn a thread with Microsoft JDBC Driver 4.0?
Hi,
Does setQueryTimeout still spawn a thread with Microsoft JDBC Driver 4.0?
This link here indicates this was fixed awhile ago:
http://msdn.microsoft.com/en-us/sqlserver/aa937724.aspx
However, we are using Microsoft JDBC Driver 4.0 but are noticing that a setQueryTimeout thread is being spawned (of class com.microsoft.sqlserver.jdbc.TimeoutTimer) for every query we execute.
And, the thread seems to stay around even after the query has finished executing.
Can anyone confirm whether this is actually fixed?
Or, does anyone have any ideas how we can avoid having a new thread spawned for monitoring for a query timeout?
Thanks!Hi,
Does setQueryTimeout still spawn a thread with Microsoft JDBC Driver 4.0?
This link here indicates this was fixed awhile ago:
http://msdn.microsoft.com/en-us/sqlserver/aa937724.aspx
However, we are using Microsoft JDBC Driver 4.0 but are noticing that a setQueryTimeout thread is being spawned (of class com.microsoft.sqlserver.jdbc.TimeoutTimer) for every query we execute.
And, the thread seems to stay around even after the query has finished executing.
Can anyone confirm whether this is actually fixed?
Or, does anyone have any ideas how we can avoid having a new thread spawned for monitoring for a query timeout?
Thanks! -
Connecting to MS SQL server 2000 with SSMS 2008
Hello
I have been trying to solve this problem for months now and searched lots of threads, but no success.
Our office has sql server 2000 database, which is installed on Windows XP. I am given 'sa' password. On my computer, which is Windows 7, I have SSMS 2008. I am able to connect to mentioned server using Windows ODBC data source and with MS Access.
The problem is no matter what I tried, I could not connect with SSMS. When I go to "Server Connection" > "Server Name" > > "Network Servers" in SSMS, the needed server is found automatically, but I still fail to connect.
I know that SSMS 2008 should be able to connect to server2000 (or maybe I am wrong?).
Please help.TITLE: Connect to Server
Cannot connect to SOFODB.
ADDITIONAL INFORMATION:
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. (Microsoft SQL Server, Error: -2)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=-2&LinkId=20476
BUTTONS:
OK
I am not sure but this type of issue can be resolved by increasing time out.Time out sec is 15 by default change it to 60 or 120 and see if you can connect if not please revert.
When you are connecting using SSMS click on option button...In connection properties page see for connection timeout...change it to 60 or 120 .See if this works
Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers -
Connecting to SQL Server 2000 with MS SQL Server Driver for JDBC
Hi,
I am brand new to JDBC . I have installed JDBC driver (for JDBC 2.0) from the Microsoft site and made relevant changes to the class path variable to include the driver paths, as suggested in the driver help documnnts. I have written a simple java code to register. But i get "class NotFound" error.
here's my code. What am I doing wrong? Thnaks for the help....
class Test {
public Test() throws Exception {
// Get Connection
// Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
DriverManager.registerDriver (new com.microsoft.jdbc.sqlserver.SQLServerDriver());
Connection conn = DriverManager.getConnection("jdbc:microsoft:sqlserver://SQL1:1433",myuser,mypwd);
if (conn != null) {
System.out.println();
System.out.println("Successful Connection");
System.out.println();
// Meta Data
DatabaseMetaData meta = conn.getMetaData();
System.out.println("\n Driver Information");
System.out.println("Driver Name: " + meta.getDriverName());
System.out.println("Driver Version: " + meta.getDriverVersion());
System.out.println("\n Database Information");
System.out.println("Database Name: " + meta.getDatabaseProductName());
System.out.println("Database Version: " + meta.getDatabaseProductVersion());
} //Test
public static void main(String [] args) throws Exception {
Test test = new Test();
}Hi MoD,
This is the exact command I used for compiling
C:\>javac -classpath "c:\java;c:\Program Files\Microsoft SQL Server 2000 Driver
for JDBC\lib\mssqlserver.jar;c:\Program Files\Microsoft SQL Server 2000 Driver f
or JDBC\lib\msbase.jar;c:\Program Files\Microsoft SQL Server 2000 Driver for JDB
C\lib\msutil.jar" c:\java\Test.java
To Execute I used
C:\>java -classpath "c:\java;c:\Program Files\Microsoft SQL Server 2000 Driver
for JDBC\lib\mssqlserver.jar;c:\Program Files\Microsoft SQL Server 2000 Driver f
or JDBC\lib\msbase.jar;c:\Program Files\Microsoft SQL Server 2000 Driver for JDB
C\lib\msutil.jar" c:\java\Test
In fact it kept thrwing up the Class Not Found error for the above commands.
But as U suggested I removed the classpath and executed both javac and java commands without classpath clause , and guess what it worked for the line
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
(i.e., it dint throw any exception like before). So can I assume that driver is successfully registered?
I tried using Jcreator for compile and run. But I got the same error msg as the commands given above with calsspath caluse. Is there a way around for this to make it work from an external editing tool like Jcreator apart from removing the classpath option from the JDKTool optional setting(doing this did not help for me)
Also one last favor: How do I connect with the trusted connection option? (i.e. it should use already logged in windows authentification login)
Thanks for all U'r help. I appreciate it very much.
Suma -
How to connect to Ms SQL Server 2000 with forms9i......
hi,
how do i connect my forms9i to the database in the Ms SQL Server 2000 on the same machine ?
please give a code example also
thanks
regards
montySee
http://www.oracle.com/technology/products/forms/pdf/275201.pdf
Also search the forum and you will find discussions on this topic. -
SQL Server 2000 with IBM websphere 4.0
Hi,
I need to migrate existing Oracle DB to SQL server 2000.
Let me know how does SQL server 2000 connect with and talk to IBM websphere 4.0.
If you can also send me a sample architecture diagram.
Thanks
AlpanaHello,
It seems you need to install i-net OPTA in IBM WebSphere 4.o to be able to connect to a SQL Server
2000 instance. Please read the following article for more information:
https://www.inetsoftware.de/products/jdbc-driver/ms-sql/configurations/websphere4
Hope this helps.
Regards,
Alberto Morillo
SQLCoffee.com
Maybe you are looking for
-
How to use my apple id on iphone
hi sir i have apple id problem ,so how to make free id and how to use apple id on iphone i don,t know please can you tell me? thank you
-
Question on program logic using SKC1A
Account - Using SAKNR and selected company code (BUKRS) get alternative account using table SKB1 Description - To be obtained from SKA1 using account number found above in chart of accounts CEFR Carry-forward debit - UMSAV Debit period from 1 to
-
Deep structure issue...
Hi, Iam creating a table type(vbak) in which another table type(vbap) is specified.Now I want to populate data into internal table of vbak which is of vbak tabletype.How can I acheive this?
-
Hello, I'm acquiring some data from a x-ray detector. With each acquisition I obtain a column of the image that I want. The problem is that after n iteration I have a matrix of pixel values 192xN (with N=n.of iterations) see image attached for an exa
-
Refying PDF with subset embedded fonts fixes text extraction
Hi All, I know it is not a good idea to (just) refry PDF files (PDF -> EPS -> PDF). Especially when the PDF contains subset embedded fonts. Chances are you will end up with a PDF file which does not contain valid (searchable) text. I did not know the