ListPropertiesNow.com

March 6, 2008

JBuilder’s new version

Filed under: Programming — info @ 1:53 am

Jbuilder’s new version is really just Eclipse with a few more stickers on top. I have used Netbeans until now and since everyone seems to be moving to Eclipse I thought I should give it a try. But, for forms and other design work Eclipse is not very good. Netbeans rules for that stuff. So, I heard that Jbuilder is much better for the complete package. Maybe the older version has better design tools.

 

February 28, 2008

Telefónica Madrid Netgear 834G

Filed under: Uncategorized — info @ 7:53 am

I just moved from one place in Madrid to another place. Here are some things that I noticed:

 1 - My number changed

 2 - When the tech came he had no clue about anything.

 3 - Most importantly, Telefónica now uses Adsl2+ . If you had regular Adsl before they don’t know

      this. I had to upgrade the router with the new firmware from netgear.com in order for it to work.

      So, don’t bust your head against the wall trying to fix the problem. Make sure you upgrade the firmwarefirst.

      As always, the same user-pass combo from before worked.

      adslppp@telefonicanetpa

      adslppp

      you may have to put the dns server in also. Telefónica can give you those.

     Hope this helps!

    

December 20, 2007

Alicia Keys

Filed under: Uncategorized — info @ 6:11 am

I think that the newer Alicia Keys song is great. She’s an awesome singer.

Ruby on Rails download

Filed under: Programming — info @ 6:09 am

If you’re looking for a tutorial or just getting started with ruby on rails. You should without a doubt download the Bitnami Ruby Stack. You can find it here:

 http://bitnami.org/product/rubystack

It includes mysql, apache server, and the ruby language. Very nice….

Sadly it’s only available on Windows right now.

 

Ruby on Rails download

Filed under: Uncategorized — info @ 6:09 am

If you’re looking for a tutorial or just getting started with ruby on rails. You should without a doubt download the Bitnami Ruby Stack. You can find it here:

 http://bitnami.org/product/rubystack

It includes mysql, apache server, and the ruby language. Very nice….

Sadly it’s only available on Windows right now.

 

Jakarta Commons datbase connection pool eclipse

Filed under: Programming — info @ 5:56 am

I had a hard time getting the database connection pool to work with Tomcat 5.5.

In the end this is what I did. 

[code]

 This is a quick tutorial on what I did to get data pool connections to work with Tomcat 5.5 and jakarta commons.
First you will need to go here and put these files:

C:\Archivos de programa\apache-tomcat-5.5.25\common\lib

classes12.jar also put the same file in there renaming it to classes12.zip
commons-collections-3.2.jar
commons-dbcp-1.2.2.jar
commons-pool-1.3.jar

All of those files are included in this package.

Note: the above will only work in 5.5, in tomcat 5.5 and back you will have to put the config in the server.xml file for the Tomcat configuration.

Once you have those files in the library open up a new .war file

The example here is called DataPoolConnection.war and it has the code you need to get a connection.

NOTE: you can change the amount of connections if you want that an app can make, etc…
The most important part of this is that you add a context.xml file in your web app in Eclipse under WebContent -> META-INF -> context.xml
put this in the file:


        
      
     type=”javax.sql.DataSource” removeAbandoned=”true”
   removeAbandonedTimeout=”30″ maxActive=”100″
   maxIdle=”30″ maxWait=”10000″ username=”username”
   password=”mypassword”
   driverClassName=”oracle.jdbc.driver.OracleDriver”
   url=”jdbc:oracle:oci:userdb/passdbll@instancedb”/>
  
 
You will need to make a connection class:

package org.app.apache.connection;
import java.sql.Connection;
import java.sql.SQLException;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;
public class DBConnection{
 public static Connection getDBConnection() throws SQLException, NamingException{
   InitialContext ctx = new InitialContext();  
   DataSource ds = (DataSource)ctx.lookup(”java:comp/env/jdbc/OracleDB”);  
   return ds.getConnection();
  }
}

 

Make sure that you add the resource ref in the web.xml file:
 
  Oracle Datasource
  jdbc/OracleDB
  javax.sql.DataSource
  Container
 

 
Then to access the connection class:

package org.app.apache.actions;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.app.apache.connection.DBConnection;
import javax.sql.DataSource;
import java.sql.Connection;
public class TheAction extends Action
{
  public ActionForward execute(
    ActionMapping mapping,
    ActionForm form,
    HttpServletRequest request,
    HttpServletResponse response) throws Exception{
   DBConnection dc = new DBConnection();
  if(!dc.getDBConnection().isClosed()){
       System.out.println(”connection open: JOHN OPEN”);
   }
   else{
      System.out.println(”connection closed: JOHN CLOSED”);
   }
   System.out.println(”connection open: JOHN WHAT”);
      return mapping.findForward(”success”);
  }

 

There you have it your own connection pool.

 

 

[/code]

December 11, 2007

Strut example

Filed under: Programming — info @ 7:12 am

This is a good example of struts and a db connection. Later, you may want to try db pooling.

 web.xml

========

xml version=“1.0″ encoding=“ISO-8859-1″?>

<servlet>

<servlet-name>actionservlet-name>

<servlet-class>org.apache.struts.action.ActionServletservlet-class>

<init-param>

<param-name>configparam-name>

<param-value>/WEB-INF/struts-config.xmlparam-value>

init-param>

<load-on-startup>2load-on-startup>

servlet>

 

 

<servlet-mapping>

<servlet-name>actionservlet-name>

<url-pattern>*.dourl-pattern>

servlet-mapping>

 

 

<welcome-file-list>

<welcome-file>index.jspwelcome-file>

welcome-file-list>

 

web-app>

