Hi. I receive the SQLException:
[Microsoft][SQLServer 2000 Driver for JDBC]Can not update, the specified column is not writable.
when I attempt to call updateString() on a RecordSet column. I have set the Statement object on which I execute the query to obtain the RecordSet to be scrollable and updatable.
My goal is to replace the ID value contained in a particular column of each row with a longer text string that includes the ID value. If I can't alter the column values via the RecordSet, can I write SQL as part of the query to generate the text string?
Thank you.
RajCan You write a little example: what You have and what You want...
And your table's structure... if it is possible. and sqlsrv version.|||Hi. We run SQL Server 2000. I call the code that creates the Statement, executes the ResultSet, and outputs the results in separate methods, so here I include a summary of the code.
Statement statement = connection.createStatement(ResultSet.TYPE_SCROLL_I NSENSITIVE, ResultSet.CONCUR_UPDATABLE);
...
rs = statement.executeQuery(queryString);
...
WriteEditSCRLinks(rs);
Here's the definition of WriteEditSCRLinks().
//Replaces each SCR ID with a hyperlink that opens the edit SCR page on the ID.
//Method needs to input an updatable, scrollable RecordSet.
void WriteEditSCRLinks(ResultSet rs) throws SQLException
{
String FieldName = "SCRID";
while (rs.next())
{
String IDValue = rs.getString(FieldName);
String UpdateString = "<A HREF=\"" + SiteConfigHelper.getEditSoftwareChangeRequestURL() + "?" + FieldName + "=" + IDValue + "\">" + IDValue + "</A>";
rs.updateString(FieldName, UpdateString);
}
//Need to move the cursor to the position before the first row
//so as not to break GraphingHelper methods.
rs.beforeFirst();
}
Since someone told me that the JDBC object model does not intend for me to alter the ResultSet if I shall not alter the database, I have to solve this problem in a different way anyway. However, I would appreciate knowing whether the concept of updating the ResultSet differs from the concept of writing to a column.
Thank you.
Raj
Showing posts with label driver. Show all posts
Showing posts with label driver. Show all posts
Monday, March 19, 2012
Sunday, February 12, 2012
cannot run DTS Package from SQL Query Analyzer
I attemped to run dts package to transform data from AS400/DB2 by using Client Access ODBC ( Ms Windows 2000 Server, Ms SQL 2K, Client Access Driver 4.5)
but the result of testing has messed me up
because when i used this command via SQL Query Analyzer
exec master..xp_cmdshell 'DTSRun /S "MySVR" /U "sa" /N "dtsTEST" /G "{482209FD-0891-11D8-868C-00E0299B4BCF}" /A "G1":"8"="200310" /W "0"'
but it doesn't work
I wonder why.. because it can be executed in MS-Dos prompt successfully.
if I type
DTSRun /S "MySVR" /U "sa" /N "dtsTEST" /G "{482209FD-0891-11D8-868C-00E0299B4BCF}" /A "G1":"8"="200310" /W "0"
in the command line.
If somebody know please give me some advice (urgently!!).What is the error?
When run from dos it will be run on your client m/c. When from query analyser on the server using the sql server service account (probably)
Try logging on to the server as the sql server service account and running it in the designer and see what happens.|||I didn't run dos-command on Client M/C, I tested on Server M/C itself
and it success.
But when I tried to run by query analyzer, it takes much time (> 20 min and nothing happens) for executing and there was no error show on the screen. so I had to kill the process because it seemed not work .
And this process I tested on Server M/C also, by using Sql Admin (sa).
How could I solve this problem?|||It can be run properly in DTS Designer, but cannot run in Query analyzer.|||Does it have any user interaction - have you left in a debug msgbox?
I meant the account that the sql server service uses to logon - see services.
Maybe it needs access to something that this account doesn't have permission on.|||I checked already that the log on user-id has full permission, and the sign on user name and password for AS400 has been specify in DSN that use via client access express driver by setting the sign on information as 'use windows user name and password, no promping'.
If this problem is related to the security of sql server, why it can be run in DTS Designer(which has no pop up message box for user interface) with no popup error message and the result of transformation is correct.|||Because dts is a client application.
When you run it from query analyser the client is the server which gives it a different environment.
If you have already run it from the sql server service account then that limits the things that can be wrong.
Try turning on logging to see if any steps are run and what the error is.|||why i can run DTS Package in query analyzer if i change the source of DTS to be MsAccess file, on the server m/c not client. run in command line, no problem also.
why i cannot run in query analyzer if i specified source DSN as AS400/DB2, but run properly in command line by using same script.
but the result of testing has messed me up
because when i used this command via SQL Query Analyzer
exec master..xp_cmdshell 'DTSRun /S "MySVR" /U "sa" /N "dtsTEST" /G "{482209FD-0891-11D8-868C-00E0299B4BCF}" /A "G1":"8"="200310" /W "0"'
but it doesn't work
I wonder why.. because it can be executed in MS-Dos prompt successfully.
if I type
DTSRun /S "MySVR" /U "sa" /N "dtsTEST" /G "{482209FD-0891-11D8-868C-00E0299B4BCF}" /A "G1":"8"="200310" /W "0"
in the command line.
If somebody know please give me some advice (urgently!!).What is the error?
When run from dos it will be run on your client m/c. When from query analyser on the server using the sql server service account (probably)
Try logging on to the server as the sql server service account and running it in the designer and see what happens.|||I didn't run dos-command on Client M/C, I tested on Server M/C itself
and it success.
But when I tried to run by query analyzer, it takes much time (> 20 min and nothing happens) for executing and there was no error show on the screen. so I had to kill the process because it seemed not work .
And this process I tested on Server M/C also, by using Sql Admin (sa).
How could I solve this problem?|||It can be run properly in DTS Designer, but cannot run in Query analyzer.|||Does it have any user interaction - have you left in a debug msgbox?
I meant the account that the sql server service uses to logon - see services.
Maybe it needs access to something that this account doesn't have permission on.|||I checked already that the log on user-id has full permission, and the sign on user name and password for AS400 has been specify in DSN that use via client access express driver by setting the sign on information as 'use windows user name and password, no promping'.
If this problem is related to the security of sql server, why it can be run in DTS Designer(which has no pop up message box for user interface) with no popup error message and the result of transformation is correct.|||Because dts is a client application.
When you run it from query analyser the client is the server which gives it a different environment.
If you have already run it from the sql server service account then that limits the things that can be wrong.
Try turning on logging to see if any steps are run and what the error is.|||why i can run DTS Package in query analyzer if i change the source of DTS to be MsAccess file, on the server m/c not client. run in command line, no problem also.
why i cannot run in query analyzer if i specified source DSN as AS400/DB2, but run properly in command line by using same script.
Subscribe to:
Posts (Atom)