Wednesday, March 28, 2012
Reg. MS SLQSRVER 2000 driver (sp 1) driver for jdbc
I am writing jsp pages on JRUN (DM2k MX) server connecting to MS SQLServer 2000 dbase. using
MS SQLServer 2000 driver for JDBC (SP 1).
Everything is working fine, except when I try to access the result set, ( which is storing my query results),
I have a JSP scriptlet as below
//successfully connect a
// exceutet the query a
// store the result in ResultSet rs
<%
while (rs.next())
{
%><option value=<%=rs.getString("DeptName")%></option><%
}
%>
Each time this code runs, it skips the first record. I tried placing the cursor before the first record , prior to entering the
while loop, by
1) rs.beforeFirst()
or
2)
if (rs.getRow() == 2)
{
rs.absolute(1);
//rs.first();
}
which should force it to goto the first record. but botjh 1 & 2 failed and the error was
MS SQLServer 2000 driver for jdbc do not support beforeFirst / First
How do I get around this problem? Is this a bug in the driver or am I missing something?
Thanks in advance
How exactly are you populating the resultset? Do you see the same behavior
from a standalone JDBC program? Below is a code snippet that connects to
Northwind database. It retrieves the data without skipping the first row:
Class.forName("com.microsoft.jdbc.sqlserver.SQLSer verDriver");
con = java.sql.DriverManager.getConnection(url, userName, password);
String query = "SELECT * from Customers";
//Option 1
PreparedStatement stmt = con.prepareStatement(query);
ResultSet rs = stmt.executeQuery();
//Option 2
//Statement stmt = con.createStatement();
//ResultSet rs = stmt.executeQuery(query);
while(rs.next())
{
System.out.println("Contact Name: " + rs.getString("ContactName"));
}
rs.close();
stmt.close();
con.close();
con=null;
Give this code a try to see if the behavior is the same. Do you see the
same behavior with JDBC SP2?
Carb Simien, MCSE MCDBA MCAD
Microsoft Developer Support - Web Data
Please reply only to the newsgroups.
This posting is provided "AS IS" with no warranties, and confers no rights.
Are you secure? For information about the Strategic Technology Protection
Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.com/security.
| Thread-Topic: Reg. MS SLQSRVER 2000 driver (sp 1) driver for jdbc
| thread-index: AcQiWoPDPDw+LtmiRSmrZYKbSsks1w==
| X-WN-Post: microsoft.public.sqlserver.jdbcdriver
| From: "=?Utf-8?B?U3VtYUpEQkM=?=" <anonymous@.discussions.microsoft.com>
| Subject: Reg. MS SLQSRVER 2000 driver (sp 1) driver for jdbc
| Date: Wed, 14 Apr 2004 12:56:02 -0700
| Lines: 42
| Message-ID: <F9963AEF-09BA-428A-B5C9-12505D15AE9F@.microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.sqlserver.jdbcdriver
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.sqlserver.jdbcdriver:5891
| NNTP-Posting-Host: tk2msftcmty1.phx.gbl 10.40.1.180
| X-Tomcat-NG: microsoft.public.sqlserver.jdbcdriver
|
| Hi
I am writing jsp pages on JRUN (DM2k MX) server connecting to MS SQLServer
2000 dbase. using
MS SQLServer 2000 driver for JDBC (SP 1).
Everything is working fine, except when I try to access the result set, (
which is storing my query results),
I have a JSP scriptlet as below
//successfully connect a
// exceutet the query a
// store the result in ResultSet rs
<%
while (rs.next())
{
%><option value=<%=rs.getString("DeptName")%></option><%
}
%>
Each time this code runs, it skips the first record. I tried placing the
cursor before the first record , prior to entering the
while loop, by
1) rs.beforeFirst()
or
2)
if (rs.getRow() == 2)
{
rs.absolute(1);
//rs.first();
}
which should force it to goto the first record. but botjh 1 & 2 failed and
the error was
MS SQLServer 2000 driver for jdbc do not support beforeFirst / First
How do I get around this problem? Is this a bug in the driver or am I
missing something?
Thanks in advance
|
sql
Friday, March 9, 2012
reference material
and explainations thanksSQL Server 2000 Books Online is a must-have FREE reference for SQL Server.
Terri|||thank you
Wednesday, March 7, 2012
Reducing the PDF File Size
I'm using MS SQL 2000's Reporting Services. Our output PDFs are usually composed of fifteen or more pages. Our file size typically exceeds 2 MB per report, I was testing the report on sample outputs and I was getting around 40kb per chart and each of our pages are typically composed of 2-3 charts.
Is there a tweak that can be applied to reduce the file size of the output pdf?
Thanks,
EdwardDO you have any images rendered into the report ? As the report is based on Adove 4 definitions its limitated to the rendering compressions.
HTH, Jens SUessmeyer.
http://www.sqlserver2005.de|||Yes there are images, from the outputs I've generated that does not include any chart the file size is significantly smaller around 8kb per page. The majority of the file size is made up of the charts themselves.
Are you saying that the file size increase caused by the charts cannot be reduced any further due to rendering compressions?|||I guess this is probably the case. WHich version / SP are you currently running ? Ther ehvae been some iprovements on the Reporting rendering during the history of the Service pack development.
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
|||The version I am currently running on the server is:8.0.1038.0
What service pack version does this belong to?
Thanks.|||Thats the most recent service pack, its service pack 2. SOrry, but there are no more other tweaks that come in my mind. We once had the problem that images (blobs) from the database weren′t compressed properly, because the rendering mechanism could not handle the images in a right way, this was fixed in a Service Pack (I think is was service pack 2)
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de|||An issue has been opened for this problem. Please add your vote. https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=232211
Reducing the PDF File Size
I'm using MS SQL 2000's Reporting Services. Our output PDFs are usually composed of fifteen or more pages. Our file size typically exceeds 2 MB per report, I was testing the report on sample outputs and I was getting around 40kb per chart and each of our pages are typically composed of 2-3 charts.
Is there a tweak that can be applied to reduce the file size of the output pdf?
Thanks,
EdwardDO you have any images rendered into the report ? As the report is based on Adove 4 definitions its limitated to the rendering compressions.
HTH, Jens SUessmeyer.
http://www.sqlserver2005.de|||Yes there are images, from the outputs I've generated that does not include any chart the file size is significantly smaller around 8kb per page. The majority of the file size is made up of the charts themselves.
Are you saying that the file size increase caused by the charts cannot be reduced any further due to rendering compressions?|||I guess this is probably the case. WHich version / SP are you currently running ? Ther ehvae been some iprovements on the Reporting rendering during the history of the Service pack development.
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
|||The version I am currently running on the server is:8.0.1038.0
What service pack version does this belong to?
Thanks.|||Thats the most recent service pack, its service pack 2. SOrry, but there are no more other tweaks that come in my mind. We once had the problem that images (blobs) from the database weren′t compressed properly, because the rendering mechanism could not handle the images in a right way, this was fixed in a Service Pack (I think is was service pack 2)
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de|||An issue has been opened for this problem. Please add your vote. https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=232211