Solved

Servlets and Databases (msterjev  again) and the other experts

Posted on 2002-04-06
2
136 Views
Last Modified: 2013-11-24
I did not say it was wrong msterjev.

The thing is I am trying to insert one value into 2 tables contained in the database after checking whether it already exist or not and then give a message if it does or continue adding to the two specified tables in the servlet code. eg if a name is entered in the html page . the servlet should be able to add it into the two tables. I quite aware that you can be helpful again. Sample codes will be appreciated.

And (msterjev) thank you for the loggin servlet sample code which can be easily understood.

Thank

You
0
Comment
Question by:wbmorapedi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 3

Expert Comment

by:msterjev
ID: 6922973
Could you remaind me which code I gave to you was wrong, and what is problem with that code?
0
 
LVL 3

Accepted Solution

by:
msterjev earned 20 total points
ID: 6923122
I think this can help you:
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
          Connection connection=DriverManager.getConnection("jdbc:odbc:Imenik");
          Statement statement=connection.createStatement();
statement.executeUpdate("INSERT INTO Table1 VALUES(....));
statement.executeUpdate("INSERT INTO Table2 VALUES(....));
statement.close();
connecitonc.close();


You can transfer user's data across the servlets using Session.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question