I am retriving data from database.TableName:Contacts. There are two fields of this table.First_Name and Last_Name. I want to merge these two columns and want one column of JTable as Full Name.I’ve tried to create concat sql query,which was:
String queryMerge="select (First_Name||Last_Name) as Full_Name from Contacts";
But it gave me an error:
[Microsoft][ODBC Microsoft access driver] Invalid use of vertical bars in query expression '(First_Name||Last_Name)'
I thought to store all retrieved data in vector and use that values to build JTable.I am using AbstractTableModel.Is there any other way to solve this problem?
Merging the data in the SQL query should work fine, you just need to get the syntax right.
Another option is when you are pulling the columns out of the
ResultSet, combine them before putting them in the table’s model.