When working with dates it is better to use preparedStatements:
PreparedStatement ps=con.prepareStatement("SELECT * from EVENT WHERE event_date > ?");
ps.setDate(1, new Date(2003,06,01));
ps.executeQuery();
Golden rule:
When a variable appears more then once in a statement,
never use statements with side-effects on that variable
within that statement.
The sequence of calculating the whole statement can be
different from compiler to compiler.
instead of:
array[j] = array[++j]+10;
write:
j++...
This is the only way to do it:
an ActionEvent only contains the address of the JButton that is pressed. You'll have to search your buttonarray for a matching address.
public void actionPerformed(Actionevent e) {
if (e.getSource()==buttons[0][0]) // .....
if...
The 11th line has to be:
connection = DriverManager.getConnection(url);
If you make a new variable in a block, this will be dstroyed once you've left this block.
The reason for the error is that when an Exception should occur on the 11th line connection would still be null. The stack will be...
The error is in this part:
int start = pointer;
while (start >= 0)
{
if (searchCriteria.compareTo(arrayToSearch[start][0].substring(0, len)) == 0)
{
results[nextFreeLocation++] = theList.getItem(Integer.parseInt(arrayToSearch[start--][1]));
}
else break;
}
When you...
Put the line TextArea input = new TextArea(...); also outside your constructor.
Why do I have to declare JRadioButton byteSelected and TextArea input as members of GUI?
When your program starts the main method is called.
GUI frame = new GUI(); This makes a new instance of the class GUI...
In the method actionPerformed only members of the class GUI are accessible.
Sollution:
public class GUI extends Frame implements ActionListener{
JRadioButton byteSelected=new JRadioButton("Byteorientiert",false);
public GUI()
{...
Read this about the OSI Network Model:
http://www.ussg.iu.edu/usail/network/nfs/network_layers.html
(don't wory about Session and Presentation Layer, those aren't used)
Is your question about sending IP-packets or about opening TCP-connections ?
Another sollution:
long date;
Vector v=new Vector();
//Put date in the vector:
Long t=new Long(date);
v.addElement(t);
//Get date out of the vector:
date=((Long)v.elementAt(0)).longValue();
This is what I find in the API specification of BufferedWriter:
public void newLine() throws IOException
Write a line separator. The line separator string is defined by the system property line.separator, and is not necessarily a single newline ('\n') character.
tabs, carriage returns, backslash and quotes are 'Escape Characters'
You can't write these in your code between " " like other characters. Instead you have to use Escape Sequences.
These sequences begin with a backslash
System.out.print("this\tis a\ntest");
This example...
If your IP-address is 192.168.x.x, you're using a private IP-address and you connect to the internet through a NAT-router.
The problem with private IP-addresses is that you can make connections with servers on the internet, but they can't make connections with you. FTP in active mode opens the...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.