May I Use The JDBC Driver Of SQLServer2000 To Access SQLServer2005??

Jan 4, 2007

May I use the JDBC driver of SQLServer2000 to access SQLServer2005??

View 3 Replies


ADVERTISEMENT

Using Saxon's SQL Extension To Access SQL Server Through The JDBC Driver

May 21, 2008

I'm having a heck of a time trying to access a SQL server database using Saxon's SQL extensions with the Microsoft SQL server JDBC driver. The Saxon XSL processor has implemented some SQL extensions that allow you to access a SQL database through a JDBC driver. I have Visual Studio 2005 professional with SQL server express installed on my workstation. The SQL server express installation is installed at the default 1433 port on my workstation, it has been setup to accept connections over TCP and has been configured to accept Windows authentication and SQL authentication. In addition, I have downloaded and installed Microsoft's JDBC driver for SQL server.

After installing the JDBC driver I added the JDBC sqljdbc.jar to my Java CLASSPATH. Then I built a simple Saxon XSL that made use of the SQL extensions:




Code Snippet
<xsl:transform version="2.0"
exclude-result-prefixes="java saxon xsd xsi xsl xfn xdt xqe"
extension-element-prefixes="saxon sql"
xmlns:java="http://saxon.sf.net/java-type"
xmlns:saxon="http://saxon.sf.net/"
xmlns:sql="java://net.sf.saxon.sql.SQLElementFactory"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
<xsl:output method="text" media-type="text/plain" encoding="utf-8" />
<xsl:preserve-space elements="*" />
<xsl:param name="jdbc.driver" as="xsd:string" select="string('com.microsoft.sqlserver.jdbc.SQLServerDriver')" />
<xsl:param name="jdbc.database" as="xsd:string" select="string('jdbc:sqlserver://localhost:1433;databaseName=prototype')" />
<xsl:param name="jdbc.user" as="xsd:string" select="string('saxon')" />
<xsl:param name="jdbc.pass" as="xsd:string" select="string('*****')" />
<xsl:template match="/">
<xsl:choose>
<xsl:when test="element-available('sql:connect')">
<xsl:variable name="sql.conn" as="java:java.sql.Connection">
<sql:connect driver="{$jdbc.driver}" database="{$jdbc.database}" user="{$jdbc.user}" password="{$jdbc.pass}">
<xsl:fallback>
<xsl:message terminate="yes">SQL extenstions are not installed</xsl:message>
</xsl:fallback>
</sql:connect>
</xsl:variable>
<xsl:variable name="sql.employees" as="element()*">
<sql:query connection="$sql.conn" table="dbo.Employees" column="*" />
</xsl:variable>
<xsl:sequence select="$sql.employees" />
<sql:close connection="$sql.conn" />
</xsl:when>
<xsl:otherwise>
<xsl:message terminate="yes">sql:connect element is not available</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:transform>

When I run the Java version of Saxon it issues a JDBC connection failure:


SXSQ0003: JDBC Connection Failure: The TCP/IP connection to the host has failed.
java.net.ConnectException: Connection refused: connect
Transformation failed: Run-time errors were reported

After some discussion on the Saxon listserv, I hacked a sample in the Microsoft JDBC documentation to see whether a standard Java program could use the JDBC driver and access the database:



Code Snippet
import java.sql.*;
public class connectURL {
public static void main(String[] args) {
// Create a variable for the connection string.
String connectionUrl = "" +
"jdbc:sqlserver://localhost:1443" +
";databaseName=prototype";
// 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, args[0], args[1]);
// Create and execute an SQL statement that returns some data.
String SQL = "SELECT * FROM dbo.Employees";
stmt = con.createStatement();
rs = stmt.executeQuery(SQL);
// Iterate through the data in the result set and display it.
while (rs.next()) {
System.out.println(rs.getString(1) + " " + rs.getString(2) + " " + rs.getString(3) + " " + rs.getString(4));
}
}
// Handle any errors that may have occurred.
catch (Exception e) {
e.printStackTrace();
}
finally {
if (rs != null) try { rs.close(); } catch(Exception e) {}
if (stmt != null) try { stmt.close(); } catch(Exception e) {}
if (con != null) try { con.close(); } catch(Exception e) {}
}
}
}




