Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
I still don't get it. As I see it, you don't need to "fetch the table name". The table name is always the same, "agents", right?In ur previous reply u mentioned the database name which i was asking u about.how do I do that.retrieve table name by passing the database name.
If you have a static boolean variable in your servlet class, which you set to true/false during the first execution, then all subsequent executions know that they shouldn't try to delete and recreate the table.Having problem with the particular stuff as to how should the value of flag be true once the program is re run again.
What's the difference between passing the table name and passing the database name? You can use HttpServletRequest.getParameter(...). Although, I still think you should just hardcode the table name to "agents".Again the database name has to be passed in the parameter "tt".How do I do that?Passing the table name is pretty easy and just for testing purpose I'm doing that,but ultimately as per the question I'll have to pass the database name.
I don't know a damn thing about MS Access so I can't say whether the database name needs to be a full path or something else. Ask this in the JDBC forum (and only this, not the whole XXX lines of text and code!).The database name is agentpro.mdb and agents table resides here.So when I pass the parameter I will have to pass the complete path "c:\clydemelly\agentpro.mdb".Correct me if I am going wrong.
Does the executeUpdate() throw an exception? Is "OID" a primary key field?For the insert and rejected records how do i go about.The code
...
Now lets say there are no records in the database.So when i run the program i get 1 as the number of record inserted.When I re run the program i get 1 as the number of record rejected.
I'll see if I have time.Lasse please help me find something on the schema and java mail attachment stuff(combination).Some sample and running program,close enough to my assignment will really help me out.
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
what is the error about in the schema.can't figure out.
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
I had another query as how do i access the error method as the SaxError class is closed.Just check.
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
MailServlet shouldn't extend the SAXError class--it should just use it. Also, I'm pretty sure that the compiler should catch method visibility problems at compile-time.Originally posted by clyde melly:
Lasse for your previous reply,my mailServlet is not extending this SAXError class.Just check,coz I am getting an error when i run the program stating that the function geterrorcodes is inaccesible.
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
The problem is that your code doesn't catch the SQLException thrown when the primary key constraint is violated and control jumps to the closest catch block.Originally posted by clyde melly:
When I try to insert for the first time I get 3 as number of records inserted.Thats correct.When try to again insert through the same file,then for ino=201 i get rejected record as 1 and the program terminates.Does not read ahead for ino=701 and 202.In the database the iatanumber field is primary key.I require it reads ahead and rejected number is 3.
What does "specify" mean?Originally posted by clyde melly:
I will get xx in the end.But how do i specify it in the xml format?
You define a class that has implements DataSource as part of its signature. Then, you add methods that match the ones defined in the DataSource interface. Once you done this, you can say "new MyDataSource()" or something similar.Originally posted by clyde melly:
Went through DataSource Interface and checked the methods.But how do I create an instance of it.
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Originally posted by clyde melly:
Lasse how do i tackle with the problem of the rejected records then.I had checked earlier and it when into the catch block.Senderror method??u try it out if u think there shud not be an error.Regarding the datasource and rejected xml file stuff.Sorry just forget abt the code tags.Will keep in mind further on.
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Yes? You need to return something that extends java.io.InputStream. If you'll take a look at what other classes are available in the java.io package, you'll find something suitable. Similarly, your DataSource implementation needs to implement the getOutputStream() method by returning something that extends java.io.OutputStream.Originally posted by clyde melly:
for datasource the inputstream method??
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Originally posted by clyde melly:
lasse just check the rejected xml file.in ur previous reply u asked specify.I have to put it in that format.If its a duplicate record have to capture all the info and dispaly it as a xml file.That wud be used in the body part as an attachment.
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Originally posted by clyde melly:
Lasse just simply plug in the values.Thats it.Coz for a rejected record i have to get all info from name to tradingaddress,legaladdress.??.
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Enjoy the full beauty of the english language. Embedded in this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|