Thursday, May 29, 2008

How Foamy Is Bad Fo Urine Kidney

Firefox 3 Download Day 2008


Download Day 2008

It 'was released Firefox 3 RC1, and June 5 will be released RC2 to fix 10 bugs identified, a few steps left before the final release of Firefox and aims to establish a Guinness Primati.Partecipa too, how?
Just download Firefox 3 during Download Day Join the event.

The official date of release of Firefox 3 will be announced very soon on Spread Firefox.


Thursday, May 15, 2008

Cervix Low Soft In Early Pregnancy

FireNes

FireNes a plugin for firefox that allows us to play in the browser in 2500 Nintendo games without installing rom emulator it will in just a few clicks possimo play any game that has enthralled us. There the legendary Super Mario Bros., Bubble Bobble, Ninja turtle.



fun.

Monday, April 28, 2008

Les And Pete A Place In Greece Where Are They Now

Create your avatar

FaceYourManga a site where we can create our own avatar in manga style in a few steps through the flash. There are many possible combinations which sbizzarirsi and almost come to a realistic representation of themselves.

fun to create your avatar.



Blogged with the Flock Browser

Thursday, April 24, 2008

Epiditimitus How Long To Recover

vNES Nintendo emulator on the web

VirtualNES.com is the most vNES great website on the Internet. vNES is a Nintendo emulator programmed in Java. You can gocare co browser on any operating system. There is a wide variety of games to choose from. Once you choose your game will open a page with an applet with the game we can play with here when we want.
Blogged with the Flock Browser

Moderate Cervical Stenosis

top position in the ranking of the Java language

with Java (20.5%) remains firmly in the lead in the standings TIOBE followed by C but also sees the rise languages as (Visual) Basic (11.699%) with 3.42% more rispeto the last year.

18th Birthday Invitation Templates

2008 www.jaaava.com a search engine for java

Jaaava a search engine for us Java developers, who often explored the engine google in search of materials, documents, and snippets of code to solve the problems that afflict us every moment of our day.

Wednesday, April 23, 2008

Who Did George Crum Marry

Upgrade To Ubuntu 8.04


After a long wait I updated my ubuntu with a simple shell command "sudo apt-get dist-upgrade-d-c", and after an hour of waiting before I find the version 8.04 . :)

Tuesday, April 15, 2008

Brown Discharge Thick

Kill Bill

Monday, April 14, 2008

Making A Shuffleboard Table

Java Remoting: hack a Wiimote

This week, Thursday April 17 monthly meeting will be held the jug of Rome. Rapporteur of the meeting which will discuss and Valerio De Carolis Motion Analysis as an argument to Java, or how to use the Nintendo controller using Bluetooth and Java.

to subscribe go Jug Roma

Monday, April 7, 2008

Puppy Sayings Invitations

Be

Friday, April 4, 2008

Inspirational Quotes For Hispanic Women

Managing Linux code on WebSphere 6.0

In this article we will see how to run a JMS message to WebSphere 6.0.

First, open the WebSphere Administration Console and go to define a bus,
which is the layer logically interposed between producer and consumer, can be deployed on different machines or processors.

BUILDING BUS

On the console go

Integration Services> Bus> Insert a new bus,
NOSTROBUS . ( not enable security).

After creating the Bus let's add our server as a member of the bus

( NOSTROBUS > members of the bus)


Once finished creating the bus going to define the destination, which is nothing but a transit point for any post in the bus.


DESTINATION CREATION

go on to define a destination:

Integration Services> bus > NOSTROBUS Destinations
New> Queue> Next> NOSTRADESTINAZIONE

After defining the target bus and let's create a JMS Connection Factory that will help us to retrieve the connection when reading and writing messages.

CREATION JMS connection factory

To do this we go:

Resources> JMS Providers> Default Messaging> JMS Connection Production> New

At this point we are going to enter the name of our Factory Connection NOSTRACF , the reference jndi JMS / NOSTRACF and select the bus NOSTROBUS

At this point we can go to define our Queue (Queue) :


CREATE QUEUE

To do this we go:

Resources> JMS Providers> Default Messaging> JMS Code> New

