Help coderanch get a
new server
by contributing to the fundraiser

allen turner

Greenhorn
+ Follow
since Oct 04, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by allen turner

Hi,

I have an ejb ql that looks like
[SELECT OBJECT(a) From EntityUseDescriptionEntityBean a, EntityUseEntityBean e WHERE a.entityUseLongDescription LIKE ?1 AND a.localeCode=?2 AND e.entityUseId = a.entityUseId AND e.effectiveDate <= ?3 AND (e.sunsetDate is null OR e.sunsetDate > ?3) AND (e.organizationId is null OR e.organizationId = ?4)]

this is what i have in the orion-ejb-jar.xml


"SELECT a.ENTITY_USE_ID, a.LOCALE_CODE, a.ENTITY_USE_DESC, a.CREATED_BY, a.CREATED_DATE, a.UPDATED_BY, a.UPDATED_DATE FROM ENTITY_USE_DESC a , ENTITY_USE e WHERE ((a.ENTITY_USE_DESC LIKE '?1' ) AND (a.LOCALE_CODE = '?2' ) AND (e.ENTITY_USE_ID = a.ENTITY_USE_ID ) AND (e.EFFECTIVE_DATE <= ? ) AND ((e.SUNSET_DATE IS NULL ) OR (e.SUNSET_DATE > ? )) AND ((e.OU_ID IS NULL ) OR (e.OU_ID = ? )))

the 4 parameters are being passed properly and I am able to print the values but some how the value are not getting set properly in the QL. I used P6spy to look at the query that is being generated. and this is what it looks like

SELECT a.ENTITY_USE_ID, a.LOCALE_CODE, a.ENTITY_USE_DESC, a.CREATED_BY, a.CREATED_DATE, a.UPDATED_BY, a.UPDATED_DATE FROM ENTITY_USE_DESC a , ENTITY_USE e WHERE ((a.ENTITY_USE_DESC LIKE ''2002-02-21'1' ) AND (a.LOCALE_CODE = ''2002-02-21'2' ) AND (e.ENTITY_USE_ID = a.ENTITY_USE_ID ) AND (e.EFFECTIVE_DATE <= 3 ) AND ((e.SUNSET_DATE IS NULL ) OR (e.SUNSET_DATE > null )) AND ((e.OU_ID IS NULL ) OR (e.OU_ID = null )))

so if you see the values are not being populated properly. what am i doing wrong here. and interesting point is that this works perfectly fine in websphere and weblogic.
But OC4J somehow does not seem to like that query, i dont know why!!!
any suggestions...
thanks in advance
This does not seem to be a problem of the Editor pane. But your desing seems to be having some problem. you seem to want to navigate a set of panels using a HTML page on a JEditor pane. Maybe u must change it a little bit and try loading the panels dynamically or use some gridlayout and put the required panel on the first grid in response to a click.
hope that helps
21 years ago
hai,
Seems like you have a very nice problem. But are u using JEditor pane through out, for all your html pages in that case u get the anchor in that by itself. Maybe u are mixing panes and HTML
21 years ago
Just try out this link and see if it helps. this enables u to make raw packets and maybe u can find out how to make the raw ping packets and send it to the machine
http://www.goto.info.waseda.ac.jp/
~fujii/jpcap/index.html
Hai,
I want to make a yahoo chat client. i have the packet structure and the details for the chat. But i have to get a cookie from the chat server via http but some how i am not able to get that. this is the code i used to connect to the http chat server

import java.net.*;
public class MyHttp
{
HttpURLConnection conn ;
public MyHttp()
{

try
{


//String url = "http://www.yahoo.com/";
String url="http://cs31.msg.sc5.yahoo.com/config/ncclogin?&n=1&login=username&passwd=pwsword
URL hp = new URL(url);
URLConnection hpCon = hp.openConnection();
HttpURLConnection uc = (HttpURLConnection)hpCon;
uc.connect();
int responseCode = uc.getResponseCode();
System.out.println("Response code: " + responseCode);
String responseMsg = uc.getResponseMessage();
System.out.println("Response Msg: "+responseMsg);

}
catch(Exception e)
{
System.out.println(e);
}
}

public static void main(String args[])
{
MyHttp conn = new MyHttp();

}

}

if i give yahoo url or any other usual url the code seems to work. but the chat login url does not seem to work. any ideas.........
thanks
Byee
the first machine is connected to the internet and from this machine i connect to another machine which is also in the internet. from this second machine i connect to anothe machine which is part of the intranet coming under the second machine
all the first machine is on Debian and the other two on solaris
Hope this detail helps
thanks
Byee
I have to FTP from a remote machine, but cannot do it directly from that machine. I have to login to 3 intermidiate machines and download the file jumping one machine at a time. Is there any way i can do this from my local machine. i can run java only in my machine.
Thanks
Byee
Hai
I am not sure if i should post this here. any way..
i want to make an application that can be used as a yahoo chat client and can i do that using java and if so how? i guess yahoo uses http for its chat
thanks
Thanks
I think i can work on that idea. Is there any useful jars that can do all this kind of things?
Thanks
22 years ago
Thanks!
But i want to do it from java so that i need not depend on the facility given by the platform like NT or linux. if i can do it in java no matter waht the platform it will work!!. So i specifically need it in java.
Bye
22 years ago
Hai
I want to update a database on a daily basis using java at some predefined times of the day. is this possible? What i am looking at is some kind of a cron job like facility like in linux.
Thanks
Bye
22 years ago
Take a look at the setMaximumRowCount methhod of the JComboBox class to set the number of rows in the drop down.
22 years ago
this code takes the column names from the vector. u can have anu data container to hold the names of the headers. but all u must do is to implement the methods in the AbstractTable in a way suitable for ur datacontainer

