Raj Verma

Greenhorn
+ Follow
since Apr 17, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Raj Verma

Smita, here is the code. The data[][] stores one row and according to the type of the column, it executes updates.
ResultSetMetaData metaData; //Initialized in other proc
ResultSet resultSet; //Initialized in other proc

String[][] data; //holds a single row at a time along with col
// names. eg data[0][0] = colname &
// data[0][1] = value of colname
resultSet.moveToInsertRow();
for(int i = 0; i < data.length; i++)
{
colPos = resultSet.findColumn(data[i][0]);
switch (metaData.getColumnType(colPos))
{
case Types.INTEGER :
if (metaData.isAutoIncrement(colPos) == false)
{
resultSet.updateInt(data[i][0], Integer.parseInt(data[i][1]));
}
break;
case Types.VARCHAR :
resultSet.updateString(data[i][0], data[i][1]);
System.out.println("hey default");
break;
}
}
resultSet.insertRow(); // This is the place where the error
// occurs
Hope this code is clear. Please let me know if you have any questions.
Hi all,
I am trying to insert a row in Access db using resultSet.moveToInsertRow() and then resultSet.insertRow. But it gives me the following error which occurs when it tries to execute resultSet.insertRow statement.
java.lang.ArrayIndexOutOfBoundsException
at sun.jdbc.odbc.JdbcOdbcResultSet.bindCol(JdbcOdbcResultSet.java:4485)
at sun.jdbc.odbc.JdbcOdbcResultSet.insertRow(JdbcOdbcResultSet.java:3941)
I am using updateXXX to update the columns.
I can connect to database and navigate through the resultset, but problem occurs only while inserting a row.
Can anyone please guide me to work around this problem.
Thanks
Thanks once again Cindy. I think, I can get it now.
23 years ago
Thanks for your response Cindy, but Can I open multiple panels in JFrame window ??
My main JFrame has menu, and on Menu I have menu items like : Customer, Account, Transaction. What I want to do is open Customer window, but it should be contained in the main JFrame, and then if I want to, I can open Account or Transaction window also.
Hope it wasnt confusing.
23 years ago
I am trying to create an application and my main frame for the application is JFrame. I want all the other windows to be contained in this JFrame, but they should not have the title bar, as in VB or PB where they are called child window. Is there anyway I can do it. I have tried using JInternalFrame.
Thanks
23 years ago