This Java application accesses SQL server express and prints out the list of employees from the dbo.Employees table in the database:



Code Snippet
-- Create the table definition.
CREATE TABLE dbo.Employees
(
empid INT NOT NULL PRIMARY KEY,
mgrid INT NULL REFERENCES dbo.Employees,
empname VARCHAR(25) NOT NULL,
salary MONEY NOT NULL,
CHECK (empid <> mgrid)
);
GO

-- Insert test data.
INSERT INTO dbo.Employees( empid, mgrid, empname, salary )
VALUES( 1, NULL, N'David' , $10000.00 );
GO
INSERT INTO dbo.Employees( empid, mgrid, empname, salary )
VALUES( 2, 1, N'Eitan', $7000.00 );
GO
INSERT INTO dbo.Employees( empid, mgrid, empname, salary )
VALUES( 3, 1, N'Ina', $7500.00 );
GO
INSERT INTO dbo.Employees( empid, mgrid, empname, salary )
VALUES( 4, 2, N'Seraph', $5000.00 );
GO
INSERT INTO dbo.Employees( empid, mgrid, empname, salary )
VALUES( 5, 2, N'Jiru', $5500.00 );
GO
INSERT INTO dbo.Employees( empid, mgrid, empname, salary )
VALUES( 6, 2, N'Steve', $4500.00 );
GO
INSERT INTO dbo.Employees( empid, mgrid, empname, salary )
VALUES( 7, 3, N'Aaron', $5000.00 );
GO
INSERT INTO dbo.Employees( empid, mgrid, empname, salary )
VALUES( 8, 5, N'Lilach', $3500.00 );
GO
INSERT INTO dbo.Employees( empid, mgrid, empname, salary )
VALUES( 9, 7, N'Rita', $3000.00 );
GO
INSERT INTO dbo.Employees( empid, mgrid, empname, salary )
VALUES( 10, 5, N'Sean', $3000.00 );
GO
INSERT INTO dbo.Employees( empid, mgrid, empname, salary )
VALUES( 11, 7, N'Gabriel', $3000.00 );
GO
INSERT INTO dbo.Employees( empid, mgrid, empname, salary )
VALUES( 12, 9, N'Emilia', $2000.00 );
GO
INSERT INTO dbo.Employees( empid, mgrid, empname, salary )
VALUES( 13, 9, N'Michael', $2000.00 );
GO
INSERT INTO dbo.Employees( empid, mgrid, empname, salary )
VALUES( 14, 9, N'Didi', $1500.00 );
GO

-- Create unique index.
CREATE UNIQUE INDEX idxManagerEmployee ON dbo.Employees( mgrid, empid );
GO




Internally, Saxon uses almost the exact same code, e.g., three argument DriverManager.getConnection, but the call fails. Michael Kay, has indicated that this issue isn't related to Saxon since the error message coming from Saxon indicates that Saxon is finding the JDBC driver and issuing the connection request, but the JDBC driver is failing.

Has anyone tried to use Saxon's SQL extensions with Microsoft's JDBC driver? If you have could you indicate how you have things setup to make it work? If anyone from Microsoft's JDBC driver team is listening, would you be will to help recreate this issue or help trying to diagnose the issue?

Thanks, Andy.

View 3 Replies View Related

Using 2005 JDBC Driver To Access SQL Server 2000

Oct 5, 2006

Hi,

I'm using JDBC driver for Server 2005 (version 1.1.1501) to access Server 2000. I have no problems reading my data, but every update returns "Cursor is READ ONLY".

If I use driver for Server 2000 I have no problems. And I have no problems running the same program with 2005 driver against SQL Server Express.

Where should I start debugging?

Thank you,

View 1 Replies View Related

Upgrade To Sqlserver2005 From Sqlserver2000

Dec 18, 2007

There is no prompt ' UPGRADE' when I install SqlServer2005
Also check select @@version after installed
Still be 'Microsoft SQL Server 2000 - 8.00.194 (Intel X86) Aug 6 2000 00:57:48 Copyright (c) 1988-2000 Microsoft Corporation Enterprise Edition on Windows NT 5.2 (Build 3790: Service Pack 2) '
Why does this happened?
OS is Windows2003 Server
Thanks