import javax.swing.JPanel;
import javax.swing.JButton;
import javax.swing.JTable;
import javax.swing.table.AbstractTableModel;
import javax.swing.table.TableColumn;
import javax.swing.DefaultCellEditor;
import javax.swing.table.TableCellRenderer;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.JScrollPane;
import javax.swing.JComboBox;
import javax.swing.JButton;
import javax.swing.JTextField;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import javax.swing.JOptionPane;
import java.util.*;
import java.awt.*;
import java.awt.event.*;
public class MyTableModel extends AbstractTableModel
{


Vector data = new Vector();
Vector dataContent= new Vector();
Vector columnNames= new Vector();
static int count=1;


public MyTableModel()
{

columnNames.add("Sl No:");
columnNames.add("Mem Code/ AC no:");
columnNames.add("Crew ID.");
columnNames.add("Amount");
columnNames.add("Delete");
dataContent.add(new Integer(count));
dataContent.add(new Integer(0));
dataContent.add(new Integer(0));
dataContent.add(new Double(0.00));
dataContent.add(new Boolean(false));

data.add(dataContent);

}

public int getColumnCount() {
return columnNames.size();
}

public int getRowCount()
{
return data.size();
}

public String getColumnName(int col)
{
return (String)columnNames.get(col);
}

public Object getValueAt(int row, int col)
{
Vector temp = (Vector)data.get(row);

return temp.get(col);
}

/*
* JTable uses this method to determine the default renderer/
* editor for each cell. If we didn't implement this method,
* then the last column would contain text ("true"/"false"),
* rather than a check box.
*/
public Class getColumnClass(int c)
{
return getValueAt(0, c).getClass();
}

/*
* Don't need to implement this method unless your table's
* editable.
*/
public boolean isCellEditable(int row, int col)
{
//Note that the data/cell address is constant,
//no matter where the cell appears onscreen.
if (col ==0)
return false;
else
return true;

}

/*
* Don't need to implement this method unless your table's
* data can change.
*/
public void setValueAt(Object value, int row, int col)
{


Vector temp =(Vector)data.get(row);
System.out.println(temp);
temp.removeElementAt(col);
temp.insertElementAt(value,col);
data.removeElementAt(row);
data.insertElementAt(temp,row);
fireTableCellUpdated(row, col);
/*
Deleting a row if the Boolean is true
*/
if(col==4)
{
count --;// decresing the count
printDebugData();

data.removeElementAt(row);
for (int i = row;i<data.size();i++)>
{
Vector temp1=new Vector((Vector)data.get(i));
System.out.println(temp1);
int tempcount=((Integer)temp1.get(0)).intValue();
tempcount --;
temp1.removeElementAt(0);
temp1.insertElementAt(new Integer(tempcount),0);
data.removeElementAt(i);
data.insertElementAt(temp1,i);
}
/*
To notify the model that the row has been deleted
*/
fireTableRowsDeleted(data.size(),data.size()+1);

}
printDebugData();
Value.setTotal(getTotal());
System.out.println("Total= "+getTotal());
}

public void addRow()
{
Vector newContent= new Vector();
count++;

newContent.add(new Integer(count));
newContent.add(new Integer(1));
newContent.add(new Integer(1));
newContent.add(new Double(0.00));
newContent.add(new Boolean (false));

data.add(newContent);
fireTableRowsInserted(data.size(),data.size());


}
private void printDebugData()
{
int numRows = getRowCount();
int numCols = getColumnCount();

for (int i=0; i < data.size(); i++)
{
Vector temp= (Vector)data.get(i);
for (int j=0; j < temp.size(); j++)
{
System.out.print(temp.get(j));
}
System.out.println();
System.out.println("--------------------------");
}
System.out.println("--------------------------");
System.out.println("the size is "+data.size());
}

public double getTotal()
{

/*
Calculates the total amount in the data vector
*/
double ret=0.00;
for (int i =0; i<data.size();i++ )>
{
Vector temp=(Vector)data.get(i);

ret=ret+((Double)temp.get(3)).doubleValue();
}
return ret;
}
}
22 years ago
Using a font depends on the OS u are using> In windows u need to install the font from the control panel. then u should not have problems in accessing that font.
22 years ago
I have a color jpg image. Is there any api that can be used to convert this image to monochrome bmp image. Specifically is there any api that helps in image conversions?
thanks
22 years ago