RE: Atteched DB's only "read only"
- From: jaavedm@microsoft (Jaaved Mohammed)
- Date: Wed, 09 Aug 2006 01:05:15 GMT
Hi Matt,
I tried to repro the behavior you are seeing on both MS SQL Server 2000 and
2005 but was unsuccessful. Can you elaborate on how the database was
detached, and the JDBC Driver version used? Additionally, snippets of java
code and the exception stack trace would greatly help. My snippet of code
that worked for me was:
Statement stmt = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY,
ResultSet.CONCUR_UPDATABLE);
stmt.executeUpdate("use master");
stmt.executeUpdate("exec sp_attach_db @dbname=N'Sampledb', @filename1=N'" +
primary + "', @filename2=N'" + logs + "'");
stmt.executeUpdate("use Sampledb");
stmt.executeUpdate("create table test (c1 int)");
stmt.executeUpdate("insert into test values(888)");
ResultSet rs = stmt.executeQuery("select * from test");
rs.updateInt(1, 12345);
rs.updateRow();
Thanks,
Jaaved Mohammed [MSFT]
.
- Follow-Ups:
- RE: Atteched DB's only "read only"
- From: MattHHDE
- RE: Atteched DB's only "read only"
- Prev by Date: Re: SMALLINT datatype conversion error
- Next by Date: Re: JDBC and Virtual Machines
- Previous by thread: Re: SMALLINT datatype conversion error
- Next by thread: RE: Atteched DB's only "read only"
- Index(es):
Relevant Pages
|
Loading