Here you can find the source of longToDB(long val)
public static String longToDB(long val)
//package com.java2s; // it under the terms of the GNU General Public License as published by public class Main { public static String longToDB(long val) { String s = Long.toString(val); // prefix with 2 digits that represents // the length of the value int l = s.length(); String dbVal = ""; if (s.length() < 10) { dbVal = "0"; }/* ww w . j a v a2s. c o m*/ return dbVal + Integer.toString(l) + s; } }