View 1 Replies View Related

How Can I Connect To Sqlserver2000 From Sqlserver2005

Sep 11, 2007



Hi,
Can any1 tell me how to connect to Sqlserver2000 from sqlserver2005 ...I cant see sqlserver2000 instance name when i try to search in database engine

With regards
mahender

View 1 Replies View Related

Installing SQLServer2005 But Preserve Current SQLServer2000

Oct 1, 2006

I have a default installation of SQLServer2000 on a host runningWin2003. I want to install SQLServer2005 on the same machine, butpreserve the original SQLServer2000 installation. How do I do this --install into new directory? new directory and named instance? justnew named instance? What stumbling blocks could I run into?

View 2 Replies View Related

Migrating From SQLServer2000 To SQLServer2005 SSIS Solution

Mar 3, 2006

Hi,

We need to migrate data from Sqlserver2000 database to Sqlserver2005. The SQLserver2000 DB was poorly Normalized and the DB was redesigned inSqlserver 2005. Both the databases are operational.Currently we have around 90 tables that need to migrate the data from the OLD DB to NEW DB, all the table mappings between the old schema and new schema have been successfully established.

Each Table is treated on its own merit and applying its own business rules which allows the data to be transformed to the new tables.The client wants us to build a SSIS solution that needs to performs the following

a. Import all Look Tables.

b. Import all master Tables ( One time import of some tables data and other tables may need to import every 4 hrs)

c. Import all Transaction tables( One time import and other tables may need to import every 4 hrs of data)



My Question is how to apporoach this scenario of pulling one time lookup, master and transaction tables and scheduling 4 hrs data importing process, how to build a SSIS solution for this type of scenario.

Thanks

Jayadev



View 4 Replies View Related

Cannot Load JDBC Driver Class 'com.microsoft.jdbc.sqlserver.SQLServerDriver'

Apr 14, 2008

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.

View 17 Replies View Related

MS JDBC Driver Incompatibility With JDBC 3.0 Specs

Aug 8, 2006

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

View 1 Replies View Related

JDBC Connecting To Sqlserver2005 Problem

Oct 10, 2006

Hi,

I am trying to connecting Eclipse to SQLserver2005 on Win2000, and the driver I use is JDBC.

My problem is: No matter what kind of authentification I try, it always throws out the exception of:

The user is not associated with a trusted SQL Server connection.

 

I tried 2 ways for connection: one is the windows, and another is Sql server authentification

To the window authentification, I appended Trusted_Connection=yes to the URL, and omit the user and password fields, and it failed. But even I used the user and password options, it didn't work, either.

To the Sqlserver authentification, I tried with the user and password, but it failed. Before that, I also added the user account in the Security option and for the specified Database.. while failed again.

And also for example:

when using the windows authentification, I tried this:

String SERVANDDB ="jdbc:sqlserver://localhost:1433;DatabaseName=TestDB;Trusted_Connection=Yes";
....

con = DriverManager.getConnection(SERVANDDB);

This throw the exception of user' ' is not a trust_connection....blabla


when using the sqlserver authentification, I tried like this:(the user ABC is assigned authority to database TestDB)

String SERVANDDB ="jdbc:sqlserver://localhost;DatabaseName=TestDB";
String USER = "ABC";
String PWD = "CBA";

con = DriverManager.getConnection(SERVANDDB, USER,PWD);

 

(The server is runing on my computer)

 

 Thank you.

 

 

View 3 Replies View Related

MS SQL Server JDBC Driver Type 2 And Driver Type 4 Differences

Jul 20, 2005

Hi,Could some please tell me whether Microsoft provides Type 2 and Type 4jdbc driver ? For Type 4 MS providescom.microsoft.jdbc.sqlserver.SQLServerDriver driver. What is thecofiguration required for type 2 driver and what driver class filesrequired ?Its very urgent to me please reply.Ajay

View 1 Replies View Related

JDBC Driver

Feb 6, 2004

Is oracle and Microsoft JDBC drivers are same? Oracle 9i comes with JDBC, can I use the same driver to access the Microsoft SQL Server?

