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 attempt. Show all posts
Showing posts with label attempt. Show all posts
Monday, March 19, 2012
Wednesday, March 7, 2012
Cannot Start SQL Server Agent
Whenever I attempt to start SQL Server Agent I get the following error message: "An error 5 - (Access is denied) occurred while performing this service operation on the SQLServerAgent service"
I log in to the SQL Server as 'sa'. What could be the possible problem?Originally posted by AlveenX
Whenever I attempt to start SQL Server Agent I get the following error message: "An error 5 - (Access is denied) occurred while performing this service operation on the SQLServerAgent service"
I log in to the SQL Server as 'sa'. What could be the possible problem?
What user is set to startup the SQLAgent service? This user must be added in SQLServer logins and give system administrator rights over the SQLServer.
ionut|||The easy way (i think), on Services, try to put the service starting with the "local system account"|||SQL Server uses a windows account to start the sql server agent service. This user should have preferably administrator rights on the machine where the sql server resides. This user can be a local user ( in that case "local system account" is best, as pal19 already mentioned) or, if the sql server has to communicate with other (sql) servers, a domain user account.
You can change the user account that is used in the enterprise manager. Go to management --> sql server agent --> right click and select properties --> general tab. You can also go to the services tab in the Windows administrative tools and change the properties of the sql server agent service there.|||Thanks Jora, Pal19 and Ionut Calin. SQL Server Agent has eventually started. Thanks so much for your help.
AlveenX
I log in to the SQL Server as 'sa'. What could be the possible problem?Originally posted by AlveenX
Whenever I attempt to start SQL Server Agent I get the following error message: "An error 5 - (Access is denied) occurred while performing this service operation on the SQLServerAgent service"
I log in to the SQL Server as 'sa'. What could be the possible problem?
What user is set to startup the SQLAgent service? This user must be added in SQLServer logins and give system administrator rights over the SQLServer.
ionut|||The easy way (i think), on Services, try to put the service starting with the "local system account"|||SQL Server uses a windows account to start the sql server agent service. This user should have preferably administrator rights on the machine where the sql server resides. This user can be a local user ( in that case "local system account" is best, as pal19 already mentioned) or, if the sql server has to communicate with other (sql) servers, a domain user account.
You can change the user account that is used in the enterprise manager. Go to management --> sql server agent --> right click and select properties --> general tab. You can also go to the services tab in the Windows administrative tools and change the properties of the sql server agent service there.|||Thanks Jora, Pal19 and Ionut Calin. SQL Server Agent has eventually started. Thanks so much for your help.
AlveenX
Friday, February 10, 2012
Cannot replicate non dbo table when dbo table exists
I attempt to replicate a non dbo table, e.g. user1.table1. In the mean time
dbo.table1 exists in both publisher and subscriber and is replicated. When
the replication ran, it drop the dbo.table1 in subscriber and created new
dbo.table1 from user1.table1. How do I replicate non dbo tables when dbo
tables with same names exist?
Thanks!
right click on your publication, select properties, click on the articles
tab, click the browse button, in the general tab make sure that the
destination owner name is the name of the owner you want on the subscriber.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Charts" <Acharts@.newsgroup.nospam> wrote in message
news:FDF72545-7875-491E-B51F-9CECEE79FB4C@.microsoft.com...
>I attempt to replicate a non dbo table, e.g. user1.table1. In the mean
>time
> dbo.table1 exists in both publisher and subscriber and is replicated. When
> the replication ran, it drop the dbo.table1 in subscriber and created new
> dbo.table1 from user1.table1. How do I replicate non dbo tables when dbo
> tables with same names exist?
> Thanks!
>
|||Thanks so much and I'll follow up.
"Charts" wrote:
> I attempt to replicate a non dbo table, e.g. user1.table1. In the mean time
> dbo.table1 exists in both publisher and subscriber and is replicated. When
> the replication ran, it drop the dbo.table1 in subscriber and created new
> dbo.table1 from user1.table1. How do I replicate non dbo tables when dbo
> tables with same names exist?
> Thanks!
>
dbo.table1 exists in both publisher and subscriber and is replicated. When
the replication ran, it drop the dbo.table1 in subscriber and created new
dbo.table1 from user1.table1. How do I replicate non dbo tables when dbo
tables with same names exist?
Thanks!
right click on your publication, select properties, click on the articles
tab, click the browse button, in the general tab make sure that the
destination owner name is the name of the owner you want on the subscriber.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Charts" <Acharts@.newsgroup.nospam> wrote in message
news:FDF72545-7875-491E-B51F-9CECEE79FB4C@.microsoft.com...
>I attempt to replicate a non dbo table, e.g. user1.table1. In the mean
>time
> dbo.table1 exists in both publisher and subscriber and is replicated. When
> the replication ran, it drop the dbo.table1 in subscriber and created new
> dbo.table1 from user1.table1. How do I replicate non dbo tables when dbo
> tables with same names exist?
> Thanks!
>
|||Thanks so much and I'll follow up.
"Charts" wrote:
> I attempt to replicate a non dbo table, e.g. user1.table1. In the mean time
> dbo.table1 exists in both publisher and subscriber and is replicated. When
> the replication ran, it drop the dbo.table1 in subscriber and created new
> dbo.table1 from user1.table1. How do I replicate non dbo tables when dbo
> tables with same names exist?
> Thanks!
>
Subscribe to:
Posts (Atom)