Class.forName("oracle.jdbc.driver.OracleDriver");
Connection connect =DriverManager.getConnection("jdbc:oracle:thin:@172.17.0.14:1521:develop","username","password");

String qry=("update sample set one=2 where two=3");
PreparedStatement ps = null;
ps=connect.prepareStatement(qry);

int i=ps.executeUpdate();
if(i==1)
    out.println("success");
else
    out.println("failed");

The above code is not working

The table is create table (one number,two number);
i tried some other queries like select and delete and insert is working fine then how to resolve this

Does your query work when you try it on your query builder?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.