The Artima Developer Community
Sponsored Link

Java Answers Forum
PrepareStatement and Microsoft Access ...

2 replies on 1 page. Most recent reply: May 12, 2003 5:29 AM by Dhrubo

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
M Johnson

Posts: 4
Nickname: manova
Registered: Apr, 2003

PrepareStatement and Microsoft Access ... Posted: May 4, 2003 1:19 AM
Reply to this message Reply
Advertisement
Is that true the Microsoft doesn't support the prepareStatement functionality? If not, then could anyone tell me what's wrong with my following code that fails to delete records from an Access database.

Thanx.

************************************************************
public void method(String[] key)
{
...
...
try
{
int i;

sql= "DELETE FROM table WHERE key = '?'";
prestmt = conn.prepareStatement(sql);

for(i=0; i<key.length; i++)
{
prestmt.setString(1, key<i>);
prestmt.executeUpdate();
}
}
...
...
}
************************************************************


Adam Duffy

Posts: 168
Nickname: adamduffy
Registered: Feb, 2003

Re: PrepareStatement and Microsoft Access ... Posted: May 12, 2003 2:25 AM
Reply to this message Reply
> prestmt.setString(1, key<i>);

I'm sure you have this line correct in your actual code (your compiler would complain if it was still like this) but it should read

prestmt.setString(1, key[i]);


Adam

Dhrubo

Posts: 32
Nickname: dhrubo
Registered: Mar, 2003

Re: PrepareStatement and Microsoft Access ... Posted: May 12, 2003 5:29 AM
Reply to this message Reply
Please check yr driver documentation

Flat View: This topic has 2 replies on 1 page
Topic: foreach equivalent in java Previous Topic   Next Topic Topic: help with snmp implementations in java

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use