Wednesday, August 19, 2009

Java: Creating a JDBC Connection to OpenOffice.Org Databases

Download "hsqldb_1_8_0_10.zip" (HSQLD DB ENGINE) from http://sourceforge.net/project/downloading.php?group_id=23316&use_mirror=ovh&filename=hsqldb_1_8_0_10.zip&84223716

Extracted [adapted] from: http://digiassn.blogspot.com/2006/07/java-creating-jdbc-connection-to.html

Java: Creating a JDBC Connection to OpenOffice.Org Databases

The following example will open an OpenOffice.org Base file via the Java ZIP classes, extract the necessary files to the temporary folder, create the JDBC connection using the HSQLDB JDBC driver, query, then delete the temp files.

import java.sql.*;
import java.util.zip.*;
import java.io.*;
import org.hsqldb.jdbcDriver;
import java.util.*;

public class Test {
public static void main(String[] args) {
jdbcDriver j = new jdbcDriver(); //Instantiate the jdbcDriver from HSQL
Connection con = null; //Database objects
Statement com = null;
ResultSet rec = null;
ZipFile file = null; //For handeling zip files
ZipEntry ent = null;
Enumeration en = null; //For the entries in the zip file
BufferedOutputStream out = null; //For the output from the zip class
InputStream in = null; //for reading buffers from the zip file
File f = null; //Used to get a temporary file name, not actually used for anything
int len; //General length counter for loops
List v = new ArrayList(); //Stores list of unzipped file for deletion at end of program

//Unzip zip file, via info from
//http://www.devx.com/getHelpOn/10MinuteSolution/20447

try
{
//Open the zip file that holds the OO.Org Base file
file = new ZipFile("/home/digiassn/OODatabase/employeeDatabase.odb");

//Create a generic temp file. I only need to get the filename from
//the tempfile to prefix the extracted files for OO Base
f = File.createTempFile("ooTempDatabase", "tmp");
f.deleteOnExit();

//Get file entries from the zipfile and loop through all of them
en = file.entries();
while (en.hasMoreElements())
{
//Get the current element
ent = (ZipEntry)en.nextElement();

//If the file is in the database directory, extract it to our
//temp folder using the temp filename above as a prefix
if (ent.getName().startsWith("database/"))
{
System.out.println("Extracting File: " + ent.getName());
byte[] buffer = new byte[1024];

//Create an input stream file the file entry
in = file.getInputStream(ent);

//Create a output stream to write out the entry to, using the
//temp filename created above
out = new BufferedOutputStream(new FileOutputStream("/tmp/" + f.getName() + "." + ent.getName().substring(9)));

//Add the newly created temp file to the tempfile vector for deleting
//later on
v.add("/tmp/" + f.getName() + "." + ent.getName().substring(9));

//Read the input file into the buffer, then write out to
//the output file
while((len = in.read(buffer)) >= 0)
out.write(buffer, 0, len);

//close both the input stream and the output stream
out.close();
in.close();
}
}
//Close the zip file since the temp files have been created
file.close();

//Create our JDBC connection based on the temp filename used above
con = DriverManager.getConnection("jdbc:hsqldb:file:/tmp/" + f.getName(), "SA", "");

//Create a command object and execute, storing the results in the rec object
com = con.createStatement();
rec = com.executeQuery("select * from \"employees\"");

//GO through the resultset, and output the results
while (rec.next())
System.out.println("Last Name: " + rec.getString("nm_emp_last") + " First Name: " + rec.getString("nm_emp_first"));

//Close all the database objects
rec.close();
com.close();
con.close();

//Delete the temporary files, which file names are stored in the v vector
for (len = 0; len <> v.size(); len++)
(new File((String)v.get(len))).delete();
}
catch (Exception e)
{
e.printStackTrace();
}
}
}

Java error when connecting to Open Office Base Database

Java error when connecting to Open Office Base Database:

java.sql.SQLException: Wrong database file version
at org.hsqldb.jdbc.Util.sqlException(Util.java:365)
...

Try closing the Data Base before running the program.

Thursday, August 13, 2009

Democracy and Capitalism

Democracy and Capitalism are new ways to rapidly swap financial, economical and political power.

Democracia e Capitalismo

A Democracia e o Capitalismo são formas modernas para facilitar a troca de poder financeiro, econômico e político.

Tuesday, July 21, 2009

Outcome-Driven Innovation - ODI

What Is Outcome-Driven Innovation (R) (ODI)?

Based on the Whitepaper: What is Outcome-Driven Innovation?
From: http://www.strategyn.com/

Innovation

