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

Ads

 
 

Share on Google+Share on Google+

pranay
error is "column cannot be inserted".........give send me the ans
1 Answer(s)      6 years and 2 months ago
Posted in : JDBC

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()); }

} }

Ads
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.


Ads









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
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
send me example of jmsmq - JMS
send me example of jmsmq  please send me example about jmsmq (java microsoft message queuing ) library
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
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
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 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
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
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
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
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