error is "column cannot be inserted".........give send me the ans

error is "column cannot be inserted".........give send me the ans

DataInputStream dis; try { dis=new DataInputStream(System.in); System.out.println("enter no. of records to be inserted"); int nrec=Integer.parseInt(dis.readLine()); Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:test","scott","tiger"); Statement st=con.createStatement(); for(int i=1;i<=nrec;i++) { System.out.println("pno");

         int pno=Integer.parseInt(dis.readLine());
          System.out.println("pname:");
          String pname=dis.readLine();
           System.out.println("page:");
           int page=Integer.parseInt(dis.readLine());
          String query="insert into person values("+pno+","+pname+","+page+")";
          st.executeUpdate(query);
          System.out.println("record inserted");
     }

st.close(); con.close(); } catch(Exception e) { System.out.println(e.getMessage()); }

} }

View Answers

July 19, 2011 at 4:04 PM

Please visit the following link:

http://www.roseindia.net/tutorial/java/io/insertFileData.html

Above link will be helpful for you. Just change the driver you want to use.









Related Tutorials/Questions & Answers:
error is "column cannot be inserted".........give send me the ans
error is "column cannot be inserted".........give send me the ans  ...); System.out.println("enter no. of records to be inserted"); int nrec...); System.out.println("record inserted"); } st.close
error please send me the solution
error please send me the solution  HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception
Advertisements
error please send me the solution
error please send me the solution  HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception
how to send email please give me details with code in jsp,servlet
how to send email please give me details with code in jsp,servlet  how to send email please give me details with code in jsp,servlet
StringIndexOutOfBound error !!! plz give me the reason for this error ,plz.........
StringIndexOutOfBound error !!! plz give me the reason for this error ,plz.........  import java.util.Scanner; class Even { static int getEven(int firstno,int secondno) { int counteven=0; for(int i=firstno;i<=secondno;i
Please give me the answer.
"int a=08 or 09" its giving compile time error why   "int a=08 or 09" its giving compile time error why ? can any one give me the answer of this please
plz give me answer
plz give me answer  Discuss & Give brief description about string class methods   Java string methods
plz give me answer
plz give me answer   description about string class methods   Java string methods
plz give me answer
plz give me answer   description about string class methods   Java string methods
plz give me answer
plz give me answer   description about string class methods   Java string methods
GIVE ME A ANSWER
GIVE ME A ANSWER  Discuss the Number Class in the java.lang package   Number class is an abstract class extended by all classes that represent numeric primitive types such as Byte, Short, Integer, Long, Float
Please give me coding for this..
Please give me coding for this..  Write an application that inputs one number consisting of five digits from the user.separates the number ibto its individual digits and prints the digits separated from one another by three
give me a grid example in php
give me a grid example in php  give me easy code example of grid in php like mysql editor
send me example of jmsmq - JMS
send me example of jmsmq  please send me example about jmsmq (java microsoft message queuing ) library
plz give me answer plz
plz give me answer plz  writw a programme to find rank from an array using doubledimmensionalarray
Plz give me code for this question
Plz give me code for this question  Program to find depth of the file in a directory and list all files those are having more number of parent directories
error log and send Database
error log and send Database  hi my requirement is validate xml and xsd in java.If there is an errors then i will log error and store into error table. so plz if any one knows send code urgent. error table details
ModuleNotFoundError: No module named 'give_me_code'
'give_me_code' How to remove the ModuleNotFoundError: No module named 'give_me_code' error? Thanks   Hi, In your python...ModuleNotFoundError: No module named 'give_me_code'  Hi, My Python
hi see and give me reply as soon as possible
hi see and give me reply as soon as possible  Hi Friend, I got path,but it will again ask path error first i was gave index.jsp.It.../hello) is not available. JBoss Web/2.1.2.GA above error will displayed pls
please send me the answer - JDBC
please send me the answer -difference between DriverManager and DataDourse   what is Datasourse? What r the advantages? what is the difference between DriverManager and DataDourse
Give me the source code for this problem
Give me the source code for this problem  Ram likes skiing a lot. That's not very surprising, since skiing is really great. The problem with skiing is one have to slide downwards to gain speed. Also when reached the bottom most
Plz send me answer quckly
Plz send me answer quckly  Respected Sir, myself is pavan shrivastava.i want ask a question that is ( we can't create object of interface then how would possible to create object
please send me the banking data base in swings
please send me the banking data base in swings  sir, please send me how to create the banking data base program in swings
please help me to give code - Java Beginners
please help me to give code  Write a function with a signature cheerlead(word) that prints a typical cheer as follows. The word robot: Gimme an R Gimme an O Gimme a B Gimme an O Gimme a T What did you give me? ROBOT
please give me an idea to develop a program for this question?
please give me an idea to develop a program for this question?  How to enter a text or number from keyboard without using InputStreamReader method in java
please help me to give code - Java Beginners
please help me to give code  Write a function, sliding(word, num)that behaves as follows. It should print out each slice of the original word having length num, aligned vertically as shown below. A call to sliding(examples, 4
please help me to give code - Java Beginners
please help me to give code  Write a program that uses loops to generate an n x n times table. The program should get n from the user. As a model here is a 4 x4 version: | 1 2 3 4
please help me to give code - Java Beginners
please help me to give code  Write a program that prints an n-level stair case made of text. The user should choose the text character and the number of stairs in the stair case * ** *** ****   Hi friend
Send me Binary Search - Java Beginners
Send me Binary Search  how to use Binary think in java give me the Binary Search programm thx..  Hi friend, import java.io.*; public class BinarySearchDemo { public static final int NOT_FOUND = -1
help me in solving this error
help me in solving this error  Hello, i have installed tomcat 6.0, i am getting following error while running application. java.lang.NullPointerException org.apache.jsp.loginjsp.jspInit(login_jsp.java:23
please help me to give code - Java Beginners
please help me to give code  Write a program that reads a file named famous.txt and prints out the line with the longest length. In the case of a tie, you may print out only one of them. For example in the file: Alan Turing
verify the code and give me the code with out errors
verify the code and give me the code with out errors   import... clear the errors and give me correct tutorial for my knowledge improving.pls anyone help me. E:\>java add java.lang.NullPointerException at add
please give me a java program for the following question
please give me a java program for the following question  Write a java program that displays multiple frames : Step 1: Design a frame with three buttons: ?Fruit?, ?Bird? and ?Animal? Step 2: On clicking ?Fruit? button
send me javascript code - Java Beginners
send me javascript code  please send me code javascript validation code for this html page.pleaseeeeeeeee. a.first:link { color: green;text-decoration:none; } a.first:visited{color:green;text
pls give me answer ae soon as possible - Ajax
pls give me answer ae soon as possible  i m writing code of ajax technology ...but it is not working pls check it n give me response quickly... give me quick response!!! thanks & regards shashank gupta
please give me an example about shopping cart using spring and hibernate
please give me an example about shopping cart using spring and hibernate  who can give me an ex about shoppingcart using spring and hibernate intergration ? thanks alot
Can you give me Hibernate one to one example?
Can you give me Hibernate one to one example?  Hello there, Can you give me a hibernate one to one example that explain the concept and mapping in Hibernate. Thanks in advance
give me source code of webpage creation using html
give me source code of webpage creation using html  how to create a webpage using html
Hi Every One , please give me some idia to opning audio File . please Help ..
Hi Every One , please give me some idia to opning audio File . please Help ..  hi Dear Friend , please give me a program to opening audio file... (Button),and play agian by Replay (Button) . thinks so much Dear . please ans
Can you give me a simple Hibernate Sessionfactory example?
Can you give me a simple Hibernate Sessionfactory example?  Hi, I would like to get session instance from the SessionFactory interface in Hibernate 4. Can you give me a simple Hibernate Sessionfactory example for the above
hi... pls give me the example of java coding fo following question
hi... pls give me the example of java coding fo following question  example java coding that reads in the radius and length of cylinder and computes volume. formula: Area = radius * radius * PI Volume = area * length
hi.. please give me a java coding for the following question
hi.. please give me a java coding for the following question  Write a program that prompts the user to enter the number of students and each studentā??s name and score, and finally displays the name of the students
Give me some java Forum like Rose India.net
Give me some java Forum like Rose India.net  Friends... Please suggest some forum like RoseIndia.net where we can ask question like here. Thanks
Give me some java Forum like Rose India.net
Give me some java Forum like Rose India.net  Friends... Please suggest some forum like RoseIndia.net where we can ask question like here. Thanks
hi.. please give me a java coding for the following question
hi.. please give me a java coding for the following question  Write a program that reads in investment amount, annual interest rate, and number of years, and displays the future investment value using the following formula
hi.. please give me a java coding for the following question
hi.. please give me a java coding for the following question  Write a program that displays the following table (note that 1 mile is 1.609 kilometers). Miles Kilometers
hi.. please give me a java coding for the following question
hi.. please give me a java coding for the following question  Suppose that the tuition for a university is RM10,000 this year and increases 5% every year. Write a program that computes the tuition in ten years and the total cost
hi.. please give me a java coding for the following question
hi.. please give me a java coding for the following question  Write a function called ChangeToNext that take in an uppercase character parameter ch. The function returns the next uppercase character if ch is between 'A' and 'Y
Can you give me some good factory pattern examples?
Can you give me some good factory pattern examples?  HI, I am looking for some factory pattern examples to learn about them, if you can point me towards some of the examples that would we very helpful. Thanks   Hello
hi... pls give me the example of java coding for following question
hi... pls give me the example of java coding for following question   Write a program that computes loan payments. The loan can be a car loan, a student loan, or a home mortgage loan. The program lets the user enter the interest

Ads