Example
Dim orderCreatedDateRaw As String = ""
Dim tempTime As String = "201203220836"
Dim dtDate As DateTime
dtDate = DateTime.ParseExact(tempTime, "yyyyMMddHHmm", CultureInfo.CurrentCulture)
orderCreatedDateRaw = dtDate.ToString("yyyy-MM-dd")
dont forget to import "System.Globalization"
Wednesday, March 21, 2012
org.apache.axis2.databinding.ADBException
This happen when client try to invoke the web service server... and then the error "org.apache.axis2.databinding.ADBException: Unexpected subelement ........." come out...
please check the parameter...
1st. see error remark.. "Unexpected subelement dataFeat"
2nd. find dataFeat parameter.
3rd. analysis your xml..
<listDatafeats>
<dataFeat></dataFeat>
<--- missing <dataFeat1> parameter -->
<dataFeat2></dataFeat2>
</listDatafeats>
so now you can ask the client side to change or add the parameter.
please check the parameter...
1st. see error remark.. "Unexpected subelement dataFeat"
2nd. find dataFeat parameter.
3rd. analysis your xml..
<listDatafeats>
<dataFeat></dataFeat>
<--- missing <dataFeat1> parameter -->
<dataFeat2></dataFeat2>
</listDatafeats>
so now you can ask the client side to change or add the parameter.
Sunday, January 8, 2012
Oracle : Date to Second Function
Below is sample for oracle function Date to second.
CREATE OR REPLACE FUNCTION TGATE_NI.DATE2TS (m_date_real IN DATE)
RETURN NUMBER IS
m_unix_start_date_real DATE;
m_days_difference NUMBER;
timeoutput NUMBER;
BEGIN
m_unix_start_date_real := TO_DATE('19700101 0000', 'YYYYMMDD HH24MI');
m_days_difference := (m_date_real - m_unix_start_date_real);
timeoutput := (m_days_difference * 86400) - 28800;
return timeoutput;
END;
/
Wednesday, January 4, 2012
MYSQL : Find duplicate
Just my reference..
select orderid, count(orderid) as totalorder
from order_list
group by orderid
order by totalorder desc;
will listed orderid and total duplicate.
select orderid, count(orderid) as totalorder
from order_list
group by orderid
order by totalorder desc;
will listed orderid and total duplicate.
JAVA : I/O Create file
Just a sample code for I/O...
import java.io.File;
import java.io.IOException;
public class CreateFile {
public static void main(String[] args)
{
try{
File file = new File("MyFile.txt"); if (file.createNewFile())
{
System.out.println("Sucess");
}
else
{
System.out.println("Already exist..");
}
}
catch (IOException e)
{
}
}
}
JAVA : OOP - Interface
Below example for Interface programming.
interface calc {
public int calc(int a, int b);
}
public class MyInterface implements calc{
public int calc(int a,int b )
{
return a + b; }
public static void main(String[] args)
{
MyInterface testInterface = new MyInterface();
int total;
total = testInterface.calc(1,7);
System.out.println("Total:" + total);
}
}
Interface only declare the method only. not include with the method body.
Java : OOP - Pass object to Method
Example for Pass object to Method.
Save file as test.java. Compile and run.....
class Kira {
void print(String str) {
System.out.println("In Kira :" + str);
}
}
public class test {
public static void main(String[] args) {
//System.out.println("testing 1 2 3....");
Kira kira = new Kira();
kira.print("Testing Kira");
}
}
Save file as test.java. Compile and run.....
Subscribe to:
Posts (Atom)