import java.sql.*;
import sun.jdbc.odbc.JdbcOdbcDriver;
class Jdbc1
{
public static void main(String[] args) throws Exception
{
JdbcOdbcDriver jd=new JdbcOdbcDriver();
DriverManager.registerDriver(jd);
Connection con=DriverManager.getConnection("jdbc:odbc:sai123","SYSTEM","sai123");
Statement st=con.createStatement();
int res=st.executeUpdate("insert into A1 values('1','tomato','10')");
System.out.println(res+"record is inserted..");
st.close();
con.close();
}
}
and I have creates the table as:
CREATE TABLE A1(
INO INTEGER NOT NULL,
INAME CHAR(30) NOT NULL,
IPRICE INTEGER NOT NULL
);
When I compile and run the java prog it says "1 record inserted.." but when I open my table in SQLdeveloper I dont find any updates in the table. They are all null! I have also set the classpath for ojdbc-6.jar. What mistake am I doing herE? Are there any other files that I should copy and paste? I am just a beginner so kindly please help. And how does my program in the Editplus direct the updates directly into the table created in SQL. What path does it follow?
SYSorSYSTEMaccount...SYSTEM(see docs.oracle.com/cd/E11882_01/server.112/e25789/…), and especially don't create tables there. It's very difficult to get rid of the space you requested for your test tables. Do you need instructions how to create a user?