View 1 Replies View Related

Need JDBC Driver For MS SQL 7.00.847

Jun 1, 2004

Hi
I just downloaded the Microsoft JDBC Driver for SQL Server 2000. Now it tells me SQL Server 7 is not supported. :o I already checked the JDBC Driver list on suns site. Its quite long and only states MS SQL Server without any version number. Can you recommend a particular driver? Preferrably without any cost. :D
Or am I better of with the jdbc/odbc bridge?

Thanks

Shabassa

View 1 Replies View Related

JDBC Driver?

Dec 7, 2004

Hi,

Does SQL Server Express ship with a JDBC driver? ... Hardly so, but is it available somewhere?

Rgds and thanks, PP

View 3 Replies View Related

JDBC Driver For MS SQL 7

Mar 8, 2006

Hi guys,

Where can I download the JDBC Driver for our MS SQL Server 7 ?

Thank you.

View 3 Replies View Related

Help With JDBC Driver

Jul 23, 2005

Hello all,I have a question about the SQL Server JDBC driver. I was wondering ifanyone knows what the default prefetch size is (in number of rows).Also, does anyone know if an entire packet is sent (i.e. padded withnull values) if there is not enough data to fill it?Thanks for your help!ty

View 2 Replies View Related

Need A JDBC Driver

Jul 20, 2005

I need a free, redistributable JDBC driverfrom MS SQL Server. (MSDE2000a)

View 2 Replies View Related

Jdbc Driver

Oct 2, 2006

what is the jdbc driver for sql express? is it "sqljdbc"? then what is its "complete" name in the class path:"com.microsoft.sqlexpress.sqljdbc"? and for the conection url is it "jdbc:microsoft:sqlexpress://localhost/sqlexpress"?

View 3 Replies View Related

Driver Jdbc

Nov 19, 2007

Hi Mixxo,
I also am having this problem! if you get an solution,
send me an answer or add my msn: griciolli@hotmail.com

View 1 Replies View Related

I NEED THE JDBC DRIVER FOR MS SQL SERVER

Jan 18, 2001

please help it's urgent i badly need the jdbc driver for mssql for my project
thank u

View 1 Replies View Related

Sql Server Jdbc Driver

Jan 18, 2005

Hi at all, i'm new here, your communitiy seems too much preparated.
My question is simple...
i must to connect via jdbc to a ms sql server 2000 database, but i'm in doubt to select which jdbc driver to use. your suggest over microsoft'drivers? i found on the internet the open source drivers jdts...what about them?

thank you and excuse for by bad english! :p

View 2 Replies View Related

Weblogic JDBC Driver And SQL

Mar 30, 2004

I appear to have an issue here with WebLogic and SQL Server. The WebLogic server is set up to create a pool of connections (max 15, min 4) to the SQL server. The idea is that connections are "leased" to the application for the duration of a transaction and then returned to the pool at the end of the lease. The pool can grow to up to 15 simultaneous connections -- after that the applications must wait for the next available connection in the pool.

As activity subsides, connections are supposed to be dropped down to the minimum number of 4 connections (which are maintained open continuously).

The problem that I can see from SQL is that there are tens of connections that are open (should not be more than 15, right?) and some of these connections have been held open for several days (going back to the last time we rebooted the server 2 weeks ago). I am told that this is a relatively new phenomenon; new within the last 3 months, anyway. I have tried killing some of these processes manually and now they show up in "Current Activity" as being in a "Killed/Rollback" state.

Does anyone have any experience with JDBC/Weblogic and SQL? Any experiences similar to this?

More information:
SQL Server:
SQL Server 2000 (SP3)
Windows NT (SP6)

WebLogic Server:
Weblogic 6.1
Windows 2000 (SP4)
Weblogic JDBC Driver (6.1)


Any input would be welcome.

Regards,

hmscott

View 2 Replies View Related

JDBC 1.2 Driver BigDecimal Bug

Feb 1, 2008

Hi, All!

I'm using Borland's ProcedureDataSet to retrieve data from a SQL 2005 database using the JDBC 1.2 Driver.
My problem is with the money data type. The Borland's component translate money into BigDecimal and if the value
in the database in NULL then I get a NullPointerException.

