|
This is not a "homework on demand" site. These instructions were given to you, and you are expected to do the work.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
sdfsd
|
|
|
|
|
simple pro of more then one int no sum
|
|
|
|
|
If you cannot make the effort to write a proper question then do not be surprised if you do not get a proper answer. And if you are looking for a complete solution to your homework you are likely to be disappointed.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
|
do you have a list of codes and thier function?
thanks
|
|
|
|
|
dear all iam new in java and using jdk1.6 and netbeans ide with sql server 2005 i want to update content of JtextField using submit button in sql server 2005 and how to make connection in java and sql server 2005 please suggest
|
|
|
|
|
Lots of suggestions here[^] for accessing SQL server from Java.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Hi,
sorry for my bad English.
I need in JAVA.
I have a log file from a Web server with 120,000 lines.
Example of input file:
10.160.0.10;16.11.2011 12:56;/;-;"Mozilla/5.0 (Windows NT 5.1; rv:2.0) Gecko/20100101 Firefox/4.0"
10.160.0.100;14.11.2011 7:22;/;-;"Mozilla/5.0 (Windows NT 5.1; rv:2.0) Gecko/20100101 Firefox/4.0"
10.160.0.100;14.11.2011 10:45;/;-;"Mozilla/5.0 (Windows NT 5.1; rv:2.0) Gecko/20100101 Firefox/4.0"
10.160.0.100;14.11.2011 10:53;/;-;"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)"
I need to compare the IP address in the first line with IP in the second line
and at the same time
to compare the last box that contains the version of the web browser with version in the second line.
And second line with third line etc.
If first IP is same as second IP and together first version is same as second version
then add to the end of line info example #1 (that will be mean that it is first user)
If IP or version are different then add to the end of line #2 (second user).
It identifies users based on IP address and User-Agent field (based on different versions of a web browser).
Example of ouput file:
10.160.0.10;16.11.2011 12:56;/;-;"Mozilla/5.0 (Windows NT 5.1; rv:2.0) Gecko/20100101 Firefox/4.0";#1
10.160.0.100;14.11.2011 7:22;/;-;"Mozilla/5.0 (Windows NT 5.1; rv:2.0) Gecko/20100101 Firefox/4.0";#2
10.160.0.100;14.11.2011 10:45;/;-;"Mozilla/5.0 (Windows NT 5.1; rv:2.0) Gecko/20100101 Firefox/4.0";#2
10.160.0.100;14.11.2011 10:53;/;-;"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)";#3
Do you have any idea how to do this?
Which method to use?
Thank you for help.
|
|
|
|
|
Yes.
Manual attempt:
Simplest: make a *.csv from the log file. A *.csv file is a Excel compatible file. You can use notepad++ to change the "/" into ";" to format the data.
As a coding:
Split each String on the slash "/" and use only first and last part - insert a semicolon (";") in between.
Write to file and name it "funnyname.csv". You can import that file into MS Excel / OO Calc for inspection - or extend your snippet to make the comparison for you (if there is a certain thingy you're looking for).
|
|
|
|
|
how to do tower in java by using GUI
|
|
|
|
|
Why have you reposted this same question? One post is sufficient.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
how to do tower in java by using GUI
|
|
|
|
|
Please give more details about your problem; "how to do tower" is not very clear.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
|
are you referring to the Towers of Hanoi?
April
Comm100 - Leading Live Chat Software Provider
modified 27-May-14 8:36am.
|
|
|
|
|
This is really more of an Eclipse question than a programming question.
I am a newbe Eclipse user and am working with a Java web application that I am debugging. Having annoying problem where browser debug window always defaults to webapp directory but I want it to go to webapp\specificPage.
What I have been doing is pulling the drop down and selecting from the history the page I want. The page I am selecting does not change.
After doing this for a while it gets old. Would like to be able to force the in-eclipse-browser debug window to a specific page every time.
Kind of a dumb question, I'm sure there is a magic setting for this but at this point I have not found it.
This is for Eclipse Helios.
Thanks, for reading,
kmg365
|
|
|
|
|
be able to force the eclipse browser window to a specific page every time.
set web.xml like
<web-app>
...
<welcome-file-list>
<welcome-file>yourPage.html</welcome-file>
<welcome-file>yourPage.jsp</welcome-file>
<welcome-file>yourPage.htm</welcome-file>
</welcome-file-list>
</web-app>
|
|
|
|
|
Thanks so much for your reply.
However I need the browser for eclipse to go to the http://localhost:8080/RestExample/helloworld url. That is I was looking for a way to force browser to append "/helloworld" to the end of the path.
When I adapt the above to;
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>RestExample</display-name>
<welcome-file-list>
<welcome-file>helloworld/index.html</welcome-file>
<welcome-file>helloworld/index.htm</welcome-file>
<welcome-file>helloworld/index.jsp</welcome-file>
<welcome-file>helloworld/default.html</welcome-file>
<welcome-file>helloworld/default.htm</welcome-file>
<welcome-file>helloworld/default.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>JerseyTest</servlet-name>
<servlet-class>
com.sun.jersey.spi.container.servlet.ServletContainer
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>JerseyTest</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
It makes no difference.
Thanks.
|
|
|
|
|
I see,you develop a JAX-RS using jersey.
you miss a piece of code.
For example
="1.0"="UTF-8"
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<display-name>JAX-RS REST Servlet</display-name>
<servlet-name>JAX-RS REST Servlet</servlet-name>
<servlet-class>
com.sun.jersey.spi.spring.container.servlet.SpringServlet</servlet-class>
<init-param>
<param-name>com.sun.jersey.config.property.packages</param-name>
<param-value>services</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>JAX-RS REST Servlet</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
This project Integrated Spring.
browser for eclipse to go to the http://localhost:8080/RestExample/services/helloworld url
|
|
|
|
|
Error:
java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.sun.jdbc.odbc)
My COde:
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import java.sql.*;
import sun.jdbc.odbc.*;
/*
<applet code="register" width=250 height=200>
</applet>
*/
public class register extends Applet implements ActionListener,ItemListener
{
Label l1,l2,l3,l4;
TextField t1,t2,t3,t4;
Button submit;
public void init()
{
l1=new Label("RegNo.:");
l2=new Label("Name.:");
l3=new Label("Course.:");
l4=new Label("year.:");
t1=new TextField("regno");
t2=new TextField("name");
t3=new TextField("course");
t4=new TextField("year");
submit=new Button("submit");
add(l1);
add(t1);
add(l2);
add(t2);
add(l3);
add(t3);
add(l4);
add(t4);
add(submit);
t1.addActionListener(this);
t2.addActionListener(this);
t3.addActionListener(this);
t4.addActionListener(this);
submit.addActionListener(this);
}
public void itemStateChanged(ItemEvent ie)
{
repaint();
}
public void actionPerformed(ActionEvent ae)
{
repaint();
}
public void paint(Graphics g)
{
Connection c=null;
Statement s=null;
String a,b,d,h;
a=t1.getText();
b=t2.getText();
d=t3.getText();
h=t4.getText();
g.drawString("Reg.no.:"+a,6,100);
g.drawString("Name.:"+b,6,120);
g.drawString("Course.:"+d,6,140);
g.drawString("year.:"+h,6,160);
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); //Driver to connect the ODBC JDBC Bridge
c=DriverManager.getConnection("jdbc:odbc:da","system","manager"); //Connect the Data Source Name
s=c.createStatement();
System.out.println("Database Created");
int count=s.executeUpdate("insert into Table1(regno,name,course,year) values('"+a+"','"+b+"','"+d+"','"+h+"')");
//g.drawString("Record Added");
if(count==1)
g.drawString("Record Added",6,180);
}
catch (Exception e)
{
System.out.println(e);
}
}
}
|
|
|
|
|
What line is throwing the exception? I am guessing that either the driver or the database file is not available.
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
No Database file and Driver Are Already Placed and Done All Thing's Perfectly Iam Sure
|
|
|
|
|
Prabakaran1993 wrote: All Thing's Perfectly Iam Sure
Then presumably you already know the answer to your question.
|
|
|
|
|
Based on your other reply you presumably already know all of the following so this is only in case someone else needs to understand it.
MS Access if a file system based database. That means that the database file must be accessible on the client machine for it to work.
That makes it very ill suited for anything related to internet/network work - such as using in in an applet. Additionally it might be less that well suited for multi-user use which also eliminates browser solutions (which are typically only useful for multi-user situations.)
As for the access problem - that couldn't be clearer - it is a access problem. Such problems can arise in any number of ways and the solution is always the same. And googling will find the same solutions which is normally one of the following.
1. Modify the access rights on the client machine to allow it. It is NOT possible to do this in the browser via java.
2. Sign the jar that has the applet in it.
|
|
|
|