- is a business process;
- begins with market selection;
- uncover customer needs;
- determine unmet needs;
- select a growth strategy;
- devise and evaluate product and service concepts;
- approved concepts enter the development process.

If the innovation process were executed effectively, only winning products would enter the development process, and product success rates would exceed 70 percent – a vast improvement over today’s 70–90 percent failure rates.

Popular approaches

- "ideas-first" (brainstorm and customers test)

- large number of ideas
- quickly and inexpensively filter
- " if you fail fast and fail cheap, you have actually done your company a great service "
- "If you want to succeed, double your failure rate"
- Why it doesn't work:
- more ideas does not improve probability of coming up with the optimal one to satisfy unmet customer needs
- as customer’s unmet needs are unknown, the evaluation and filtering processes can miss great ideas and fail to filter out bad ideas

- "needs-first" (companies learn customer’s needs)

- understand the customer’s needs (methods: focus groups, personal interviews, customer visits, and ethnographic, contextual and observational research methods in addition to interviewing techniques such as voice of the customer (VOC), lead user analysis and storytelling)
- figure out which are unmet
- devise a concept that addresses those unmet needs
- Why it doesn't work:
- the belief that customers cannot articulate their needs and they cannot all be captured (the author believe it to be the opposite),
- the lack of a definition of what a customer need is (purpose, structure, content and syntax). Examples: a description of customer benefit, a measure of customer value, a statement of a problem etc.

"Managers find themselves in a position that is analogous to that of a chef who knows that certain ingredients are required to produce a certain taste, but is unable to figure out precisely what combination of ingredients are required to produce that taste. And once forced into that position, getting it right becomes an art, symbolized by a trial and error."


ODI is an effective needs-first approach to innovation

- supplies a definition of customer needs that the entire organization can embrace,
- offers a rigorous, controlled approach
- to collecting needs statements
- to formulating growth strategies
- to generating and validating breakthrough ideas
- does not fall back on the notion that there are needs that customers cannot articulate

We hold that the collection of inputs, like any other business process, ought to be well controlled and optimized for success

Over the years, we made eight very important discoveries:

1. When it comes to innovation, the job, not the product, must be the unit of analysis

- customers buy products and services to get jobs done (the fundamental goals customers are trying to accomplish or problems they are trying to solve).

- Ex: Focusing on creating a better record doesn’t help in the creation of the CD or the MP3 device, but focusing on improving the job of storing music supports the discovery and creation of new ways to help customers get the job done better.

From the customer’s perspective, it is the job that is the stable, long-term focal point around which value creation should be centered because the job's perfect execution reflects the customer's true definition of value.

Accepting the job as the primary unit of analysis has important downstream ramifications: companies must stop thinking that customer needs somehow relate to the use of a product or service and instead must understand that needs relate to how well the customer is getting a job done.

2. A job map provides the structure needed to ensure all customer needs are captured

- all functional jobs are processes and can be analyzed as such.
- a visual depiction of a functional job, deconstructed into its discrete process steps, which explains in detail exactly what the customer is trying to get done.
- NOT show what the customer is doing (a solution view);
- NOT describes what the customer is trying to get done (a needs view)

- all jobs consist of some or all of the eight fundamental process steps: define (plan, select, determine), locate (gather, access, retrieve), prepare (set up, organize, examine), confirm (validate, prioritize, decide), execute (perform, transact, administer), monitor (verify, track, check), modify (update, adjust, maintain) and conclude (store, finish, close);

- This insight is essential for creating a framework around which customer needs (desired outcomes) are gathered.

- Once a job map is created for a specific functional job, customer needs can be captured for each step in the job map. When need statements that describe issues related to the speed, stability and output of each process step are captured, all needs are known. We have discovered that most jobs consist of 8–12 process steps, that 6–12 needs exist per process step, and that approximately 50–150 needs exist for any given job.

When the job is the unit of analysis, there is no such thing as an unarticulated or latent customer need – customers clearly know what jobs they are trying to get done and how they measure success.

3. The proper definition of "customer need" becomes clear when the job is the unit of analysis

- to improve an existing product or to create a new product:
- figure out where the customer struggles in the execution of a specific job
- devise ways to help the customer
- analyze what must be measured and controlled to ensure the job is executed with the speed, predictability and output customers desire. customer needs: The metrics customers use to measure the successful execution of a job (customers’ desired outcomes)

- Desired outcome statements must conform to a specific structure ([ Direction of improvement ] … [ Unit of measure ] … [ Object of control ] …… [ Contextual clarifier ] … [ Example of object of control ]) and follow a set of stringent rules.