On MSDN I saw money was referred as Double which is wrong!
Any Ideas?

View 6 Replies View Related

Can't Get IntegratedSecurity With JDBC Driver

Oct 7, 2006

Hi;

I used SQLServerDatabaseMetaData (which requires a connection to return this data which seems unnecessary) to get:

name: Microsoft SQL Server 2005 JDBC Driver
version: 1.1.1501.101
Passing a url of: jdbc:sqlserver://localhost:1433;DatabaseName=Northwind;IntegratedSecurity=true

I get the error:
Oct 7, 2006 3:46:09 PM com.microsoft.sqlserver.jdbc.AuthenticationJNI <clinit>
WARNING: Failed to load the sqljdbc_auth.dll
Exception in thread "main" com.microsoft.sqlserver.jdbc.SQLServerException: This driver is not configured for integrated authentication.

I copied over x86sqljdbc_auth.dll and then it worked. I assume this is required with the jar file. This leads to a couple of questions:

What are the files xax86sqljdbc_xa.dll & x64 files for? Are they needed?
The jar file can just travel with my java code. Should the dll do the same or does it need to be in the path and/or the default directory?
Are there any other files needed or just these two?

thanks - dave

View 33 Replies View Related

NullPointerException In JDBC V1.1 Driver

Jun 20, 2007

Hello,



We are deploying our application with the v1.1 JDBC driver, but are getting a little worried with some of the results of our recent stress tests. I wanted to see if anyone could offer any insight into this problem. Also, do you have any expectation for a release date for the 1.2 driver (not CTP).



Under heavy load with a number of concurrent processes loading to a few tables in our database through batched INSERT statements (called executeBatch against a prepared statement), we see these exceptions coming back from the driver:



com.vectorsgi.tw.services.exception.LoaderException: java.lang.NullPointerException
at com.vectorsgi.tw.loader.X937HibernateLoader.loadToDatabase(X937HibernateLoader.java:813)
at com.vectorsgi.tw.loader.X937HibernateLoader.loadToDatabase(X937HibernateLoader.java:482)
at com.vectorsgi.tw.loader.X937HibernateLoader.loadToDatabase(X937HibernateLoader.java:466)
at com.vectorsgi.viex.workflow.capture.LoadListener.execute(LoadListener.java:91)
at com.vectorsgi.viex.workflow.capture.LoadListener.actionFired(LoadListener.java:55)
at fluximpl.JavaActionImpl.execute(JavaActionImpl.java:6)
at fluximpl.gl.a(gl.java:348)
at fluximpl.gl.b(gl.java:417)
at fluximpl.gl.a(gl.java:236)
at fluximpl.dm.d(dm.java:58)
at fluximpl.tlb.run(tlb.java:10)
Caused by: java.lang.NullPointerException
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecuteBatchPreparedStatement(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PreparedStatementBatchExecutionRequest.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.executeBatch(Unknown Source)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:1723)
at com.vectorsgi.tw.loader.X937HibernateLoader.loadItems(X937HibernateLoader.java:1326)
at com.vectorsgi.tw.loader.X937HibernateLoader.loadToDatabase(X937HibernateLoader.java:637)
... 10 more


In a test of 20 "jobs" 2 failed with this error, so its certainly not frequent, but not fleeting either. What is also strange about this is that after the two failures (not immediately back to back but within a few minutes of each other) we got a primary key constraint error:



