JDBC related Problem

JDBC related Problem

View Answers

August 11, 2009 at 12:33 PM

Hi Friend,

We have created a table Table2(name(Text),cl(Number),marks(Number),rollNo(Number)) in MS access database.

Try the following code:

import java.sql.*;
public class Insert {
public static void main(String [] args) {
Connection con = null;
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbc:odbc:access");
Statement st = con.createStatement();
int c = st.executeUpdate("INSERT INTO Table2(name,cl,marks,rollNo) VALUES( 'Naman',3,78,1105)");
System.out.println("1 row affected");
st.close();
con.close();
} catch (Exception e) {
System.err.println("Exception: "+e.getMessage());
}
}
}

Thanks









Related Tutorials/Questions & Answers:
JDBC related Problem - JDBC
JDBC related Problem  Hey plz check out the following code... = "jdbc:odbc:" + ds; try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver... connectivity code ...... my problem is... that even after the successful
JDBC ODBC related problem
JDBC ODBC related problem  i WANT HELP RELATED TO JDBC CONNECTIVITY... con; con = DriverManager.getConnection("jdbc:odbc:Digambar... THE ERROR PART...... THE QUESTION N PROBLEM IS I WANT TO SELECTE PERTICULAR PAPER FROM
Advertisements
problem related to onSubmit() method
problem related to onSubmit() method  Hello, I am developing application.when i submit form at that time formBacking() method is call...Instead of that onSubmit() should have to call .... please help me
code related problem
code related problem  this code is compiling but not running please help import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Mybutton11 extends JFrame { JTextField text1 = new JTextField(20
JDBC related query
JDBC related query  How to merge two resultset of two different queries, wherein both the resultset(after query execution)gives an integer value as its column
jdbc & sql related project - JDBC
jdbc & sql related project  code using jdbc,odbc,swing,MySql classes to create front-end of any jdbc that allows the user to select any database from a list and execute any sql query related to the selected database e.g
jdbc problem
jdbc problem   hi my name is mohit...i am making a project in java swings....pls help me how to check that the username and password are correct..."); con = DriverManager.getConnection("jdbc:odbc:mohit"); stmt
query related to jdbc
query related to jdbc  hello, i have done my database connection successfully ie db2 with RAD. but while running my application i am not able to fetch the data so please suggest and help me
start debugging problems related to the JDBC API
start debugging problems related to the JDBC API  How do I start debugging problems related to the JDBC API
problem in jdbc connection
problem in jdbc connection  when i am trying to insert into apache derby databse using java in netbeans an exceprion is thrown at run time like this:- java.lang.ClassNotFoundException: org.apache.derby.jdbc.ClientDriver....what
jdbc and swing problem in netbeans
jdbc and swing problem in netbeans  i reteived the table from database in a jdbc program. next i want to do is place the table as it is in a jpanel.. i am using netbeans IDE can u tel me how to do that one?? urgent
jdbc and swing problem in netbeans
jdbc and swing problem in netbeans  i reteived the table from database in a jdbc program. next i want to do is place the table as it is in a jpanel.. i am using netbeans IDE can u tel me how to do that one?? urgent
Servlet problem - JDBC
but however. It gives problem sometimes while at others it works perfectly. I m using jdbc-odbc driver. Can anybody help me plzzzz!!!!   Hi Friend
LOGIN PROBLEM - JDBC
LOGIN PROBLEM   sir iam harikrishna studying B.Tech Fourth year sir... and passowrd then my problem is how can we write the code for validating the userid... with JSP AND JDBC can u plz.........send me the code for checking username
java programming problem - JDBC
java programming problem  Hi, Request you to provide the source code in Java for the following programming problem : upload .csv file data into oracle database. please send the solution to [email protected]
dsn problem - JDBC
me how to create dsn (jdbc ) at run time . when we will give our project... to remember to create dsn (jdbc): 1.Create an ODBC DSN Using the Windows... the driver To load the JDBC driver by calling the forName() static method
jdbc oracle connectivity problem
jdbc oracle connectivity problem  Hi All, I am trying to connect my swing application to oracle DB . but class.forname is giving error. Please suggest me if there is some different way to connect swing application to oracle
java programming problem - JDBC
java programming problem  Hi, Request you to provide a solution ( analysis & design & unit test plan & code & test criteria ) to the following problem to the following mail id : Problem : upload excel file data into oracle
Sequence generator problem - JDBC
,but problem is that when i insert a values it will work and inserted the values.this one i am showing in a table ,but problem is a that it is also created a new
mysql problem - JDBC
= "jdbc:mysql://localhost:3306/test"; Connection con=null; try
mysql problem - JDBC
mysql problem   hai friends i have some problem with image storing in mysql. i.e while i am using image(blob) for insert the image it says out of bound of size error. please provide the logic for storing normal maxi size
Problem to get connection from DAO class to JDBC
Problem to get connection from DAO class to JDBC  package controller; import java.sql.Connection; import java.sql.DriverManager; public class... { String DRIVER="oracle.jdbc.driver.OracleDriver"; String URL="jdbc:oracle
mysql installation problem - JDBC
database problem - JDBC
problem in creating web application using servelet, jsp, jdbc and xml - JSP-Servlet
problem in creating web application using servelet, jsp, jdbc and xml  Using Servlet, JSP, JDBC and XML create a web application for a courrier...; Hi friend, For solving the problem visit to : http://www.roseindia.net
StringBuffer related.
StringBuffer related.  how to make StringBuffer as immutable
Ant Script Problem - Ant
Not Found: JDBC driver com.mysql.jdbc.Driver could not be loaded How can I solve this Problem? Regards, K.Senthuran   Hi friend, Your Problem is related to JDBC Driver : Download the mysql-connector-java-3.1.6-bin.jar
related to database
related to database  how to override existing values in table? when user enters his updated data through query
Enhydra Shark Workflow problem - JDBC
Enhydra Shark Workflow problem - JDBC
Related to Histogram
Related to Histogram  hi this is srinivasrao. In my project i have to display using chart for that i want to use histogram. k chart displayed but the values given by me is not related display chart so please give the code if u
related to java
related to java  what is mean of }); in java.i know that } is used to close a block of statement,) is used to close a statement and ";"is used after close a statement but i can not usderstood the use of }); together in a java
Related Questions
Related Questions  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: Related Questions... "Related Questions". Also tell me which is the good training courses
Related to Project
Related to Project  how speech to text project can be make in java? Please tell me the coding part therapeutically i know i have to use java speech api which offer two technology 1. speech recognization 2. speech syenthesis
Related to XML
Related to XML  I have made a web application which send the SMS, i have provided the url in which i have to save the msg and the number's(to whom the message to be send).After fetching the message and numbers i was keeping
Related to XML
Related to XML  I have made a web application which send the SMS, i have provided the url in which i have to save the msg and the number's(to whom the message to be send).After fetching the message and numbers i was keeping
jdbc
jdbc  I can't run my jdbc program because it has error in this line: public static void main(String[] args) the error is:illegal static declaration in inner class would you please let me whats the problem? regards
JDBC in JSP - JDBC
JDBC in JSP   Sir, This is the code showing the problem. regards sreejith
JDBC in JSP - JDBC
JDBC in JSP   Sir, This is the code showing the problem. regards sreejith
Restlet Frame work Related question
Restlet Frame work Related question  How to send data from client to server using Restlet framework. The main problem is i am not able to get data at server side. Can anyone post a complete program how to achieve
ModuleNotFoundError: No module named 'related'
ModuleNotFoundError: No module named 'related'  Hi, My Python... 'related' How to remove the ModuleNotFoundError: No module named 'related... to install padas library. You can install related python with following command
Data base related question
Data base related question  sir my table has only one element... that element .how can i retrieve that element,using jdbc technology. please...=DriverManager.getConnection("jdbc:odbc:oldp"); stmt2=con2.createStatement(); String
jdbc
define transactions  define transactions   Whenever a connection is created by using the JDBC, then by default it is in auto- commit mode...() method. If there arises any problem while committing then the set
Dumps related to weblogic certification
Dumps related to weblogic certification   I want to perform the weblogic certification exam code 1z0-110. Can anybody please provide me the dumps related to 1z0-110 Thanks in advance
Java and jvm related question
Java and jvm related question  What is difference between java data types and jvm data types
question related to overloading
question related to overloading  what is difference between function overloading & method overloading
question related to overloading
question related to overloading  what is difference between function overloading & method overloading
JDBC
JDBC  why we use batch in jdbc
jdbc
jdbc  display the records using index in jdbc
jdbc
jdbc  Hai , Give a steps for jdbc connectivity

Ads