Now let's enter the name of our Coda NOSTRACODA , jndi reference
JMS / NOSTRACODA and select the bus NOSTROBUS and our destination NOSTRADESTINAZIONE .

At this point we have finished the configuration of our JMS queue, now let's see how to handle them.


Add a message on the queue

To post a message on the queue using

private void inviaMessaggio (String message) {

/ / First declare Connection, Session and MessageProducer of javax.jms.
Connection conn = null;
Session session = null;
MessageProducer mp = null;


try {/ / Get the InitialContext
InitialContext context = new InitialContext ();

/ / do the lookup of the ConnectionFactory by jndi
ConnectionFactory cf = (ConnectionFactory) contesto.lookup ("JMS / NOSTRACF");

/ / do the lookup via JNDI Destination Queue
Destination destination = (Destination) contesto.lookup ("JMS / NOSTRACODA) ;

/ / Create a connection from the Factory Connection conn =
cf.createConnection ();

/ / Create the session from the connection
conn.createSession session = (false, Session.AUTO_ACKNOWLEDGE)

/ / Create the producer passing as a parameter to our destination
session.createProducer mp = (target);

/ / Create message TextMessage message =
session.createTextMessage ();

/ / Put the message text
message.setText (message);

/ / Set the message destination
message.setJMSDestination (target);

/ / Set the mode on delivery (NON_PERSISTENT means that the message will be read only by an individual consumer and then deleted from the queue)
mp.setDeliveryMode (DeliveryMode.NON_PERSISTENT)

/ / Sending Message
mp.send (message);
System.out.println ("Message Sent! !!!");

} catch (Exception e) {
System.out.println ("Message Exception !!!!"+ e.getMessage ());

} finally {if (conn! = null) try { {
Session.close ();
mp.close ();
conn.Close ();
} catch (Exception e1) {
e1.printStackTrace ();}


}}}

Read a message from the queue

To read a message from the queue using

private String leggiCoda (ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {

/ / First, declare Connection, and Session of MessageConsumer javax.jms
Connection conn = null;
Session session = null;
MessageConsumer mc = null;

try {/ / Get the InitialContext
InitialContext context = new InitialContext ();

/ / do the lookup of the ConnectionFactory via JNDI
ConnectionFactory cf = (ConnectionFactory) contesto.lookup ("JMS / NOSTRACF" )

/ / do the lookup via JNDI Destination Queue
Destination destination = (Destination) contesto.lookup ("JMS / NOSTRACODA");

/ / Create a connection from the Connection Factory
cf.createConnection conn = ( )

/ / Create the session from the connection
conn.createSession session = (false, Session.AUTO_ACKNOWLEDGE)

/ / Creo parameter passing to the consumer as our destination
session.createConsumer mc = (target);

/ / Open the connection
conn.start ();

/ / Create a while loop to listen for messages in the queue
TextMessage message = null;
while (true) {Message m =
mc.receive (1);

/ / If there is a message we return the text.
if (m! = Null) {

message = (TextMessage) m;
System.out.println ("Message Received !!!!");

message.getText return ();}



}
} catch (Exception e) {
System.out.println ("Message Exception !!!!"+ e.getMessage ());} finally {

if (conn! = null) {try {
Session.close ();
mc.close ();
conn.Close ();
} catch (Exception e1) {
e1.printStackTrace ();}

}}

return null;}

Thursday, March 20, 2008

Encephalitis And Encephalopathy Difference



To upload a file we will use the libraries of struts. First What we are going to create a form that will take care of accessor methods for the file that we will save that type of FormFile struts.
 

package com.myapp.struts.action;

import org.apache.struts.action . ActionForm;
import org.apache.struts.upload.FormFile;

/
** * * @ author
r.sheshi
* / public class UploadFile
extends ActionForm {private
FormFile file;

public FormFile getFile () {
return file;}


public void SetFile (FormFile file) {
this.file = file;}



}

After defining the form to create JSPs that will do the upload.
 


\u0026lt;html:form action="/upload" enctype="multipart/form-data">
\u0026lt;html:file property="file" />
\u0026lt;html:submit value="carica" \u200b\u200b
/> \u0026lt;/ html: form>



The form must have the enctype set to "multipart / form-data" and use the tag html: file with propetrty set to "file" as mapped in our form. Now let's create our action.
 

/
** * * @ author
r.sheshi
* / public class
CaricaFileAction extends Action {



@ Override public ActionForward execute (ActionMapping mapping
,
ActionForm form, HttpServletRequest request
,
HttpServletResponse response) throws Exception {

DynaActionForm f = (DynaActionForm) form;
FormFile ff = (FormFile) f.get ("file");

return mapping.findForward ("success");}


}

The action we take the file from the bean that has struts valorizzato.Dopo taking the file you should go and inserilo blob in our field. Thus we create an object that we will take care of transferring data from the action of the Dao that ocuperà place.
 

/
** * * @ author
r.sheshi
* / public class
FileDto


{private int id;
private byte [] bytes;
private int size;
private String name;
private String contentType;


public void setBytes(byte[] bytes) {
this.bytes = bytes;
}

public byte[] getBytes() {
return bytes;
}
public void setId(int id) {
this.id = id;
}

public int getId() {
return id;
}


public void setName(String name) {
this.name = name;
}

public void setSize(int size) {
this.size = size;
}

public void setContentType(String type) {
this.type = type;


} public String getName () {
return name;}


public int getSize () {return size
;


} public String getContentType () {return type
;
}}



Now that we have our Dto that has a class variable array of bytes that will enhance it in action by using the method FormFile getFileData ().
 
DynaActionForm f = (DynaActionForm) form;
FormFile ff = (FormFile) f.get ("file");

FileDto FileDto dto = new ();
dto.setBytes (ff.getFileData ());
dto.setContentType (ff.getContentType ());
dto.setSize (ff.getFileSize ());
dto.setName (ff.getFileName ());


Now that we have enhanced our Dto passes it to the DAO to insert it into the database.
 

FileDao FileDao dao = new ();
dao.insert (dto);


Then in FileDao esguiamo operations for inseriento FILE in our table, which will have 4 fields (ID, FILE ( BLOB), name (VARCHAR), CONTENT_TYPE (VARCHAR)).

 

private String INSERT = "INSERT INTO VALUES FILE (?,?,?,?)";

public void insert (FileDto dto) {PreparedStatement ps
= Null;
Connection con = null;

try {con = getConnection


();
con.prepareStatement ps = (INSERT);
ps.setInt (1, dto.getId)
ps.setBytes (2 , dto.getBytes ());
ps.setString (3, dto.getName ());
ps.setString (4, dto.getContentType ());
ps.executeUpdate ();
} catch (SQLException ex)
{Logger.getLogger (FileDao.class.getName ())
. log (Level.SEVERE, null, ex);} finally {


try {if (ps! = null) ps.close ();
if (with! = null) con.close ();

} catch (SQLException ex) {Logger.getLogger
(FileDao.class.getName ())
. log (Level.SEVERE, null, ex);}


}}


At this point we will have our table inside the file and all information.




How do we get the file when we need it?



Now that we have our files in the database we create an action to display a list of files.
add a method to the Dao, which will make a select returning an ArrayList of Dto enhanced with only id and name.
 

listaFile public ArrayList () {
PreparedStatement ps = null;
ResultSet rs = null;
Connection con = null;

DTOS ArrayList = new ArrayList ();



try {con = getConnection () ;
con.prepareStatement ps = (SELECT);
ps.executeQuery rs = ();
while (rs.next ()) {dto = new
FileDto FileDto ();
dto.setId (rs.getInt (1) )
dto.setName (rs.getString (2));


dtos.add (dto);


}} catch (SQLException ex) {Logger.getLogger
(FileDao.class.getName ())
. Log (Level.SEVERE, null, ex);} finally {


try {if (rs! = Null) ps.close ();
if (ps! = null) ps.close ();
if (with! = null) con.close ();
} catch (SQLException ex) {Logger.getLogger
(FileDao.class . getName ())
. log (Level.SEVERE, null, ex);}

}
DTOS return;}



Then we create a new Action that calls the listaFile method that will have as a return mettermo in our collection that request and then sliding it in jsp.
 

ListaFileAction extends Action {public class



@ Override public ActionForward execute (ActionMapping mapping, ActionForm form
,
HttpServletRequest request, HttpServletResponse
response) throws Exception {


FileDao FileDao dao = new ();
ArrayList DTOS dao.listaFile = ();
request.setAttribute ("list", DTOS)
return mapping.findForward ("list");


}}



Now that we have our list in jsp visualizziamola as a series of links to click that will call a action passing id file to download.
 


\u0026lt;html:html>
\u0026lt;logic:present name="lista">
\u0026lt;logic:iterate name="lista" id="dto">

\u0026lt;html: link action = "/ download" aramid = "fileid"
paramName = "dto" paramProperty = "id">

\u0026lt;bean:write name="dto" property="name"
/> \u0026lt;/ html: link>
\u0026lt;/ logic: iterate>
\u0026lt;/ logic: present>
\u0026lt;/ html: html>



proceed to create the action that handles the download of files by the ID that will pass in link will retrieve the file in the database by calling the Dao.
 
SELECT_BY_ID private String = "Select * from files where id =?"
public FileDto findById (int id) {
PreparedStatement ps = null;
ResultSet rs = null;
Connection con = null;
FileDto dto = FileDto new ();

try {con = getConnection


();
con.prepareStatement ps = (SELECT_BY_ID);
ps.setInt (1, id);
ps.executeQuery rs = ();
while (rs.next ()) {Blob blob =
rs.getBlob (2);
byte [] bytes = blob.getBytes (1, (int) blob.length ());
dto.setId (rs.getInt (1));
dto.setBytes (bytes);
dto.setName (Rs. getString (3));
dto.setContentType (rs.getString (4));





}} catch (SQLException ex) {Logger.getLogger
(FileDao.class.getName ())
. Log (Level.SEVERE, null, ex);} finally {


try {if (rs! = Null) ps.close ();
if (ps! = Null) ps.close (); if
(with! = null) con.close ();
} catch (SQLException ex) {Logger.getLogger
(FileDao.class.getName ())
. log (Level.SEVERE, null, ex);}

}
return dto;}




After calling the method findById () of the Dao we set the ContentType in the response depending on the type of file. In the attachment so that we set Header be downloaded on the local and the name of the file. Then get ServletOutputStream and write the byte array.

 

DownloadAction extends Action {public class



@ Override public ActionForward execute (ActionMapping mapping, ActionForm form
,
HttpServletRequest request, HttpServletResponse
response) throws Exception {

FileDao FileDao dao = new ();
String id = request.getParameter ("fileid");
FileDto dao.findById dto = (Integer.parseInt (id));

response.setContentType (dto.getContentType ());
response.setHeader ("Content-Disposition",
"attachment; filename = \\" "+ dto.getName () +" \\ "");

final ServletOutputStream response.getOutputStream out = ();
out.write ( dto.getBytes ());


return null;}


}

Friday, March 14, 2008

Bake Waffles (pancakes Of Hearts)

File Upload and Download The Song

Wednesday, February 27, 2008

Teeth Pulled Now White

Developer Java IDE Day


What is this?
arrives in Italy for the first time the international event that compares the most widely used Java IDE and their community.

JDeveloper (Oracle), NetBeans (Sun Microsystems), IntelliJ IDEA (JetBrains), send an evangelist of their core international development to confront each other.

present Speaker:

  • Roman Strobl (Sun Microsystems)
  • Paul Ramasso (Oracle)
  • Vaclav Pech (JetBrains)

Unfortunately, despite the commitment by both parties, it was not possible to have the presence of Eclipse .

How?
One time slot available for each IDE to show the potential of their environment than others.

key role is played by the public as they are provided posted spaces to ask questions directly to the international evangelist.

The final part of 'event will be dedicated to a reasoned debate on the future of development environments.

The event will be in English.

Cost:
The event is free, but registration is appreciated.

Organization:
IDE Day is organized by Jug Jug Genoa and Rome

When and where:
There are two dates: Genoa, and Rome on March 10, March 12
The event will take place in the afternoon , within the university.

For schedules, calendar and logistical information, please go to 's event.

Related Sites: http://www.ideday.org/