Following day's I was completely worries and frustrated with my bad experience on web services with Eclipse plugging for Axis.
Found a solution today. It is netbeans. Really nice and I love the way it creates the implementation from wsdl file.
Monday, August 10, 2009
Saturday, August 8, 2009
axis2 plugins for Eclipse
I wasted a complete day by trying to do a web service using them.
It is a complete bad job. There are no complete set of jar files in lib folder. When the site says it is version 1.4.1 but when downloaded it is shown as 1.3.
Followed 2 tutorials published by WSO2. Oops, only the frustration is left.
When you do something, do it properly.
It is a complete bad job. There are no complete set of jar files in lib folder. When the site says it is version 1.4.1 but when downloaded it is shown as 1.3.
Followed 2 tutorials published by WSO2. Oops, only the frustration is left.
When you do something, do it properly.
Tuesday, August 4, 2009
A simple SOAP client
The program is written in C#.
You can find a java client in http://www.cafeconleche.org/books/xmljava/chapters/ch03s05.html
The below code will not work just by copying and executing. If you are familliar with C# will get the idea.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Xml;
using System.IO;
using System.Net;
namespace WWeb
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
XmlDocument doc = new XmlDocument();
doc.Load(@textBoxIn.Text);
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(textBoxURL.Text);
req.Headers.Add("SOAPAction", "\"\"");
req.ContentType = "text/xml;charset=\"utf-8\"";
req.Accept = "text/xml";
req.Method = "POST";
Stream stm = req.GetRequestStream();
doc.Save(stm);
stm.Close();
WebResponse resp = req.GetResponse();
stm = resp.GetResponseStream();
StreamReader r = new StreamReader(stm);
richTextBox1.AppendText(r.ReadToEnd());
}
private void buttonIn_Click(object sender, EventArgs e)
{
openFileDialog1.ShowDialog();
textBoxIn.Text = openFileDialog1.FileName;
}
}
}
You can find a java client in http://www.cafeconleche.org/books/xmljava/chapters/ch03s05.html
The below code will not work just by copying and executing. If you are familliar with C# will get the idea.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Xml;
using System.IO;
using System.Net;
namespace WWeb
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
XmlDocument doc = new XmlDocument();
doc.Load(@textBoxIn.Text);
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(textBoxURL.Text);
req.Headers.Add("SOAPAction", "\"\"");
req.ContentType = "text/xml;charset=\"utf-8\"";
req.Accept = "text/xml";
req.Method = "POST";
Stream stm = req.GetRequestStream();
doc.Save(stm);
stm.Close();
WebResponse resp = req.GetResponse();
stm = resp.GetResponseStream();
StreamReader r = new StreamReader(stm);
richTextBox1.AppendText(r.ReadToEnd());
}
private void buttonIn_Click(object sender, EventArgs e)
{
openFileDialog1.ShowDialog();
textBoxIn.Text = openFileDialog1.FileName;
}
}
}
Saturday, August 1, 2009
Creating a table from a query
The method varies according to the DB you are using
Oracle:
create table t_newTable as select * from oldTAble;
mySQL:
create table t_newTable select * from oldTAble;
MSAccess:
SELECT * INTO t_newTable FROM oldTAble;
Oracle:
create table t_newTable as select * from oldTAble;
mySQL:
create table t_newTable select * from oldTAble;
MSAccess:
SELECT * INTO t_newTable FROM oldTAble;
Labels:
create table from query,
msaccess,
mysql,
oracle,
sql
Thursday, July 30, 2009
Sample code for accessing mySQL from java
import java.sql.*;
public class DBConnect {
/**
* @param args
*/
public static void main(String[] args) {
Connection connection = null;
try {
String driverName = "com.mysql.jdbc.Driver"; // MySQL MM JDBC driver
Class.forName(driverName);
connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/databaseName", "userName", "password");
}
catch (Exception e) {
e.printStackTrace();
}
Statement stmt;
String s;
String own;
try {
stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM pet");
while (rs.next()) {
// Get the data from the row using the column name
s = rs.getString("name");
own = rs.getString("owner");
System.out.println(s + " owned by " + own);
}
}
catch (SQLException e) {
e.printStackTrace();
}
}
}
public class DBConnect {
/**
* @param args
*/
public static void main(String[] args) {
Connection connection = null;
try {
String driverName = "com.mysql.jdbc.Driver"; // MySQL MM JDBC driver
Class.forName(driverName);
connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/databaseName", "userName", "password");
}
catch (Exception e) {
e.printStackTrace();
}
Statement stmt;
String s;
String own;
try {
stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM pet");
while (rs.next()) {
// Get the data from the row using the column name
s = rs.getString("name");
own = rs.getString("owner");
System.out.println(s + " owned by " + own);
}
}
catch (SQLException e) {
e.printStackTrace();
}
}
}
Tuesday, July 28, 2009
My adventures with DB
First step
I was introduced to MS access when I was about 12 years old. To be frank I understand nothing then.
Rebirth
My 2nd introduction to DB was when I was 24 to Oracle. since then I have been studying DBs.
Following is solely my opinion and I do not recommend anyone to follow them. Of course no liability what so ever will be admitted.
MS Access
Our little friend. The best place to get started with DB.
Pros:
1. Intuitive interface
2. Easy imports and exports to other file formats.
3. Easy installation
4. No maintenance
Cons:
1. Poor SQL interface
2. Cannot be used as fully pledged DB server
MySQL
The free guy with lot of talents
Pros:
1. Free
2. Production level DB server
2. Easy to install
Cons:
1. No built GUI
Oracle
Pros:
1. Production level
2. Free version is available
Cons:
1. Messy to maintain.
2. Messy to get started
3. No built in GUI
DB interfaces
DB interfaces add GUI to oracle and mySQL servers
Toad for mySQL
Pros:
1. Free
2. Easy installation
3. Intuitive interface
Cons:
1. One query at a time
2. Importing data from other file formats is bit poor.
Toad for Oracle
Pros:
1. Good functionality
2. Concurrent connections
3. Lot of tools to manage the DB
Cons:
1. Cluttered window. Not even slightly intuitive
2. Free version is a crippled version
SQL developer
Pros:
1. Free
2. Nice object browser
3. Very intuitive interface
Cons:
1. Support only xls and csv file imports
PL/SQL developper
Pros:
1. Intuitive interface
Cons:
1. Lower level support for maintenance
I was introduced to MS access when I was about 12 years old. To be frank I understand nothing then.
Rebirth
My 2nd introduction to DB was when I was 24 to Oracle. since then I have been studying DBs.
Following is solely my opinion and I do not recommend anyone to follow them. Of course no liability what so ever will be admitted.
MS Access
Our little friend. The best place to get started with DB.
Pros:
1. Intuitive interface
2. Easy imports and exports to other file formats.
3. Easy installation
4. No maintenance
Cons:
1. Poor SQL interface
2. Cannot be used as fully pledged DB server
MySQL
The free guy with lot of talents
Pros:
1. Free
2. Production level DB server
2. Easy to install
Cons:
1. No built GUI
Oracle
Pros:
1. Production level
2. Free version is available
Cons:
1. Messy to maintain.
2. Messy to get started
3. No built in GUI
DB interfaces
DB interfaces add GUI to oracle and mySQL servers
Toad for mySQL
Pros:
1. Free
2. Easy installation
3. Intuitive interface
Cons:
1. One query at a time
2. Importing data from other file formats is bit poor.
Toad for Oracle
Pros:
1. Good functionality
2. Concurrent connections
3. Lot of tools to manage the DB
Cons:
1. Cluttered window. Not even slightly intuitive
2. Free version is a crippled version
SQL developer
Pros:
1. Free
2. Nice object browser
3. Very intuitive interface
Cons:
1. Support only xls and csv file imports
PL/SQL developper
Pros:
1. Intuitive interface
Cons:
1. Lower level support for maintenance
Tuesday, March 24, 2009
Intergrated light out : HP proliant
HP proliant servers come up with an interesting remote management tool : iLO
The inbuilt one is the basic iLO which is a crippled version of advanced iLO. Basic iLO does not have many feature such as remotely viewing the screen and mounting remote media.
You need to purchase a license for the Advance iLO. As an option you may get a free evaluation licence for 60 days.
One of the disadvantages I observed in iLO is that its screen is not very sensitive. That means it cannot recognize if you move the mouse fast across the screen
The inbuilt one is the basic iLO which is a crippled version of advanced iLO. Basic iLO does not have many feature such as remotely viewing the screen and mounting remote media.
You need to purchase a license for the Advance iLO. As an option you may get a free evaluation licence for 60 days.
One of the disadvantages I observed in iLO is that its screen is not very sensitive. That means it cannot recognize if you move the mouse fast across the screen
Subscribe to:
Posts (Atom)