 Struts-Config.xml

 Struts-Config.xml===============

xml version=“1.0″ encoding=“ISO-8859-1″ ?>

<form-beans>

<form-beanname=“TheForm”

type=“org.app.apache.forms.TheForm”>

 

 

<form-property name=“results” type=“org.app.apache.forms.results” />

form-bean>

form-beans>

 

<global-forwards>

<forwardname=“welcome”

path=“/welcome.do”/>

 

 

global-forwards>

<action-mappings>

<action path=“/welcome” type=“org.app.apache.actions.TheAction”

name=“TheForm”>

 

 

<forward name=“success” path=“/pages/welcome.jsp”/>

action>

 

action-mappings><message-resources parameter=“MessageResources” />

struts-config>

 

 

index.jsp

========

<logic:redirect forward=“welcome”/>

 

 

 

<html:html>

<head><

title><bean:message key=“welcome.title”/>title>

<html:base/>

head><body bgcolor=“white”>

<logic:notPresent name=“org.apache.struts.action.MESSAGE” scope=“application”>

 

 

<font color=“red”>

ERROR: Application resources not loaded — check servlet container

logs for error messages.

font>

logic:notPresent>

 

<logic:iterate id=“rsts” name=“results”>

<bean:write name=“rsts”/>

<br>>><br>

logic:iterate>

 

<h3><bean:message key=“welcome.heading”/>h3>

<p><bean:message key=“welcome.message”/>p>

 

 

body>

html:html>

 

 

 

TheAction.java

=========

package org.app.apache.actions;

import org.app.apache.db.MyOracleConnection;

import java.util.ArrayList;

import java.sql.*;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;

import org.apache.struts.action.ActionForm;

import org.apache.struts.action.ActionForward;

import org.apache.struts.action.ActionMapping;

public class TheAction extends Action

{

public ActionForward execute(

ActionMapping mapping,

ActionForm form,

HttpServletRequest request,

HttpServletResponse response) throws Exception{

MyOracleConnection db = new MyOracleConnection();ResultSet rs =

null;

db.getConnection();

ArrayList results = new ArrayList();

rs=db.executeSQL(“select agente_id from agente”);

while(rs.next()){results.add(rs.getString(“agente_id”));

}

db.closeConnection();

request.setAttribute(“results”, results);return mapping.findForward(“success”);

}

}

 

 

 

MyOracleConnection.java

=================

 package org.app.apache.db;
import java.sql.*;
import javax.sql.*;
import javax.naming.*;

public class MyOracleConnection {
 Connection con;
 ResultSet rs;
    String driverName;
 
 public MyOracleConnection(){
 }
 public void getConnection(){
  try{
    driverName  = “oracle.jdbc.driver.OracleDriver”;
    Class.forName(driverName);
    con= DriverManager.getConnection(”jdbc:oracle:oci:userid/password@dbInstance”);
  }
  catch(Exception e){
   System.out.println(”dbConnect error”);
  }
 }
 public void closeConnection(){
  try{
   if (con.isClosed() == false ){
    //close the connection if open
    con.close();
   }
   rs.close();
  }
  catch(Exception e){
   System.out.println(”dbClose  error”);
  }
 }
 public ResultSet executeSQL(String SQL){
  try{
   Statement stmt = con.createStatement();
   stmt.execute(SQL);
   rs = stmt.getResultSet();
  }
  catch(Exception e){
   System.out.println(”rsGrap error”);
  }
  return rs;
 }
 

}

 

 

TheForm.java

==============

package org.app.apache.forms;
import java.util.ArrayList;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.*;

/* this is called a form bean*/

public class TheForm extends ActionForm{
 private ArrayList results = new ArrayList();
 public void setResults(ArrayList results){
  this.results = results;
 }
 public ArrayList getResults(){
  return results;
 }
   // Reset form fields.
 public void reset(ActionMapping mapping, HttpServletRequest request)
 {
  results = null;
 }
}

 

 

 

 

 

 

December 7, 2007

Struts and Java and Eclipse

Filed under: Programming — info @ 1:48 am

O.k.

Eclipse for Java using Struts on Windows is not that good. Why would anyone want this on a windows environment? I’ve got it up and working and I’ve accomplished the normal tasks such as database calls and hello world apps.

I have a problem though. Eclipse seems to shutdown alot and I’m not understanding some of the db stuff. Does someone have some code from a successful application that they can help me with. Contact me at the contact form on the root of this website.

 Thanks,

JO 

 

December 6, 2007

Brad Pitt properties in New Orleans

Filed under: Uncategorized — info @ 5:33 am

Does anyone know how to get one of those brad pitt properties.

 You can post it for free on this website.

 www.listpropertiesnow.com\

 

 

 

October 31, 2007

Homes on the market

Filed under: Uncategorized — info @ 11:03 am

Is it impossible to get a decent home for a decent price these days? Please someone respond to this or go to the home page and fill out a form to list your property. I’m unable to find a decent place to list a property. I mean if I’m talking someone face to face I don’t want to send them to some place where there’s just a huge amount of text and you know the rest…..

Next Page »

Powered by WordPress