How To Find Out Usersinfo Using JDBC Connection To SQL Server
Feb 8, 2004Hi..
I want to find out the List of users created in SQL Server.
Im using type 4 Driver to Connect SQL Server.
Regards
maruthi.
Hi..
I want to find out the List of users created in SQL Server.
Im using type 4 Driver to Connect SQL Server.
Regards
maruthi.
When using jdbc with IntegratedSecurity, I run into this problem when the machine is not part of a domain & gets its IP address via dhcp. Is this expected behavior or a bug in the jdbc driver.
The SQLServer and client application are installed on the same machine and a local admin is logged in, running the client app.
If I change one of the two parameters mentioned above, the connection can be established leading me to believe this may be intentional for security issues. Am I correct?
Dear All,
Using JDBC trying to connect MS SQL server 2005. Getting the following error:
org.apache.commons.dbcp.DbcpException: java.sql.SQLException: Network error IOException: Connection refused: connect
java.sql.SQLException: Network error IOException: Connection refused: connect
java.net.ConnectException: Connection refused: connect
org.apache.commons.dbcp.DbcpException: java.sql.SQLException: Network error IOException: Connection refused: connect
java.sql.SQLException: Network error IOException: Connection refused: connect
java.net.ConnectException: Connection refused: connect
Here is the TCP/IP setting in our SQL server 2005:
I disable the Windows 2003 R2 firewall, but that didn’t help.
In SQL server 2005 for Remote connections:
Enabled “Local and Remote connections: Using both TCP/IP and Named Pipes
In TCP/IP Prosperities:
IP Addresses:
IP1: Active: Yes
Enabled: Yes
IP address: the server IP address Example 192.168.0.1
TCP Dynamic port: 0
TCP Port: 1433
///
IP2: Active: Yes
Enabled: Yes
IP address: the server IP address Example 192.168.0.1
TCP Dynamic port: 0
TCP Port: 1433
////
IP3: Active: Yes
Enabled: Yes
IP address: the server IP address Example 192.168.0.1
TCP Dynamic port: 0
TCP Port:
///
IP4: Active: Yes
TCP Dynamic ports: 1053
TCP Port:
For Protocols:
Under general:
Enable: Yes
Keep Alive: 30000
Listen ALL: Yes
No Delay: No
I think that should be enough info to start with.
Please advice.
Thanks for any help.
Abrahim
I'd recently upgraded SQL Server2000 to SQL server2005. I've been using Tibco DX to connect to the database. While working with SQL Server2000 things were going fine. I could access the databases from the repository through TibcoDX and could deploy my tasks which involved migrating data from source to target databases.
But when I had installed SQL server 2005 an error cropped up while deploying tasks
Exception occurred while initializing the JDBCTransformer: The TCP/IP connection to the host has failed. java.net.UnknownHostException:
I'd checked the port numbers and they were matching, the TCP protocols were also enabled. But I'm not able to fix this problem. Any help would be highly appreciated. Thank You.
In testing new patches, I tried Windows 2003 Server SP2 and our JDBC connections stopped working. I uninstalled SP2 and they started working again. Anyone know where the problem is?
I have already read pages of documentation, but I will keep looking. Please let me know if you know the setting that needs to be changed. I'm assuming it is a new "security enhancement" but I'm just not sure exactly where.
Thanks in advance.
Hugh
Hi!
I have developed a database in MS SQL Server 2005 Express, to which I would require only bulkadmin server role from an external java application, because I only need to update rows, insert values or use select queries in the database.
The problem is that, using either the Microsoft JDBC Driver 1.1 or the Java JDBC ODBC Driver and the Windows XP Data Base (ODBC) configurations, I need a user with sysadmin server role inside Sql Server, otherwise JDBC won't connect to the database using the selected user. Even if I leave the sql login with setupadmin or any server role lower than sysadmin, the connection is refused.
Is there no way to connect using JDBC to MS Sql Server 2005 other than granting the connected user sysadmin rights? My code looks as follows:
Code Snippet
String driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
String url = "jdbc:sqlserver://FIREBLADE\SQLEXPRESS";
String user = "username";
String password = "password$$";
Connection conn;
Class.forName(driver);
conn = DriverManager.getConnection(url,user,password);
if (conn != null)
System.out.println("SQL Server Connection established ...");
I have heard that Java JDBC connections to Microsoft require high-level access.
Any informed answer is more than welcome. Thanks for reading my post!
I am using sqljdbc41.jar to connect with MSSQL database, it is working fine on my local machine.Where as on the remote server, same class giving me error
Login failed for user '<domain><windows loginID>'
My connection string is URL...
I am using sqljdbc41.jar and on 64 bit processor , I am using following command which included path for sqljdbc_auth.dll java -Djava.library.path= C: sqljdbc_4.1enuauthx64 TestDao and error is Login failed for user '<domain><windows loginID>' why it is not picking up username passed in connection string. I have 2 machines, one is local and other is remote. on both machine I login using my domain, it is working absolutely fine on local then why the error is coming on remote machine.Both the machines are identical.
I am having MSSQLServer2000 on Win2k and Win2k3 server.
i have to connect these servers from a application using JDBC driver and AD Authentication.
I have programmed all the things needed for AD authentication in my application(changed url , using integratedSecurity=true), and it is working fine when my application connects to MSSQLServer2k5 on WinXP(which is added to same domain of my application).
But when i try to connect MSSQL2000 server on Win2000 server it failes and gives error as follows.
Apr 18, 2008 12:39:51 PM com.microsoft.sqlserver.jdbc.AuthenticationJNI SNISecGenClientContextINFO: Failed to get the SPNcom.microsoft.sqlserver.jdbc.SQLServerException: Connection reset at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(Unknown Source) at com.microsoft.sqlserver.jdbc.TDSChannel.read(Unknown Source) at com.microsoft.sqlserver.jdbc.TDSReader.readPacket(Unknown Source) at com.microsoft.sqlserver.jdbc.TDSReader.readPacket(Unknown Source) at com.microsoft.sqlserver.jdbc.TDSReader.readResponse(Unknown Source) at com.microsoft.sqlserver.jdbc.TDSCommand.startResponse(Unknown Source) at com.microsoft.sqlserver.jdbc.TDSCommand.startResponse(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerConnection.access$000(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(Unknown Source) at com.microsoft.sqlserver.jdbc.TDSCommand.execute(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(Unknown Source) at ChangePassword.process(ChangePassword.java:33) at ChangePassword.main(ChangePassword.java:14)
I am using following code for connection --
String url = "jdbcqlserver://172.16.1.243\dbaudit;portNumber=1034;integratedSecurity=true";
Class dbDriverClass = Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
Driver driver = (Driver) dbDriverClass.newInstance();
Properties props = new Properties();
conn=driver.connect(url, props);
Hi all, I am building a program using Java and SQL express and I need the driver in order to connect to the database. I have downloaded I think a version for sql server 2005 but it did not work. Can somebody tell me if such driver exists?
Thank you all
this url is having problem while making connection to SQL Server
jdbc:XXX:sqlserver://<host>:1433;DatabaseName=<name>
error:
"The requested instance is either invalid or not running."
Hi,
I am using sqljdbc_1.1 and am able to connect / query to my SQLServer 2000 database when I pass the "sa" userID and password in the connect URL.
String connectionUrl = "jdbc:sqlserver://<hostName>;databasename=mydb;user=sa;password=********";
However when I pass my username and password instead of the "sa" userID I get the following error (I edited out my userID from the error message):
com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user '<userID>'.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)
at com.microsoft.sqlserver.jdbc.IOBuffer.processPackets(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.processLogon(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:193)
at sqlCall.main(sqlCall.java:19)
I have tried passing the domain name with the userID and get the same error. I don't understand why the login would fail as I used my userID in a systemDSN on my laptop and had no problem connecting. I also used "SQL Server Enterprise Manager" configured to use my DOMAIN login information when I built the database.
Does anyone know what I could be doing wrong or what configuration I have overlooked?
Thanks,
RNG
Environment -
I am using Tomcat as my servlet engine and IIS as the Server. Additionally, I am using MS SQL 2000 as my DB. The DB resides on a seperate machine, and have created an ODBC JDBC connection on the local machine to access it. Additionally, the authentication for the DB is set to "Windows Authentication".
Problem -
Everything works fine if I simply run tomcat and access the databse. Also, things run fine when I run tomcat via IIS too. However, when I try accessing the database, I get the error
Login failed for user '<username>'
Now, the funny part is, this username is actually the username of the local machine on which the application has been placed. It is not the username that I am providing in
con=DriverManager.getConnection("jdbc : odbc : DBName","username","password"); /* had to add in extra spaces to stop this site from substituting :+D.etc to smiles*/
Can someone please help me figure it out?? Why is it working when I run the tomcat (Apache) and run the application from there, but ones I run it via IIS, it fails. Also, why is it taking the username from the local machine and not the one that I am providing out there?
Hello all,
Please may I have your assistance?
I need to be able to connect(JDBC?) to my MS OLAP database from my Web based Java application. Can this be done? if so how.
Your comments would be greatly appreciated
HiI using Java and JDBC to connect to MS SQL server 2000 (using the MSdrivers msbase,msutil and mssqlserver.jars).Sometimes it takes a long time for statement.executeQueryto return and start returning the resultset(full DB scan can take 30-40 minutes).Does anyone know if it's possible to interupt/halt the query beforeit eventually comes back. The setQueryTimeout works OK but this has to beset quite high to allow real queries to run correctly. What I'm tryingto do is allow users to halt their query if they've realised theywant to alter it or its taking too long. The query is running in aseparate thread and I've tried using the main thread to close theconnection or stop the query but this still waits until the resultsetis returned.Maybe it's a driver issue or .....ThanksMike
View 4 Replies View RelatedI see the following error randomly -
* SQLException during execution of sql-statement:
* sql statement was 'SELECT count(*) FROM PRODUCT_ATTRIBUTES A0 WHERE A0.PRODUCT_ID = ?'
* Exception message is [An exception occurred during the DBComms.receive method. Operation:Connection reset. Context1) [Thread[pool-2-thread-1,5,main],
IO:18563, Dbc:c67b9]. PktNum:0. TotalReceived:0. PktSize:4,096.]
* Vendor error code [0]
* SQL state code [08S01]
* The root stack trace is -->
* com.microsoft.sqlserver.jdbc.SQLServerException: An exception occurred during the DBComms.receive method. Operation:Connection reset. Context1)
[Thread[pool-2-thread-1,5,main], IO:18563, Dbc:c67b9]. PktNum:0. TotalReceived:0. PktSize:4,096.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
at com.microsoft.sqlserver.jdbc.DBComms.receive(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PreparedStatementExecutionRequest.executeStatement(Unknown Source)
at com.microsoft.sqlserver.jdbc.CancelableRequest.execute(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeRequest(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(Unknown Source)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:93)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:93)
at org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeQuery(JdbcAccessImpl.java:293)
at org.apache.ojb.broker.accesslayer.RsQueryObject.performQuery(RsQueryObject.java:72)
at org.apache.ojb.broker.accesslayer.RsIterator.<init>(RsIterator.java:189)
at org.apache.ojb.broker.accesslayer.ReportQueryRsIterator.<init>(ReportQueryRsIterator.java:45)
at org.apache.ojb.broker.core.ReportRsIteratorFactoryImpl.createRsIterator(ReportRsIteratorFactoryImpl.java:59)
at org.apache.ojb.broker.core.PersistenceBrokerImpl.getRsIteratorFromQuery(PersistenceBrokerImpl.java:2217)
at org.apache.ojb.broker.core.PersistenceBrokerImpl.getReportQueryIteratorFromQuery(PersistenceBrokerImpl.java:2252)
at org.apache.ojb.broker.core.PersistenceBrokerImpl.getReportQueryIteratorByQuery(PersistenceBrokerImpl.java:2177)
at org.apache.ojb.broker.core.PersistenceBrokerImpl.getCount(PersistenceBrokerImpl.java:2148)
at org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCount(DelegatingPersistenceBroker.java:383)
at org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCount(DelegatingPersistenceBroker.java:383)
at org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCount(DelegatingPersistenceBroker.java:383)
at org.apache.ojb.broker.core.proxy.CollectionProxyDefaultImpl.loadSize(CollectionProxyDefaultImpl.java:154)
at org.apache.ojb.broker.core.proxy.CollectionProxyDefaultImpl.size(CollectionProxyDefaultImpl.java:268)
at com.serus.common.caching.FlyWeight.getCollection(FlyWeight.java:272)
at com.serus.common.caching.FlyWeight.intercept(FlyWeight.java:125)
at com.serus.dto.core.ProductDTO$$EnhancerByCGLIB$$52ef9193.getProductAttributes(<generated>)
at com.serus.manager.scm.ModelManager.getProductAttributeForProductIdAttributeName(ModelManager.java:1664)
at com.serus.inca.outbound.PNAdapter.processTemplate6_New(PNAdapter.java:910)
at com.serus.inca.outbound.PNAdapter.runChildAdapter(PNAdapter.java:144)
at com.serus.inca.outbound.WSBaseAdapter.runAdapter(WSBaseAdapter.java:114)
at com.serus.inca.outbound.WorkstreamProcessor.startProcessor(WorkstreamProcessor.java:375)
at com.serus.inca.outbound.WorkstreamProcessor.call(WorkstreamProcessor.java:152)
at com.serus.inca.outbound.WorkstreamProcessor.call(WorkstreamProcessor.java:78)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
My database and driver details are as below:
Database Product Version 9.00.1399
Driver Name Microsoft SQL Server 2005 JDBC Driver
Driver Version 1.1.1501.101
Driver Major Version 1
Driver Minor Version 1
It is a AMD 64 bit 2 dual core machine which is deployed with jdk 1.5 update 10.
Has anyone seen this before?
Thanks
-giriraj
Hi there,
i am working on SQL JDBC 2005 version 1.1. I have a liferay portal database located at server 1, wsrp portlets' database located at server 2 (with instance name instance1). The producer (liferay) have to create a connection with server 2 (use connection string) to authenticate the consumer. If the registration properties is valid, then the consumer are able to consume the wsrp portlet. (Note that i use tomcat as web container)
But when the producer connect to server 2, tomcat throws error:
com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host has failed. java.net.ConnectException: Connection timed out: connect
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(DriverManager.java:525)
at java.sql.DriverManager.getConnection(DriverManager.java:193)
at com.mypackage.utils.DBUtils.getDBConnection(DBUtils.java:45)
My connection string pattern is : "jdbcqlserver://{0}:{1};User={2};Password={3};DatabaseName={4}"
Which {0}: server name
{1}: port,
......
for ex: jdbcqlserver://server2instance1,2345:2345;User=sa;Password=Sa;DatabaseName=mydb
Is my string correct ?
Note that the error occur intermittent, not everytime.
If any one there who have got or experienced with this error, please help me. Thanks you very much
Hi,
I have noticed that Connection.setTypeMap is not supported on the SQL Server 2005 JDBC driver.
The consequence is that it is impossible to use UDTs via JDBC. Is there any plan to implement this in the future ?
Thanks,
Ben
Hello,
I've been developing a web application with a Java backend that connects to a SQL Server database with the JDBC driver 1.1 for a while now. Until now, everything was working fine. Now I had to add Windows authentication to the application.
After reading through the JDBC online help, I added the property
integratedSecurity=true to the connection string and copied the sqljdbc_auth.dll to the windowssystem32 directory of the system with the backend.
Logging in works fine, but the problem is that SQL statements that work on views throw SQLServerException errors, the message is
Invalid object name '(name of the view)'
It doesn't matter if a user is configured to log in via windows authentication or via SQL server authentication.
I need to access those views instead of the real tables because this is part of my security concept, the database creates views for each user based on his role.
Is this a known problem with the JDBC driver or a configuration issue?
Thanks for the help.
Hello. I have recently installed MS SQL SERVER 2005 and when I was installing it, it asked me for the username and password, and there I had 2 options: either write my own, either select "Use Windows Authentification". I selected the "Windows Authenthification" ( I guess that means that it uses my username and password from Windows ).
Now, Im trying to connect to the Server using Java and JDBC, but I have a problem: I have to specify the username and the password of the connection! My windows' only account is "Vlad" and I have no password. I tried these options, but it didn't work. I also tried with empty string "", and with "sa", "sa" but it didn't work either. I get an error saying that "Login failed for user 'Vlad'. The user is not associated with a trusted SQL Server Connection."
Any ideea of what the username/passwords are or how to get them?.
Thank you for your time.
We see an unusual case where a query seems to be taking a long time (more than 30 minutes) as shown by the Java thread dump (below) - however the SQL server DB does'nt show any corresponding Connection for the query at the lower layer.
The JDBC layer seems to be "in progress" as far as processing the results of the query are concerned. If the Connection was dropped or had a failure we should have seen a corresponding SQLException in the JDBC layer - which is also not the case.
Any tips on how to debug this? Is there a timeout set on the JDBC Connection which causes it to wait before it detects any failures?
thanks
"JMS Session Delivery Thread" daemon prio=6 tid=0x0000000006434780 nid=0x868 run
nable [0x0000000020d6e000..0x0000000020d6f860]
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at com.microsoft.sqlserver.jdbc.DBComms.receive(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePrep
aredStatement(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PreparedState
mentExecutionRequest.executeStatement(Unknown Source)
at com.microsoft.sqlserver.jdbc.CancelableRequest.execute(Unknown Source
)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeRequest(Unkno
wn Source)
- locked <0x00000000955574e0> (a com.microsoft.sqlserver.jdbc.TDSWriter)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeUpdate
(Unknown Source)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(Del
egatingPreparedStatement.java:101)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(Del
egatingPreparedStatement.java:101)
at org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeInsert(JdbcAc
cessImpl.java:213)
at org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(Persistenc
eBrokerImpl.java:2021)
at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBro
kerImpl.java:977)
at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBro
kerImpl.java:1014)
at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBro
kerImpl.java:884)
at org.apache.ojb.broker.core.PersistenceBrokerImpl.storeAndLinkOneToOne
(PersistenceBrokerImpl.java:1074)
at org.apache.ojb.broker.core.PersistenceBrokerImpl.storeReferences(Pers
istenceBrokerImpl.java:1050)
at org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(Persistenc
eBrokerImpl.java:1981)
at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBro
kerImpl.java:977)
at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBro
kerImpl.java:1014)
at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBro
kerImpl.java:884)
at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Delegati
ngPersistenceBroker.java:220)
at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Delegati
ngPersistenceBroker.java:220)
at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Delegati
ngPersistenceBroker.java:220)
at com.serus.db.ojbutils.SerusPersistenceBrokerHandle.store(SerusPersist
enceBrokerHandle.java:178)
at com.serus.common.OJBDAOUtil.store(OJBDAOUtil.java:636)
at com.serus.dao.wip.AbsWipDAO.saveDTO(AbsWipDAO.java:251)
at com.serus.dao.wip.tx.LotTXDAO.saveLotTx(LotTXDAO.java:56)
at com.serus.manager.wip.txprocessing.AbstractTxProcessorImp.storeLotTx(
AbstractTxProcessorImp.java:1380)
at com.serus.manager.wip.txprocessing.LotTxProcessingMoveStage.storeLotT
x(LotTxProcessingMoveStage.java:802)
at com.serus.manager.wip.tx.LotTxManager.saveLotTx(LotTxManager.java:248
)
at com.serus.manager.wip.tx.LotTxXMLProcessor.parseMessageOriginal(LotTx
XMLProcessor.java:137)
at com.serus.manager.wip.tx.LotTxXMLProcessor.parseMessage(LotTxXMLProce
ssor.java:78)
at com.serus.events.listener.SerusJMSListener.onSerusMessage(SerusJMSLis
tener.java:197)
at com.serus.events.listener.AbstractEventListener.onMessage(AbstractEve
ntListener.java:53)
at progress.message.jimpl.Session.deliver(Unknown Source)
at progress.message.jimpl.Session.run(Unknown Source)
at progress.message.jimpl.Session$SessionThread.run(Unknown Source)
Hi,
I am facing problem in configuring and using connection pooling on tomcat 5.0. I am using JDBC Driver v.1.1 for SQL Server 2005.
Can anybody point me to appropriate samle code or guideline?
Thanks & Regards,
Bhavin P Panchal
Hi!
I'm writing a java application that queries sqlserver 2005 (and 2000). In case the sql browser service is stopped I need to use the named pipe property or the port property, right?
But how could the program know at runtime what is the port and what is the pipe name? And how should a connection string to sqlserver 2005 (and 2000) that includes named pipe, look like?
Thanks!
I am trying to connect to SQL Server 2005 Express with JDBC. I am getting the following exception:
Code SnippetString connectionUrl = "jdbc:sqlserver://localhost:1433;" +
"databaseName=IFC3;";
// Declare the JDBC objects.
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
try {
// Establish the connection.
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
con = DriverManager.getConnection(connectionUrl,"ifc2","password");
com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host has failed. java.net.ConnectException: Connection refused: connect
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at connectURL.main(connectURL.java:43)
I am using the code example that came from Microsoft for making a JDBC connection. I looked at my configuration of SQL Server and change to use a static port 1433. I shut off Windows firewall to make sure it was not blocking communication.
When I try to telnet to port 1433 it says
Connecting To 1433...Could not open connection to the host, on port 23: Connect
failed
Any suggestions?
Thanks,
Tom
I have read similar posts to this, but I am still having problems.
I am trying to use connection pooling to connect to a local SQL Server 2005 database. I am running my application using
MyEclipse Enterprise Workbench. I have verified that sqljdbc.jar resides in "WebRoot/WEB-INF/lib/"
"WebRoot/WEB-INF/web.xml":
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsichemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<resource-ref>
<res-ref-name>jdbc/DefaultDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</web-app>
"WebRoot/META-INFcontext.xml":
<?xml version="1.0" encoding="UTF-8"?>
<Context>
<Resource name="jdbc/DefaultDS"
auth="Container"
type="javax.sql.DataSource"
username="tec"
password="tec"
driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDrive"
url="jdbcqlserver://localhost:1433/tec;databaseName=tec;user=tec;password=test;"
validationQuery="select 1"
maxActive="10"
maxIdle="2"/>
</Context>
Classpath:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="com.genuitec.eclipse.j2eedt.core.J2EE14_CONTAINER"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/dom.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jaxen-full.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jaxp-api.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jdbc2_0-stdext.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/sqljdbc.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jstl.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/mail.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/sax.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/saxpath.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/standard.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/xalan.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/xercesImpl.jar"/>
<classpathentry kind="output" path="WebRoot/WEB-INF/classes"/>
</classpath>
Code to connect:
import java.io.Serializable;
import java.sql.*;
import javax.sql.*;
import javax.naming.*;
public int testConnect(){
Connection conn = null;
InitialContext ctx = null;
java.sql.Statement stmt = null;
try {
ctx = new InitialContext();
Context envCtx = (Context) ctx.lookup("java:comp/env");
DataSource ds = (DataSource) envCtx.lookup("jdbc/DefaultDS");/*This is generating the Cannot load JDBC driver class... error*/
conn = ds.getConnection();
stmt = conn.createStatement();
return CONSTANT.SUCCESS;
} catch (Exception e) {
return CONSTANT.FAILURE;
}finally {
try {
if (stmt != null)
stmt.close();
if (conn != null)
conn.close();
if (ctx != null)
ctx.close();
} catch (Exception ex) {
// do nothing
return CONSTANT.FAILURE;
}
}
}
Any ideas would be greatly appreciated.
Hi all,
We've just stumbled on a 1.0 version incompatibility with the JDBC specs.
Problem: A table with SMALLINT column. According to JDBC specs version 3.0
(p.B-179) and 4.0 (p.221)), the value should be converted to Integer type.
Unfortunatelly we get a Short object :(
Now, I remember, this case was also affecting old JSQLConnect driver from
DataDirect. Could that problem sneak to new MS driver too?
Please let me know any resolution to this problem if exists.
The issue has not been fixed in CTP 1.1 version. Any ideas if it can be fixed??
Cheers,
Piotr
I apologize if this is not the correct forum for this posting. Looking at the descriptions, it appeared to be the best choice.
I am running Windows XP Pro SP2. I have installed the SQL Native Client for
XP. However, when I try to add a new data source through ODBC Connection
Manager, SQL Native Client is not listed as an option. I have followed this procedure on three other systems with no problems. What would be causing the
SQL Native Client to not show up in the list of available ODBC data sources?
I've got an import app written in Java. One table I'm importing from contains 22 million records. When I run the app in a 2000 environment, I have my max heap set at 512, and the table gets imported. When I run in a 2005 environment, I have to change the max heap to 1152 or it will error out with a similiar error:
com.microsoft.sqlserver.jdbc.SQLServerException: The system is out of memory. Use server side cursors for large result sets:Java heap space. Result set size:854,269,999. JVM total memory size:1,065,484,288. (<--this is with max heap at 1024)
what is the difference between the 2000 and 2005 JDBC that I have to set max heap in one and not the other?
Hi,
I have a database with 150 tables.
I need to find connections between specified tables. (I need to find through what fileds and tables are table1 and table2 connected)
Is there any tool in SQL Server for this?
Thanx
I, just like others, am experiencing problems with data leaks. I was wondering if anyone knows of a tool out there that can help pinpoint the pages with problems? I basically want to find the culprits!
Thanks,
--
Yonah
Ok, lets see if I can put what I am looking for into words.
I run a MSSQL server, I show in my logs that a connection is being made to my server from a remote ip. I have contact the owner of the ip in question and they state that they have no buisness with us and they should not be connected to us. According to netstat the connection to us is established on 2 different remote ports to 1433. My question, is there any logging on sql that I can turn on, look at to see what database this connection is accessing? Thanks
can anyone help me with this error message
Server Error in '/' Application.
The SSE Provider did not find the database file specified in the connection string. At the configured trust level (below High trust level), the SSE provider can not automatically create the database file.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Configuration.Provider.ProviderException: The SSE Provider did not find the database file specified in the connection string. At the configured trust level (below High trust level), the SSE provider can not automatically create the database file.Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace:
[ProviderException: The SSE Provider did not find the database file specified in the connection string. At the configured trust level (below High trust level), the SSE provider can not automatically create the database file.]
System.Web.DataAccess.SqlConnectionHelper.EnsureSqlExpressDBFile(String connectionString) +2546149
System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +87
System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(String username, Boolean updateLastLoginActivityDate, Int32& status, String& password, Int32& passwordFormat, String& passwordSalt, Int32& failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate) +1121
System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat) +105
System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved) +42
System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password) +83
System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +160
System.Web.UI.WebControls.Login.AttemptLogin() +105
System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +99
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +115
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +163
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
Version Information: Microsoft .NET Framework Version:2.0.50727.112; ASP.NET Version:2.0.50727.112
Are there separate jdbc drivers for Sql Server 7 or should I use the 2000 drivers?
View 1 Replies View RelatedDear all,Where can I find JDBC for MS SQL server?Thx for reply.Victoria
View 2 Replies View Related