I am using MS-Access as back end for an application that I am developing using java.I have a HTML form which consists of two input boxes.I want to take the values typed in input boxes and add them to the table.I tried using Insert statement but it is not working.I think there is some problem with the code.Though the insert statement is working in MS-Access query but it is not working when I am trying to insert values into the table from the java code.Can anyone please help me? Thanks.
Pranav Jaidka
Ranch Hand
Joined: Sep 14, 2000
Posts: 264
posted
0
hi abdul your query doesnt explain where in your code you are actually going wrong ....... anyway try doing all of the following 1> Register a driver using the Class.forName("driver") statement this drive should be compatible for use with the database you are using; 2> Create a connection to the database using DriverManager.getConnection(); 3> Create an sql statements using the Connection.CreateStatement() method 4> use the executeUpdate() method on the statement to fire the insert statement...... this should work luck pranav
Rajesh Hegde
Ranch Hand
Joined: Sep 15, 2000
Posts: 112
posted
0
Hi, what is the error or exception u are getting u are getting. Also please post the code that is doing the job of insertion. Rajesh
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
hi, i got the same error too. i have got perfect connection with msaccess and my java code queries well, infact it do all the reading stuff from the database very well. the problem arise only when i try to write somethign to the database, either thru INSERT or CREATE, the error msg it gives is suitable driver not found n then it dont connect to the database, but its compiled without any errors. only give runtime errors. someone suggested to me not to use msaccess for these kinda purposes. so i am gonna try SQL SERVER and advise u to do the same too , adios
Abdul Sameer
Greenhorn
Joined: Oct 11, 2000
Posts: 3
posted
0
Hi Rajesh, My code is neither showing any error nor throwing any exceptions.Here is the code.
Please help me.Also Im using servlets. Added UBB CODE tags to preserve indentation [This message has been edited by Frank Carver (edited October 25, 2000).]
Monty Ireland
Ranch Hand
Joined: Oct 03, 2000
Posts: 161
posted
0
Check you JDBC driver doc... You are using a JDBC ver 2.0 feature... Make sure you driver is JDBC ver 2.0 compatiable... Hope this helps...
------------------ We learn more from our mistake's than from our success's. a.k.a. monty6