0
ResultSet rs=st.executeQuery("select * from category");
rs.moveToInsertRow();
rs.updateString("cname",c);
rs.insertRow();
rs.moveToCurrentRow();

i want to insert new row in table of sqlserver2000 database the row should insert at last in a table .can i use variable at place of value in updateString("column name","value") the code i m using is here

Edited by rahul pareek

2
Contributors
1
Reply
7
Views
4 Years
Discussion Span
Last Post by LastMitch
0

can i use variable at place of value in updateString("column name","value") the code i m using is here

If you have everything setup correctly then YES you can used this:

rs.moveToInsertRow();
updateString("column name","value") 

But if you don't have it set up correctly

You need something like this:

//CREATE/SELECT query
public static void create()
{CREATE/SELECT query and other code etc..}
//INSERT query
public static void insert()
{INSERT query and other code etc..}
//UPDATE query
public static void update()
{UPDATE query and other code etc..}
//DELETE query
public static void delete()
{DELETE query and other code etc..}

Edited by LastMitch: grammer

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.