com.vectorsgi.tw.services.exception.LoaderException: java.sql.BatchUpdateException: com.microsoft.sqlserver.jdbc.SQLServerException: Violation of PRIMARY KEY constraint 'PK__X937_ITEM__0E7B75BC'. Cannot insert duplicate key in object 'X937_ITEM'.
at com.vectorsgi.tw.loader.X937HibernateLoader.loadToDatabase(X937HibernateLoader.java:813)
at com.vectorsgi.tw.loader.X937HibernateLoader.loadToDatabase(X937HibernateLoader.java:482)
at com.vectorsgi.tw.loader.X937HibernateLoader.loadToDatabase(X937HibernateLoader.java:466)
at com.vectorsgi.viex.workflow.capture.LoadListener.execute(LoadListener.java:91)
at com.vectorsgi.viex.workflow.capture.LoadListener.actionFired(LoadListener.java:55)
at fluximpl.JavaActionImpl.execute(JavaActionImpl.java:6)
at fluximpl.gl.a(gl.java:348)
at fluximpl.gl.b(gl.java:417)
at fluximpl.gl.a(gl.java:236)
at fluximpl.dm.d(dm.java:58)
at fluximpl.tlb.run(tlb.java:10)
Caused by: java.sql.BatchUpdateException: com.microsoft.sqlserver.jdbc.SQLServerException: Violation of PRIMARY KEY constraint 'PK__X937_ITEM__0E7B75BC'. Cannot insert duplicate key in object 'X937_ITEM'.
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeBatch(Unknown Source)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:1723)
at com.vectorsgi.tw.loader.X937HibernateLoader.loadItems(X937HibernateLoader.java:1333)
at com.vectorsgi.tw.loader.X937HibernateLoader.loadToDatabase(X937HibernateLoader.java:637)
... 10 more



Now- I realize that this is very straight forward, but we are almost certain that our key generation code cannot generate a duplicate key. We have been running it 24x7 for three years at a number of customer sites without ever getting a duplicate (under the open-source jTDS driver). Now that we are trying to move to a better driver that is actively supported, we see these primary key violations every once in a while. Its very hard to consistently replicate, but we have received it from 5 of the past 20 stress tests.



I mainly want insight into the NullPointerException, but if there is any possibility that a driver issue could be contributing to my primary key problem--that would sure make a lot of sense. (I realize its a long shot!)



Thanks,



Steve Ash

Software Developer

Metavante Image Solutions

View 5 Replies View Related

JDBC Driver Vs ODBC?

Mar 21, 2008

Hi;
I am having problem figuring out if the JDBC Driver for MS SQL Server 2005 is faster or setting up a data source from Administrative tools/Data Sources. I have run several tests and in all tests, the odbc datasource is faster. In that case, why having the trouble of downloading a driver if I am not wrong. I have understood that the native driver is always faster than the odbc bridge.
Thanks in advance

View 8 Replies View Related

Cannot Find The Driver For JDBC

Jan 30, 2006

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

View 1 Replies View Related

JDBC Driver And SQL Profiler

Aug 13, 2007

Hi,

I'm trying to debug some deadlock problems I'm having with an XA JDBC application that uses the Microsoft JDBC driver.

Problem is, I can't see much of the info in the Profiler I always get the TextData colum filled with things such as :
'sp_cursorclose 180150269' for my BatchCompleted. I've tried other event but I can't see any of the SQL code. My other application does not use XA and I see the statements fine.

I was wondering how I could get to see the TextData with the SQL sent to the server via the XA connection if it's possible. Is it another event or column I need?

Thanks for the help,

Greg

View 1 Replies View Related

Error With JDBC Driver

Mar 31, 2008



hi, i am using sqljdbc.jar in a java applet and i am using Netbeans for development. i am able to connect with the SQL Server from the IDE. however, when i try to debug the SQL part of the code, i am getting an exception at :


DriverManager.registerDriver(new com.microsoft.sqlserver.jdbc.SQLServerDriver());
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
String connectionUrl="jdbcqlserver://localhost:49182;databaseName=NanoBase;";
Connection con = java.sql.DriverManager.getConnection(connectionUrl, "test", "Walt787sop289");

where it says that it cannot find the class. i am also putting down the exception information.

java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.javaws.Launcher.executeApplication(Launcher.java:1273)
at com.sun.javaws.Launcher.executeMainClass(Launcher.java:1219)
at com.sun.javaws.Launcher.doLaunchApp(Launcher.java:1066)
at com.sun.javaws.Launcher.run(Launcher.java:105)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NoClassDefFoundError: com/microsoft/sqlserver/jdbc/SQLServerDriver
at VncViewer.performSql(VncViewer.java:115)
at VncViewer.readParameters(VncViewer.java:743)
at VncViewer.init(VncViewer.java:152)
at VncViewer.main(VncViewer.java:53)
... 9 more
Caused by: java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at com.sun.jnlp.JNLPClassLoader.findClass(JNLPClassLoader.java:256)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

