MS JDB driver and temp tables scope
From: Roman (Roman_at_discussions.microsoft.com)
Date: 07/17/04
- Next message: Joe Weinstein: "Re: MS JDB driver and temp tables scope"
- Previous message: Sue Purkis: "Re: text datatype support"
- Next in thread: Joe Weinstein: "Re: MS JDB driver and temp tables scope"
- Reply: Joe Weinstein: "Re: MS JDB driver and temp tables scope"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 16 Jul 2004 18:41:01 -0700
I have a problem with the driver when creating a temp table and keepping it available for the session.
try {
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
} catch (ClassNotFoundException e) {
System.out.println("Exception caught: " + e.getMessage());
}
try {
java.sql.Connection conn =
java.sql.DriverManager.getConnection(
"jdbc:microsoft:sqlserver://SERVERNAME:1433;selectMethod=cursor;DatabaseName=DBNAME",
"dbxx",
"dbxx00");
java.sql.Statement stmt1 = conn.createStatement();
stmt1.executeUpdate("select * into #ctr from dbxx.ctr_master where 0 = 1");
int ret = -1;
java.sql.Statement stmt2 = conn.createStatement();
java.sql.ResultSet rs = stmt2.executeQuery("select spid from #ctr");
if (rs == null)
System.out.println("Ctr is Empty");
rs.next();
ret = rs.getInt(1);
conn.close();
} catch (java.sql.SQLException s) {
System.out.println("Exception caught: " + s.getMessage());
}
When I execute second statemet, I am getting an error:
[Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Invalid object name '#ctr'.
This works with other JDBC drivers. Why? Is it beacause of the connecton pooling support? Any suggestions.
Thanks
- Next message: Joe Weinstein: "Re: MS JDB driver and temp tables scope"
- Previous message: Sue Purkis: "Re: text datatype support"
- Next in thread: Joe Weinstein: "Re: MS JDB driver and temp tables scope"
- Reply: Joe Weinstein: "Re: MS JDB driver and temp tables scope"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|