4. Different customer inputs are needed for concept innovation and design innovation

- A key goal of development is to optimize the product design so that customers are able to successfully execute a number of consumption chain jobs related to the use of the product or service – including the customer’s ability to purchase, receive, install, set up, learn to use, interface with, transport, store, maintain, upgrade, replace and dispose of the products they use.


5. The opportunity algorithm makes it possible to prioritize unmet needs

The more important the need is, and the less satisfied customers are, the greater the opportunity is for value creation. Using this formula, the needs that are most important and least satisfied receive the highest priority:

- Opportunity = Importance + max(Importance – Satisfaction, 0)

- Underserved desired outcomes represent opportunities for core and new market growth for a specific job
- Underserved jobs, on the other hand, represent opportunities for new market creation and ancillary market growth

- The Opportunity Landscape Model plots research data in an Importance x Satisfaction graph, wich has an Overserved (upper-left), Appropriately Served (center) and Underserved area (lower-right).

6. Opportunities (which needs are unmet) dictate which market growth paths to pursue

- there are only 6 growth paths that can be followed in order to achieve growth through innovation:

6.1 Add features to an existing platform to help customers get the core job done better,
6.2 Add features to an existing platform to help customers get related jobs done,
6.3 Create a new platform to help customers get the core job and related jobs done,
6.4 Create a new platform to help customers get the core job done better and/or cheaper,
6.5 Create a new platform that enables a new job executor to execute the core job, and
6.6 Create a new platform that enables a new job executor to execute the core and related jobs.

7. Scattershot brainstorming doesn’t work; sequenced and focused idea generation does

- concentrate solely on devising valued and potentially breakthrough solutions to address high-priority, unmet needs
- Companies rarely lack ideas – they simply lack focus.

8. The value of an idea can be quantified when all the needs are known

- ask customers to evaluate a new concept (platform and features) for its ability to satisfy all 50–150 customer needs

- present a feature to a customer and ask the degree to which that feature will satisfy a specific need.

Global benefitis of ODI

- Companies are no longer dependent on one person for their success.

- A common set of needs aligns all marketing and development strategies (ODI provides a single set of customer inputs)

- A single set of job-based customer inputs drives and aligns strategies for messaging, positioning, purpose branding and sales, along with strategies for beating the competition, pipeline prioritization, concept creation and evaluation, patent portfolio development, acquisition assessment, research and development and other related activities.

Thursday, June 25, 2009

Slow Down Now

How to slow down [... creativity is as important to us in this century as literacy was in the past]

1. Drink a cup of tea, put your feet up and stare idly out of the window. Warning: Do not attempt this while driving.

2. Do one thing at a time. Remember multitasking is a moral weakness (except for women who have superior brain function.)

3. Do not be pushed into answering questions. A response is not the same as an answer. Ponder, take your time.

4. Learn our Slow Manifesto.

5. Yawn often. Medical studies have shown lots of things, and possibly that yawning may be good for you.

6. Spend more time in bed. You have a better chance of cultivating your dreams (not your aspirations.)

7. Read the slow stories.

8. Spend more time in the bathtub. (See letter from Major Smythe-Blunder.)

9. Practice doing nothing. (Yes this is the difficult one.)

10. Avoid too much seriousness. Laugh, because you're live on earth for a limited time only.

(...)

Getting things done might all be well and good, but which things do you want to get done? Are you sure? That is a question that needs thinking about.

(...)

You never see self-help books on procrastination. But I think there is a need for How to Procrastinate.

(...)

Now here is where minimum effort comes in. If you can achieve the same result with a lot of effort or minimum effort which would you choose?

To my mind the answer is easy. Think how much effort it takes to drive a stick shift. When you learned it took a lot of thinking about. It took a lot of practice. You spent all that time crashing the gears and making a terrible noise. But once you mastered it, it only took a very tiny effort.

A better example is a swimmer. The poor swimmer splashes about using up lots of energy and getting nowhere. The accomplished swimmer uses minimum effort. She glides though the water with ease.

It’s a paradox: maximal effort with a goal of minimal effort. Ease up, slow down, and embrace counter-urgency.

(...)

Educational guru, Sir Ken Robinson [http://www.ted.com/index.php/talks/ken_robinson_says_schools_kill_creativity.html], says, creativity is as important to us in this century as literacy was in the past. It’s a survival skill. Whether designing a life to include a personal world outside of the demands of commerce, or thinking through problems in new ways, creativity needs to emerge from a place of gestation, rest, flexibility, and balance.


Adapted from the source: http://slowdownnow.org/ - Slow Down Now - The official website of the International Institute for Not Doing Much.