i am currently using java web start to debug the application. earlier, the application was running smoothly during debug (when not being run through java web start), but was failing to run when started externally say within a html file as an applet. however, when i used java web start, the exception is being pointed to the line in bold. i have added sqljdbc.jar to the list of libraries and have added it under the compile as well as the run time configuration. i would appreciate if this exception could be resolved. if i have to configure anything in the classpath, pls suggest how i can configure it under netbeans.

regards,
anant

View 4 Replies View Related

Low Cost/free JDBC V.3 Driver?

Mar 1, 2004

Hi,

We are in need of a JDBC driver (version 3) to support some autonumbering in SQLServer. We've found a couple, very expensive stuff (JTurbo & DataDirect), these drivers can be more expensive than a SQLServer license. Any other ideas/sources?

Thanks,
Bob

View 1 Replies View Related

Where To Get JDBC Driver For SQL Server 2000?

May 13, 2004

I have SQL server installed on a XP box. I need to access it from other machines using Java code. Where can I download a JDBC driver?
Thanks.

View 6 Replies View Related

Best Jdbc 1.0 Centric Driver For Sql Server

Jul 23, 2005

Hello JoeOver the past several years, I have found your responses to jdbcusage/driver related issues to be extremely helpful. I am sure thatyou're very busy so I will make my question as brief as possible - thereason I didn't post this to a newsgroup is that I don't want to hearany more hype or links to benchmarks (since the vast majority of thebenchmarks don't test concurent/mixed-transaction environments). (I amalso posting a modified version of this message to some newsgroups, butbased on past responses - don't have too much hope that these will leadto a resolution.) If the only way to answer this question would be tohave a phone conversation, my company would be more than happy to pay aconsulting-service fee for your time.My situation:My company has a enterprise level web-app that targets SQL Server. Wedon't use J2EE - so we stick to a simple to administer web containers(JRun,Tomcat). Recently, we have been getting worse and worseperformance from our jdbc driver (we use the free MS jdbc driver) -things like strange transaction resource handling, chopy overallperformance, etc.. I have spent significant time tweaking it (followingvarious advice - many times yours - on newgroups... I can go intodetails, but I don't want to take up your time). As the project'sarchitect, I need to do something about this problem - but varioushigh-level tunnings that I have done to the way we use connections withthis driver haven't significantly improved perfomance under normaleveryday load. (Our queries often span tables with millions of records,and are relatively dynamic. We use a seperate pool of autocommit-offconnections for writes, and autocommit-on connecions for reads)So, then, my question - in your expert opinion - what is the BESTdriver from SQL Server 2000 given the following needs:Things I need it to have are solid jdbc 1.0, solid transactionhandling, decent concurrent load handling, stable implementation ofresource handling (i.e. auto closing result sets when parent statementsclose, closing of result sets & statements when connections close) andsupport for multiple open statements/result sets per connection.Things I do not have a direct need for:Connection Pooling (I keep my own pool of open connections), DataSourcesupport, distributed transactions or 2-phase commit support, RowSetvariants, jdbc 3.0 autokey generation, J2EE compliance. We do make useof updatable result sets - but I don't care if it isn't supported sinceI can still use MS driver for those, as they are mainly done it batchjobs).Things that are nice:It would also be good to have a driver that can handle prep statementcaching on a driver level (vs connection level) although this isn't anecessity, and if it is available - it would need to have aconfigurable caching strategy (or have a way to be turned off :)I very much appreciate your help in advanceThanksGary BogachkovSystem ArchitectStericycle Direct Return

View 1 Replies View Related

Problem With JDBC Driver For MS SQL Server

Jul 20, 2005

Dear All,I developed an web application which use MS SQL Server 2000. Iencounter the following SQLException "[Microsoft][SQLServer 2000Driver for JDBC]Error setting up static cursor cache". Did anyoneencounter this problem before? What does this exception mean and howto solve this problem?[Remarks: The web application work properly on development machine andthis machine but encounter this exception when move to anothermachine, so is this exception related to the machine?]Thank you for your attention.Yours faithfully,Benny

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved