JTable - Help with column names and rowselection
Hi,
Is there anyone that can help me. I have successfully been able to load a JTable from an MS access database using vectors. I am now trying to find out how to hardcode the column names into the JTable as a string.
Can anyone please also show me some code on how to be able update a value in a cell (from ''N'' to ''Y'') by double clicking on that row.
How can I make all the other columns non-editable.
Here is my code:
private JTable getJTable() {
Vector columnNames = new Vector();
Vector data = new Vector();
try
// Connect to the Database
String driver = "sun.jdbc.odbc.JdbcOdbcDriver";
// String url = "jdbc:odbc:Teenergy"; // if using ODBC Data Source name
String url = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=C:/Documents " +
"and Settings/Administrator/My Documents/mdbTEST.mdb";
String userid = "";
String password = "";
Class.forName( driver );
Connection connection = DriverManager.getConnection( url, userid, password );
// Read data from a table
String sql = "select * from PurchaseOrderView";
Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery( sql );
ResultSetMetaData md = rs.getMetaData();
int columns = md.getColumnCount();
// Get column names
for (int i = 1; i <= columns; i++)
columnNames.addElement( md.getColumnName(i) );
// Get row data
while (rs.next())
Vector row = new Vector(columns);
for (int i = 1; i <= columns; i++)
row.addElement( rs.getObject(i) );
data.addElement( row );
rs.close();
stmt.close();
catch(Exception e)
System.out.println( e );
if (jTable == null) {
jTable = new JTable(data, columnNames);
jTable.setAutoCreateColumnsFromModel(false);
jTable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_NEXT_COLUMN);
jTable.setShowHorizontalLines(false);
jTable.setGridColor(java.awt.SystemColor.control);
jTable.setRowSelectionAllowed(true);
jTable.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
jTable.setShowGrid(true);
return jTable;
}
this method has a default behavior to supply exactly what you're seeing: column names consisting of the capitalized letters, "A", "B", "C".Thanks Pete, had seen that but never really thought about it... about 10 days ago somebody needed to obtain Excel column names, I'd offered a rigorous solution and now see it would have been shorter and simpler (if a little heavier) to extend DefaultTableModel and provide the two additional methods needed (getOffsetCol and getColIndex).
Not much of a difference in LOC but certainly more elegant ;-)
Darryl
Similar Messages
-
Generating CSV file with column names and data from the MySQL with JAVA
Hi all,
Give small example on ...
How can I add column names and data to a CSV from from MySQL.
like
example
sequence_no, time_date, col_name, col_name
123, 27-apr-2004, data, data
234, 27-apr-2004, data, data
Pls give small exeample on this.
Thanks & Regards
Rama KrishnaHello Rama Krishna,
Check this code:
Example below exports data from MySQL Select query to CSV file.
testtable structure
CREATE TABLE testtable
(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
text varchar(45) NOT NULL,
price integer not null);
Application takes path of output file as an argument.
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;
import java.sql.ResultSet;
import java.sql.SQLException;
public class automateExport {
public static void main(String[] args) {
DBase db = new DBase();
Connection conn = db.connect(
"jdbc:mysql://localhost:3306/test","root","caspian");
if (args.length != 1) {
System.out.println(
"Usage: java automateExport [outputfile path] ");
return;
db.exportData(conn,args[0]);
class DBase {
public DBase() {
public Connection connect(String db_connect_str,
String db_userid, String db_password) {
Connection conn;
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
conn = DriverManager.getConnection(db_connect_str,
db_userid, db_password);
} catch(Exception e) {
e.printStackTrace();
conn = null;
return conn;
public void exportData(Connection conn,String filename) {
Statement stmt;
String query;
try {
stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_UPDATABLE);
//For comma separated file
query = "SELECT id,text,price into OUTFILE '"+filename+
"' FIELDS TERMINATED BY ',' FROM testtable t";
stmt.executeQuery(query);
} catch(Exception e) {
e.printStackTrace();
stmt = null;
Greetings,
Praveen Gudapati -
Jtable need help with column name
hi, i'm currently working on a project where my jtable grab data from the database.
as for the where clause i am thinking if i can get the column name as the field name in the table. However, I would like to hide the field name from the user.
So, I'm here to kindly ask if there is a way that i can display the column name that is hidden from the field name.
thanks in advance.actually, I am thinking of a lazy way to add the 'where' clause for my sql statement.
so, instead of detecting which column that is related to the field i can just use the columns header name as my field. But on the other hand, I'd like to hide my field name from the user .
For say my field name is "emp_no" but it is displayed as "Employee No" to the user. and when i do my sql statement i can do something like this:
select * from emp_details where + jtable.getcolumnname(i).tostring() + = jtable.getvalueat(j,i)
is there a way i can do it so???
thanks again. and thanks for the reply -
Need help with administrator name and password
I was messing around on my macbook awhile ago and tried to change around my adminstrator name and now whenever I try to update I can't because the administrator name is wrong. I've tried setting it to different things but it never works. How do I re-set my administrator name and password so i can update?!
Follow the instructions in this FAQ to regain administrator access to the computer. If there is an Open Firmware password set on the machine, the method documented will not work and you won't be able to resolve this issue on your own; in this case, take it to a retail Apple Store or other AASP.
(19627) -
Error in nested group function used with column name.
Hi Team,
If i used nested group function with column name its not working. Could you please any one suggest me.
How to use it.
Regards,
Venkat.
Please find Spool ........
SQL> select user_name,max(max(CNT)) from (select USER_NAME,count(*) CNT from v$open_cursor group by USER_NAME)
2 group by user_name,CNT;
select user_name,max(max(CNT)) from (select USER_NAME,count(*) CNT from v$open_cursor group by USER_NAME)
ERROR at line 1:
ORA-00937: not a single-group group function
SQL> select max(max(CNT)) from(select USER_NAME,count(*) CNT from v$open_cursor group by USER_NAME)
2 group by user_name;
MAX(MAX(CNT))
605Venkat wrote:
Hi Sayan
Its giving output like below, but not given maximum CNT.
SQL> select user_name,max(CNT)from (select USER_NAME,count(*) CNT from v$open_cursor group by USER_NAME)
2 group by user_name;
USER_NAME MAX(CNT)
BANES_LERG 6
VENE_USER 8
USER3 339
DBUS 106
VEL_USER 37
SYS 597
6 rows selected.Check it - Re: Error in nested group function used with column name.
and previous post -
Hi Guys,
First of all thanks in advance any help much appriciated.
I am new in scripting and excel, i am looking for below solution as my job requires daily work of this kind and i came to know by automating this work lots of time can be saved.
Compare Server Names in Excel sheet from column1 with column 2 and exact matched server names should be saved in column 3 in same Excel sheet.
Looking solutions first using excel i.e.vlookup itself so that it will not require any approval in my job else using powersell ,vbscript.
Once again Thanks for you guys.
/Regards
Nitesh24inHi Edward,
Thanks once again
I have only changed excel file path and after that this is saved as below , i am not sure which three lines should be together in one line. Please advise.
$excel = New-Object -ComObject Excel.Application
$Workbook = $excel.Workbooks.Add("F:\NewDocsToReadNitesh26-May2013\Excel\test.xls")
$WorkSheet = $Workbook.Worksheets.Item(1)
$WorkSheet.Activate() | Out-Null
For ($i=1;$i -le $worksheet.UsedRange.Rows.Count;$i++) {
If ($worksheet.cells.item($i,1).value2 -eq $worksheet.cells.item($i,2).value2) {
$worksheet.cells.item($i,3).value2 = $worksheet.cells.item($i,1).value2
}$Workbook.Save()$excel.Quit()[System.Runtime.InteropServices.Marshal]::ReleaseComObject([System.__ComObject]$excel) | Out-Null
Thanks and Regards
Nitesh24in -
JTable can't display column names and scroll bar in JDialog !!
Dear All ,
My flow of program is JFrame call JDialog.
dialogCopy = new dialogCopyBay(frame, "Bay Name Define", true, Integer.parseInt(txtSourceBay.getText()) ,proVsl ,300 ,300);
dialogCopy.setBounds(0, 0, 300, 300);
dialogCopy.setVisible(true); Then,I set the datasource of JTable is from a TableModel.
It's wild that JTable can diplay the data without column names and scroll bar.
I have no idea what's going wrong.Cause I follow the Sun Tutorial to code.
Here with the code of my JDialog.
Thanks & Best Regards
package com.whl.panel;
import com.whl.vslEditor.vslDefine;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Frame;
import javax.swing.JDialog;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.AbstractTableModel;
public class dialogCopyBay extends JDialog {
vslDefine glbVslDefine;
int lvCnt = -1;
JTable tableCopyBay;
int bgnX = 0;
int bgnY = 30;
int tableWidth = 100;
int tableHeight = 100;
public dialogCopyBay(Frame frame, String title, boolean modal, int sourceBay,
vslDefine pVslDefine, int ttlWidth, int ttlHeight) {
super(frame, title, true);
Container contentPane = getContentPane();
System.out.println("dialogCopyBay Constructor");
glbVslDefine = null;
glbVslDefine = pVslDefine;
copyBayModel copyBay = new copyBayModel((glbVslDefine.getVslBayStructure().length - 1),sourceBay);
tableCopyBay = new JTable(copyBay);
tableCopyBay.setPreferredScrollableViewportSize(new Dimension(tableWidth, tableHeight));
JScrollPane scrollPane = new JScrollPane(tableCopyBay);
scrollPane.setViewportView(tableCopyBay) ;
tableCopyBay.setFillsViewportHeight(true);
tableCopyBay.setBounds(bgnX, bgnY, tableWidth, tableHeight);
tableCopyBay.setBounds(10, 10, 100, 200) ;
contentPane.setLayout(null);
contentPane.add(scrollPane);
contentPane.add(tableCopyBay);
class copyBayModel extends AbstractTableModel {
String[] columnNames;
Object[][] dataTarget;
public copyBayModel(int rowNum ,int pSourceBay) {
columnNames = new String[]{"Choose", "Bay Name"};
dataTarget = new Object[rowNum][2];
for (int i = 0; i <= glbVslDefine.getVslBayStructure().length - 1; i++) {
if (pSourceBay != glbVslDefine.getVslBayStructure().getBayName() &&
glbVslDefine.getVslBayStructure()[i].getIsSuperStructure() == 'N') {
lvCnt = lvCnt + 1;
dataTarget[lvCnt][0] = false;
dataTarget[lvCnt][1] = glbVslDefine.getVslBayStructure()[i].getBayName();
System.out.println("lvCnt=" + lvCnt + ",BayName=" + glbVslDefine.getVslBayStructure()[i].getBayName());
public int getRowCount() {
return dataTarget.length;
public int getColumnCount() {
return columnNames.length;
public String getColumnName(int col) {
return columnNames[col];
public Object getValueAt(int rowIndex, int columnIndex) {
return dataTarget[rowIndex][columnIndex];
public Class getColumnClass(int c) {
return getValueAt(0, c).getClass();
public boolean isCellEditable(int row, int col) {
if (col == 1) {
// Bay Name Not Allow To modify
return false;
} else {
return true;
public void setValueAt(Object value, int row, int col) {
dataTarget[row][col] = value;
fireTableCellUpdated(row, col);Dear DB ,
I am not sure what you mean.
Currently,I don't undestand which code is error.
And I also saw some example is add JTable and JScrollPane in JDialog.
Like Below examle in Sun tutorial
public class ListDialog extends JDialog implements MouseListener, MouseMotionListener{
private static ListDialog dialog;
private static String value = "";
private JList list;
public static void initialize(Component comp,
String[] possibleValues,
String title,
String labelText) {
Frame frame = JOptionPane.getFrameForComponent(comp);
dialog = new ListDialog(frame, possibleValues,
title, labelText);
* Show the initialized dialog. The first argument should
* be null if you want the dialog to come up in the center
* of the screen. Otherwise, the argument should be the
* component on top of which the dialog should appear.
public static String showDialog(Component comp, String initialValue) {
if (dialog != null) {
dialog.setValue(initialValue);
dialog.setLocationRelativeTo(comp);
dialog.setVisible(true);
} else {
System.err.println("ListDialog requires you to call initialize " + "before calling showDialog.");
return value;
private void setValue(String newValue) {
value = newValue;
list.setSelectedValue(value, true);
private ListDialog(Frame frame, Object[] data, String title,
String labelText) {
super(frame, title, true);
//buttons
JButton cancelButton = new JButton("Cancel");
final JButton setButton = new JButton("Set");
cancelButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
ListDialog.dialog.setVisible(false);
setButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
ListDialog.value = (String) (list.getSelectedValue());
ListDialog.dialog.setVisible(false);
getRootPane().setDefaultButton(setButton);
//main part of the dialog
list = new JList(data);
list.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
list.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() == 2) {
setButton.doClick();
JScrollPane listScroller = new JScrollPane(list);
listScroller.setPreferredSize(new Dimension(250, 80));
//XXX: Must do the following, too, or else the scroller thinks
//XXX: it's taller than it is:
listScroller.setMinimumSize(new Dimension(250, 80));
listScroller.setAlignmentX(LEFT_ALIGNMENT);
//Create a container so that we can add a title around
//the scroll pane. Can't add a title directly to the
//scroll pane because its background would be white.
//Lay out the label and scroll pane from top to button.
JPanel listPane = new JPanel();
listPane.setLayout(new BoxLayout(listPane, BoxLayout.Y_AXIS));
JLabel label = new JLabel(labelText);
label.setLabelFor(list);
listPane.add(label);
listPane.add(Box.createRigidArea(new Dimension(0, 5)));
listPane.add(listScroller);
listPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
//Lay out the buttons from left to right.
JPanel buttonPane = new JPanel();
buttonPane.setLayout(new BoxLayout(buttonPane, BoxLayout.X_AXIS));
buttonPane.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10));
buttonPane.add(Box.createHorizontalGlue());
buttonPane.add(cancelButton);
buttonPane.add(Box.createRigidArea(new Dimension(10, 0)));
buttonPane.add(setButton);
//Put everything together, using the content pane's BorderLayout.
Container contentPane = getContentPane();
contentPane.add(listPane, BorderLayout.CENTER);
contentPane.add(buttonPane, BorderLayout.SOUTH);
pack();
public void mouseClicked(MouseEvent e) {
System.out.println("Mouse Click");
public void mousePressed(MouseEvent e) {
throw new UnsupportedOperationException("Not supported yet.");
public void mouseReleased(MouseEvent e) {
throw new UnsupportedOperationException("Not supported yet.");
public void mouseEntered(MouseEvent e) {
throw new UnsupportedOperationException("Not supported yet.");
public void mouseExited(MouseEvent e) {
throw new UnsupportedOperationException("Not supported yet.");
public void mouseDragged(MouseEvent e) {
throw new UnsupportedOperationException("Not supported yet.");
public void mouseMoved(MouseEvent e) {
throw new UnsupportedOperationException("Not supported yet.");
* This is here so that you can view ListDialog even if you
* haven't written the code to include it in a program.
} -
How to find the column name and table name with a value
Hi All
How to find the column name and table name with "Value".
For Example i have value named "Srikkanth" This value will be stored in one table and in one column i we dont know the table how to find the table name and column name
Any help is highly appricatable
Thanks & Regards
Srikkanth.M2 solutions by Michaels (the latter is 11g upwards only)...
michaels> var val varchar2(5)
michaels> exec :val := 'as'
PL/SQL procedure successfully completed.
michaels> select distinct substr (:val, 1, 11) "Searchword",
substr (table_name, 1, 14) "Table",
substr (t.column_value.getstringval (), 1, 50) "Column/Value"
from cols,
table
(xmlsequence
(dbms_xmlgen.getxmltype ('select ' || column_name
|| ' from ' || table_name
|| ' where upper('
|| column_name
|| ') like upper(''%' || :val
|| '%'')'
).extract ('ROWSET/ROW/*')
) t
-- where table_name in ('EMPLOYEES', 'JOB_HISTORY', 'DEPARTMENTS')
order by "Table"or
SQL> select table_name,
column_name,
:search_string search_string,
result
from cols,
xmltable(('ora:view("'||table_name||'")/ROW/'||column_name||'[ora:contains(text(),"%'|| :search_string || '%") > 0]')
columns result varchar2(10) path '.'
where table_name in ('EMP', 'DEPT')
TABLE_NAME COLUMN_NAME SEARCH_STRING RESULT
DEPT DNAME ES RESEARCH
DEPT DNAME ES SALES
EMP ENAME ES JONES
EMP ENAME ES JAMES
EMP JOB ES SALESMAN
EMP JOB ES SALESMAN
EMP JOB ES SALESMAN
EMP JOB ES PRESIDENT
EMP JOB ES SALESMAN
9 rows selected. -
How to get the column name and table name with value
Hi All
I have one difficult requirement
I have some column values and they have given some alias column names but i need to find the correct column name and table name from the database.
For example value is "SRI" and i dont know the table and exact column name so is there any possibilities to find the column name and table name for the given value
Thanks & Regards
Srikkanth.MSearching all the database for a word...
Courtesy of michaels...
michaels> var val varchar2(5)
michaels> exec :val := 'as'
PL/SQL procedure successfully completed.
michaels> select distinct substr (:val, 1, 11) "Searchword",
substr (table_name, 1, 14) "Table",
substr (t.column_value.getstringval (), 1, 50) "Column/Value"
from cols,
table
(xmlsequence
(dbms_xmlgen.getxmltype ('select ' || column_name
|| ' from ' || table_name
|| ' where upper('
|| column_name
|| ') like upper(''%' || :val
|| '%'')'
).extract ('ROWSET/ROW/*')
) t
-- where table_name in ('EMPLOYEES', 'JOB_HISTORY', 'DEPARTMENTS')
order by "Table"or
11g upwards
SQL> select table_name,
column_name,
:search_string search_string,
result
from (select column_name,
table_name,
'ora:view("' || table_name || '")/ROW/' || column_name || '[ora:contains(text(),"%' || :search_string || '%") > 0]' str
from cols
where table_name in ('EMP', 'DEPT')),
xmltable (str columns result varchar2(10) path '.')
TABLE_NAME COLUMN_NAME SEARCH_STRING RESULT
DEPT DNAME es RESEARCH
EMP ENAME es JAMES
EMP JOB es SALESMAN
EMP JOB es SALESMAN
4 rows selected. -
Download internal table data into excel sheet with column heading and data
Hi,
I am having one internal table with column headings and other table with data.
i want to download the data with these tables into an excel sheet.
It should ask the user for file name to save it on their own name. They should give the file name in runtime and it should be downloaded into an excel sheet.
Can anyone tell what is the right function module for downloading these two internal table data with column heading and data.
what we have to do for storing the file name in runtime.
Can anyone help me on this.
Thanks,
Rose.Hi Camila,
Try this
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = PATH2
FILETYPE = 'XLS'
TABLES
DATA_TAB = IT_DATA
FIELDNAMES = IT_HEADINGS
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22 -
What is the key column name and value column name in JDBC Adapter parameter
Hi
Can any one please tell me what is the Key Column Name and Key Column Value in JDBC adatper parameters. If i dont mention those parameters i am getting the following error
<b> Value missing for mandatory configuration attribute tableEOColumnNameId</b>
Please help me
Best Regards
Ravi Shankar BHi
I am doing DataBase Lookup in XI
First i have created a Table in Database( CheckUser) which has two fields UserName and PhoneNumber and then i have created
I have created one Communication Channel For Reciever Adapter .
I have given the parameters like this
JDBC Driver : com.microsoft.jdbc.sqlserver.SQLServerDriver
Connection : jdbc:microsoft:sqlserver://10.7.1.43:1433;DatabaseName=Ravi;
UserName.... sa
password.... sa
persistence : Database
Database Table Name : CheckUser
Key column name and Value column name i left blank and activated
and then
I have created
Data Types : Source ...... UserName
Destination.... PhoneNumber
Message Types
Message Interfaces
In Message Mapping
I have created one User Defined function DBProcessing_SpecialAPI().This method will get the data from the database....
In this function i have written the following code
//write your code here
String query = " ";
Channel channel = null;
DataBaseAccessor accessor = null;
DataBaseResult resultSet = null;
query = "select Password from CheckUser where UserName = ' " +UserName[0]+ " ' ";
try {
channel = LookupService.getChannel("Ravi","CC_JDBC");
accessor = LookupService.getDataBaseAccessor(channel);
resultSet = accessor.execute(query);
for(Iterator rows = resultSet.getRows();rows.hasNext();){
Map rowMap = (Map)rows.next();
result.addValue((String)rowMap.get("Password"));
catch(Exception e){
result.addValue(e.getMessage());
finally{
try{
if(accessor != null)
accessor.close();
}catch(Exception e){
result.addValue(e.getMessage());
And the i have mapped like this
UserName -
> DBProcessing_SpecialAPI----
>PhoneNumber
when i am testing this mapping i am getting the following error
<?xml version="1.0" encoding="UTF-8"?>
<ns0:Dest_JDBC_MT xmlns:ns0="http://filetofilescenario.com/ilg"><phoneNumber>Plain exception:Problem when calling an adapter by using communication channel CC_JDBC (Party: , Service: Ravi, Object ID: c360bc139a403293afbc49d5c46e4478) Check whether the communication channel exists in the Integration Directory; also check the cache notifications for the instance Integration Server (central Adapter-Engine) Channel object with Id Channel:c360bc139a403293afbc49d5c46e4478 not available in CPA Cache.
com.sap.aii.mapping.lookup.LookupException: Problem when calling an adapter by using communication channel CC_JDBC (Party: , Service: Ravi, Object ID: c360bc139a403293afbc49d5c46e4478) Check whether the communication channel exists in the Integration Directory; also check the cache notifications for the instance Integration Server (central Adapter-Engine) Channel object with Id Channel:c360bc139a403293afbc49d5c46e4478 not available in CPA Cache.
at com.sap.aii.ibrun.server.lookup.AdapterProxyLocal.<init>(AdapterProxyLocal.java:61)
at com.sap.aii.ibrun.server.lookup.SystemAccessorInternal.getProxy(SystemAccessorInternal.java:98)
at com.sap.aii.ibrun.server.lookup.SystemAccessorInternal.<init>(SystemAccessorInternal.java:38)
at com.sap.aii.ibrun.server.lookup.SystemAccessorHmiServer.getConnection(SystemAccessorHmiServer.java:270)
at com.sap.aii.ibrun.server.lookup.SystemAccessorHmiServer.process(SystemAccessorHmiServer.java:70)
at com.sap.aii.utilxi.hmis.server.HmisServiceImpl.invokeMethod(HmisServiceImpl.java:169)
at com.sap.aii.utilxi.hmis.server.HmisServer.process(HmisServer.java:178)
at com.sap.aii.utilxi.hmis.web.HmisServletImpl.processRequestByHmiServer(HmisServletImpl.java:296)
at com.sap.aii.utilxi.hmis.web.HmisServletImpl.processRequestByHmiServer(HmisServletImpl.java:211)
at com.sap.aii.utilxi.hmis.web.workers.HmisInternalClient.doWork(HmisInternalClient.java:70)
at com.sap.aii.utilxi.hmis.web.HmisServletImpl.doWork(HmisServletImpl.java:496)
at com.sap.aii.utilxi.hmis.web.HmisServletImpl.doPost(HmisServletImpl.java:634)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
</phoneNumber></ns0:Dest_JDBC_MT>
In RWB i have checked the status of JDBC driver its showing the following error
<b>Value missing for mandatory configuration attribute tableEOColumnNameId</b>
Best Regards
Ravi Shankar B
Message was edited by:
RaviShankar B -
I have named my columns for exaomple column trasanctionid as "TransactionID".But when i write a process and run the query in the process it takes the column name as all in cappital letters.Hence it gives me follwing error.
ORA-00904: "TRANSACTIONID": invalid identifier
I want to know whether there is any constraint to name columns all inc apital letters in apex.I am finding it difficult to change column name and then make changes throughout the app for it.This error has popped up many times for me and I had to everytime change the column anme to all capitals to get rid of this error.
Edited by: dwitiya on Sep 3, 2010 10:52 AMGlad to hear it.
And as you can see from the other responses, case sensitive column names are not widely understood (many people assume they don't exist), so it's really best to avoid them wherever possible. The only time I've seen column names defaulting to case sensitive was when we imported a table from Microsoft Excel using a third-party tool (Toad). This caused us a rather significant amount of headache, and it's something I've been careful to check for ever since.
Of course, once a table or a column is created with a case-sensitive name, it can be hard to break free, as you're discovering--you can't just alter the table and rename the column, as your existing code will break. (transactionid is equal to "TRANSACTIONID", but not "TransactionID".) So if you're not willing to go through your entire codebase to fix the case-sensitivity (and most of us don't have time to), you're going to have to get used to putting quotes on the things that need it.
Which will, of course, help you remember to make your table and column names case-insensitive in the future. :-)
-David
Edited by: DavidG on Sep 3, 2010 11:17 AM: realized I'd mis-typed a variable name. -
Bcp queryout with column name in output
DECLARE @cmd nvarchar(1000);
SELECT @cmd = 'bcp "SELECT ObjectID,FeatureID,ParcelID,Card,ISNULL(Units,0) as Units,ISNULL(Bed,0) as Bed,ISNULL(Bath,0) as Bath,ISNULL(Half,0) as Half,TaxYear FROM pubtables.dbo.Tax_StructureApartment" queryout "\\WDC1GISSHP1\Scripts\DataManagement\DataMaintenance\SyncDataCatalog2SDE\CAMA.txt" -T -c';
PRINT @cmd
exec xp_cmdshell @cmd;
I am extracting certain fields from a large table and using bcp to output to a file. The code above works, but the output does not have the column name (i.e. header). How would I go about doing that ?
Thank you.you need to add a query based on catalog view information_schema.columns for that
see this example
http://sqlblogcasts.com/blogs/madhivanan/archive/2008/10/10/export-to-excel-with-column-names.aspx
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page -
Reading MS Project column names and data on the fly from a selected View
Hi guys,
I have several views on my project file (MSPROJECT 2010) and I want to build a macro so that;
1. User can select any view ( Views can have diffrent columns and the user may add new columns as well)
2. User runs the Macro and all the coulmns along with the tasks displayed in the view will be written to a excel file. ( I don't want to build several macro's for each view, I'm thinking of a common method which would work for any selected view)
The problem I'm facing is that how will i read the column names and data for a particular view on the fly without hard coding them inside the vba code ?
The solution needs to work on a master schedule as well.
Appreciate your feedback.Just to get you started the following code writes the field name and data for the active task to the Immediate window.
Sub CopyData()
Dim fld As TableField
For Each fld In ActiveProject.TaskTables(ActiveProject.CurrentTable).TableFields
If fld.Field >= 0 Then
Debug.Print Application.FieldConstantToFieldName(fld.Field), ActiveCell.Task.GetField(fld.Field)
End If
Next fld
End Sub
Rod Gill
Author of the one and only Project VBA Book
www.project-systems.co.nz -
How to create list of a View's column names and source
Using SQL 2005, 2008, and 2012
How to create list of a View's column names and source. For the following example would like to @Print something like the following. Does anyone already have some code to do this? I realize there are probably some gotchas, but the views that I am looking
at to use this follows the code snippet pattern below.
DBACCT.[Account Number]
dbo.ConvertDate(DBACDT). [Boarding Date]
DBXES.DBXES
CREATE VIEW [dbo].[v_ods_DBAL]
AS
SELECT DBACCT AS [Account Number], dbo.ConvertDate(DBACDT) AS [Boarding Date], DBXES
FROM dbo.ods_DBALThe column information can be obtained from INFORMATION_SCHEMA.COLUMNS view using logic like below
SELECT c.COLUMN_NAME,c.DATA_TYPE
FROM INFORMATION_SCHEMA.COLUMNS c
WHERE EXISTS (SELECT 1
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = c.TABLE_NAME
AND TABLE_TYPE='VIEW')
http://technet.microsoft.com/en-us/library/ms188348.aspx
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs
Maybe you are looking for
-
1. I want compile multiple schemas at a time. should I give same package for all schema ? 2. When I give same package for all schema, The generate ObjectFactory class is of last schema. 3. Should I give different package for each schema ?
-
BOOTCAMP FOR GAMING...
is running bootcamp on your macbook pro dangrous? i wanna run some mmo's on my machine but most of em dont have osx patches (ie old republic, secret world) this a safe idea?
-
Opening a PDF file with hypertexts on iPad, when a PDF hypertext is clicked more than one time, first time works correctly, other times the link doesn'd works. This happen if the same hypertext is clicked consecutively more than one time. Solutions?
-
SO_OBJECT_UPDATE ABAP Crash Dump
I am using SO_OBJECT_UPDATE function in my program to read a mail in my inbox and change the title of the email before I use SO_OBJECT_SEND to send it off again. However I have a problem with SO_OBJECT_UPDATE function. I have narrowed the error down
-
Hi I am using Dreamweaver CS4. When i am designing my web page, I get a totally different look when I am in design view and when I switch to live view. Can you tell me why is this???