JAVA8 Samples

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

JAVA8 Samples

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

JAVA8-Sample-1

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

Sample-1

==========

<SCROLL>

public class <ProgramName> {

static void main(String args[])

{

<! Scroll Logic !>

}

}

</SCROLL>

Program-1

==========

<SCROLL>

public class index {

static void main(String args[])

{

HTML.displayhtml("Register.html");

}

}

</SCROLL>

Output in Samsung mobiles is

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

SAMPLE-2 : Invoice Bill using Wnosql Securable Db

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

2) Write a OAKJAVA8(JAVA8) program for Publishing Invoice Bill in Mobiles..:-

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

<WEB>

<USE> <CDOLLARS>.util; // load cdollar packages

<USE> Security; // load security packages

<USE> CDollar.WDBA; //load cdollar.wdba wnosql packages

<USE> WDBA; // load wnosql packages

<PACK> Program8

{

<CLASS> Prog

{

public void main()

{

ArrayList arm1= new ArrayList();

// add the parameters in ArrayList

arm1.add("CADDRESS");

arm1.add("invoiceno");

arm1.add("invoicedate");

arm1.add("reversecharge");

arm1.add("state");

arm1.add("code");

arm1.add("name");

arm1.add("BADDRESS");

arm1.add("gstin");

arm1.add("state1");

arm1.add("code1");

arm1.add("sno");

arm1.add("productdescription");

arm1.add("hsncode");

arm1.add("qty");

arm1.add("rate");

//arm1.add("amt");

arm1.add("discount");

arm1.add("rate1");

//arm1.add("amt1");

arm1.add("rate2");

//arm1.add("amt2");

arm1.add("Amountinwords");

arm1.add("bname");

arm1.add("bankaccount");

arm1.add("bankifsc");

arm1.add("NOT");

<PRINTLN>("<HTML>");

<PRINTLN>("<head> <style>");

<PRINTLN>("table {");

<PRINTLN>(" width:100%;");

<PRINTLN>("}");

<PRINTLN>("table, th, td {");

<PRINTLN>("border: 1px solid black;");

<PRINTLN>(" border-collapse: collapse;");

<PRINTLN>("}");

<PRINTLN>("th, td {");

<PRINTLN>(" padding: 5px;");

<PRINTLN>(" text-align: left;");

<PRINTLN>("}");

<PRINTLN>("table#t01 tr:nth-child(even) {");

<PRINTLN>(" background-color: grey;");

<PRINTLN>("}");

<PRINTLN>("table#t01 tr:nth-child(odd) {");

<PRINTLN>("background-color:yellow;");

<PRINTLN>("}");

<PRINTLN>("table#t01 th {");

<PRINTLN>(" background-color: black;");

<PRINTLN>("color: white;");

<PRINTLN>("}");

<PRINTLN>("</style>");

<PRINTLN>("</head>");

<PRINTLN>("<BODY >");

<PRINTLN>("<form>");

// Get The post response from form Invoicebill

//with 23 fields..

ArrayList armg= Request.Query(arm1,"Invoicebill.cl.dsn",23,1);

// store the values in the variable;

string CADDRESS=armg.get(0).ToString();

string invoiceno=armg.get(1).ToString();

string invoicedate=armg.get(2).ToString();

string reversecharge=armg.get(3).ToString();

string state=armg.get(4).ToString();

string code=armg.get(5).ToString();

string name=armg.get(6).ToString();

string BADDRESS=armg.get(7).ToString();

string gstin=armg.get(8).ToString();

string state1=armg.get(9).ToString();

string code1=armg.get(10).ToString();

string sno=armg.get(11).ToString();

string productdescription=armg.get(12).ToString();

string hsncode=armg.get(13).ToString();

string qty=armg.get(14).ToString();

string rate=armg.get(15).ToString();

//string amt=armg.get(16).ToString();

string discount=armg.get(16).ToString();

string rate1=armg.get(17).ToString();

//string amt1=armg.get(19).ToString();

string rate2=armg.get(18).ToString();

//string amt2=armg.get(21).ToString();

string Amountinwords=armg.get(19).ToString();

string bname=armg.get(20).ToString();

string bankaccount=armg.get(21).ToString();

string bankifsc=armg.get(22).ToString();

<PRINTLN>("<table id=t01 width=1027 height=210 border=1 bgcolor=#fff >");

<PRINTLN>(" <tr> ");

<PRINTLN>(" <td height=135><div align=center><strong><address> ");

<PRINTLN>(""+CADDRESS);

<PRINTLN>("</address></strong></div></p> <p align=right><strong>Triplicate for</strong></p>");

<PRINTLN>(" <p align=right><strong>Supplier</strong></p></td> ");

<PRINTLN>(" </tr> ");

<PRINTLN>("<tr> ");

<PRINTLN>(" <td><div align=center><span <CLASS>=style12>Tax Invoice</span></div></td>");

<PRINTLN>(" </tr> ");

<PRINTLN>("</table> ");

<PRINTLN>("<table id=t01 width=1027 border=1 bgcolor=#fff> ");

<PRINTLN>("<tr> ");

<PRINTLN>(" <td width=506><strong>Invoice No: </strong>"+invoiceno+"</td> ");

<PRINTLN>("<td width=503></td> ");

<PRINTLN>(" </tr> ");

<PRINTLN>(" <tr> ");

<PRINTLN>("<td><strong>Invoice date: </strong>"+invoicedate+"</td> ");

<PRINTLN>("<td>&nbsp;</td> ");

<PRINTLN>("</tr> ");

<PRINTLN>("</table> ");

<PRINTLN>("<table id=t01 width=1027 border=1 bgcolor=#fff> ");

<PRINTLN>("<tr> ");

<PRINTLN>("<td width=436><strong>Reverse Charge(Y/N):</strong>"+reversecharge+"</td> ");

<PRINTLN>(" <td width=63>&nbsp;</td> ");

<PRINTLN>(" <td width=505>&nbsp;</td> ");

<PRINTLN>("</tr> ");

<PRINTLN>("</table> ");

<PRINTLN>("<table id=t01 width=1027 border=1 bgcolor=#fff> ");

<PRINTLN>("<tr> ");

<PRINTLN>("<td width=337><strong>State:</strong>"+ state+"</td> ");

<PRINTLN>("<td width=94><strong>Code </strong></td> ");

<PRINTLN>(" <td width=63>&nbsp;"+code+"</td> ");

<PRINTLN>(" <td width=504>&nbsp;</td> ");

<PRINTLN>(" </tr> ");

<PRINTLN>("</table> ");

<PRINTLN>("<table id=t01 width=1027 border=1 bgcolor=#fff>");

<PRINTLN>("<tr> ");

<PRINTLN>("<td width=506><div align=center <CLASS>=style13>Bill to Party </div></td> ");

<PRINTLN>(" <td width=503><div align=center><span <CLASS>=style13>Ship to party </span></div></td> ");

<PRINTLN>(" </tr> ");

<PRINTLN>("</table> ");

<PRINTLN>("<table id=t01 width=1027 border=1 bgcolor=#fff> ");

<PRINTLN>("<tr> ");

<PRINTLN>("<td width=506><strong>Name:</strong>"+name+"</td> ");

<PRINTLN>(" <td width=505><strong>Name:</strong>"+name+"</td> ");

<PRINTLN>(" </tr> ");

<PRINTLN>("<tr> ");

<PRINTLN>("<td><strong>Address:</strong>"+ BADDRESS+"</td> ");

<PRINTLN>(" <td><strong>Address:</strong>"+ BADDRESS+"</td> ");

<PRINTLN>("</tr> ");

<PRINTLN>(" <tr> ");

<PRINTLN>(" <td><strong>GSTIN:</strong>"+gstin+"</td> ");

<PRINTLN>(" <td><strong>GSTIN:</strong>"+gstin+"</td> ");

<PRINTLN>(" </tr> ");

<PRINTLN>("</table> ");

<PRINTLN>("<table id=t01 width=1027 border=1 bgcolor=#fff> ");

<PRINTLN>("<tr> ");

<PRINTLN>(" <td width=340><strong>State:</strong>"+state1+"</td> ");

<PRINTLN>(" <td width=98><strong>Code:</strong></td> ");

<PRINTLN>(" <td width=54>&nbsp;"+code1+"</td> ");

<PRINTLN>(" <td width=380><strong>State:</strong>"+state1+"</td> ");

<PRINTLN>(" <td width=76><strong>Code:</strong></td> ");

<PRINTLN>(" <td width=39>&nbsp;"+code1+"</td> ");

<PRINTLN>(" </tr> ");

<PRINTLN>("</table> ");

<PRINTLN>("<table id=t01 width=1027 border=1 bgcolor=#fff> ");

<PRINTLN>("<tr> ");

<PRINTLN>(" <td width=24 height=68><span <CLASS>=style8>S.NO</span></td> ");

<PRINTLN>(" <td width=130> <div align=center <CLASS>=style7>Product Description </div></td> ");

<PRINTLN>(" <td width=41><p <CLASS>=style6>HSNCode</p> </td> ");

<PRINTLN>(" <td width=49><div align=center <CLASS>=style6>Qty</div></td> ");

<PRINTLN>("<td width=73><div align=center <CLASS>=style6>Rate</div></td> ");

<PRINTLN>(" <td width=97><div align=center <CLASS>=style6>Amt</div></td> ");

<PRINTLN>(" <td width=54><div align=center><span <CLASS>=style1><strong>Discount</strong></span></div></td> ");

<PRINTLN>(" <td width=75><span <CLASS>=style6>TaxableValue</span></td> ");

<PRINTLN>(" <td width=134><table id=t01 width=210 border=1> ");

<PRINTLN>(" <tr> ");

<PRINTLN>(" <td width=200><div align=center <CLASS>=style4>CGST</div></td> ");

<PRINTLN>(" </tr> ");

<PRINTLN>("<tr> ");

<PRINTLN>("<td><table id=t01 width=200 border=1 bgcolor=#fff> ");

<PRINTLN>(" <tr> ");

<PRINTLN>(" <td><div align=center <CLASS>=style7>Rate</div></td> ");

<PRINTLN>(" <td><span <CLASS>=style7>Amt</span></td> ");

<PRINTLN>(" </tr> ");

<PRINTLN>(" </table></td> ");

<PRINTLN>(" </tr> ");

<PRINTLN>(" </table></td> ");

<PRINTLN>("<td width=160><table id=t01 width=200 border=1> ");

<PRINTLN>(" <tr> ");

<PRINTLN>(" <td><div align=center <CLASS>=style4>SGST</div></td> ");

<PRINTLN>(" </tr> ");

<PRINTLN>(" <tr> ");

<PRINTLN>("<td><table id=t01 width=200 border=1 bgcolor=#fff> ");

<PRINTLN>(" <tr> ");

<PRINTLN>(" <td><div align=center <CLASS>=style6>Rate</div></td> ");

<PRINTLN>(" <td><span <CLASS>=style6>Amt</span></td> ");

<PRINTLN>("</tr> ");

<PRINTLN>(" </table></td> ");

<PRINTLN>("</tr> ");

<PRINTLN>(" </table></td> ");

<PRINTLN>(" <td width=110><div align=center <CLASS>=style4>TOTAL</div></td> ");

<PRINTLN>(" </tr> ");

<PRINTLN>("</table> ");

<PRINTLN>("<table id=t01 width=1027 border=1 bgcolor=#fff> ");

<PRINTLN>("<tr> ");

<PRINTLN>("<td align=right width=24><p>&nbsp;"+sno+"</p> ");

<PRINTLN>("<td align=right width=93>&nbsp;"+productdescription+"</td> ");

<PRINTLN>(" <td align=right width=54 >&nbsp;"+hsncode+"</td> ");

<PRINTLN>(" <td align=right width=38 >&nbsp;"+qty+"</td> ");

<PRINTLN>(" <td align=right width=50 >&nbsp;"+rate+"</td> ");

//double tax2 = 0.0;

//double totalamount = 0.0;

double amount =(Convert.ToDouble(qty)) * (Convert.ToDouble(rate));

double amount1= ((Convert.ToDouble(rate1)/100) * Convert.ToDouble(amount));

double amount2= ((Convert.ToDouble(rate2)/100) * Convert.ToDouble(amount));

<PRINTLN>(" <td align=right width=65 >&nbsp;"+amount+"</td> ");

<PRINTLN>(" <td align=right width=49 >&nbsp;"+discount+"</td> ");

<PRINTLN>(" <td align=right width=74 >&nbsp;"+amount+"</td> ");

<PRINTLN>("<td align=right width=85>&nbsp;"+rate1+"</td> ");

<PRINTLN>("<td align=right width=99>&nbsp;"+amount1+"</td> ");

<PRINTLN>(" <td align=right width=85 >&nbsp;"+rate2+"</td> ");

<PRINTLN>(" <td align=right width=85>&nbsp;"+amount2+"</td> ");

double totalamount= amount+amount1+amount2;

<PRINTLN>(" <td align=right width=85>&nbsp;"+totalamount+"</td> ");

<PRINTLN>(" </tr> ");

<PRINTLN>("</table> ");

<PRINTLN>("<table id=t01 width=1027 height=65 border=1 bgcolor=#fff> ");

<PRINTLN>("<tr> ");

<PRINTLN>("<td width=134><div align=center <CLASS>=style9><strong>TOTAL</strong></div></td> ");

<PRINTLN>(" <td width=47>&nbsp;</td> ");

<PRINTLN>(" <td width=37>"+qty+"</td> ");

<PRINTLN>(" <td width=51>&nbsp;</td> ");

<PRINTLN>(" <td width=74><div align=center>"+amount+"</div></td> ");

<PRINTLN>("<td width=65><div align=right>"+discount+"</div></td> ");

<PRINTLN>(" <td width=43><div align=right>"+amount+"</div></td> ");

<PRINTLN>("<td width=103>&nbsp;</td> ");

<PRINTLN>("<td width=101><div align=right>"+amount1+"</div></td> ");

<PRINTLN>(" <td width=205><div align=right>"+amount2+"</div></td> ");

<PRINTLN>(" <td width=95><div align=right>"+totalamount+"</div></td> ");

<PRINTLN>(" </tr> ");

<PRINTLN>("</table> ");

<PRINTLN>("<table id=t01 width=1027 border=1 bgcolor=#fff> ");

<PRINTLN>("<tr> ");

<PRINTLN>(" <td width=487><div align=center><strong>Total Invoice amount in words </strong></div></td> ");

<PRINTLN>("<td width=88 <CLASS>=style15><span <CLASS>=style21>Total Amount Before Tax: </span></td> ");

<PRINTLN>(" <td <CLASS>=style15>&nbsp;"+amount+"</td> ");

<PRINTLN>("</tr> ");

<PRINTLN>(" <tr> ");

<PRINTLN>("<td><div align=center><input type=text name=words> </div></td> ");

<PRINTLN>("<td><table id=t01 width=544 border=1 bgcolor=#fff> ");

<PRINTLN>("<tr> ");

<PRINTLN>(" <td width=420 <CLASS>=style15><strong>Add: CGST </strong></td> ");

<PRINTLN>(" <td width=88 <CLASS>=style15>&nbsp;"+amount1+"</td> ");

<PRINTLN>(" </tr> ");

<PRINTLN>(" <tr> ");

<PRINTLN>("<td <CLASS>=style15><strong>Add:SGST</strong></td> ");

<PRINTLN>(" <td <CLASS>=style15>&nbsp;"+amount2+"</td> ");

<PRINTLN>(" </tr> ");

<PRINTLN>(" <tr> ");

<PRINTLN>(" <td <CLASS>=style15><strong>Total Tax Amount: </strong></td> ");

<PRINTLN>(" <td <CLASS>=style15>&nbsp;"+(amount1+amount2)+"</td> ");

<PRINTLN>(" </tr> ");

<PRINTLN>(" <tr> ");

<PRINTLN>(" <td <CLASS>=style15><strong>Total Amount After Tax: </strong></td> ");

<PRINTLN>(" <td <CLASS>=style15>&nbsp;"+totalamount+"</td> ");

<PRINTLN>(" </tr> ");

<PRINTLN>(" <tr> ");

<PRINTLN>(" <td width=196><strong>GST on Reverse Charge </strong></td> ");

<PRINTLN>(" <td width=254>&nbsp;"+reversecharge+"</td>");

<PRINTLN>(" </tr> ");

<PRINTLN>(" </table></td> ");

<PRINTLN>(" </tr> ");

<PRINTLN>("</table> ");

<PRINTLN>("<table id=t01 width=1027 border=1 bgcolor=#fff> ");

/*

<PRINTLN>("<tr> ");

<PRINTLN>("<td width=333 height=563 ><label> ");

<PRINTLN>("<div align=center <CLASS>=style9>Bank Details </div> ");

<PRINTLN>(" <table id=t01 width=336 border=1> bgcolor=#f1f1c1");

<PRINTLN>("<tr> ");

<PRINTLN>(" <td><strong>Name:</strong>"+bname+"</td> ");

<PRINTLN>(" </tr> ");

<PRINTLN>("<tr> ");

<PRINTLN>(" <td><strong>Bank A/c: </strong>"+bankaccount+"</td> ");

<PRINTLN>("</tr> ");

<PRINTLN>("<tr> ");

<PRINTLN>(" <td><strong>Bank IFSC: </strong>"+bankifsc+"</td> ");

<PRINTLN>(" </tr> ");

<PRINTLN>(" </table></label></td> ");

<PRINTLN>(" <td id=t01 width=146><p>&nbsp;</p> ");

<PRINTLN>("<p>&nbsp;</p> ");

<PRINTLN>(" <p>&nbsp;</p> ");

<PRINTLN>("<p>&nbsp;</p> ");

<PRINTLN>("<p>&nbsp;</p> ");

<PRINTLN>("<table id=t01 width=200 height=112 border=1 bgcolor=#f1f1c1> ");

<PRINTLN>(" <tr> ");

<PRINTLN>(" <th scope=row>&nbsp;</th> ");

<PRINTLN>(" </tr> ");

<PRINTLN>(" </table> ");

<PRINTLN>(" <p align=center><strong>Common Seal </strong></p></td> ");

<PRINTLN>("<td width=522 ><table width=466 border=1 bgcolor=#f1f1c1 > ");

<PRINTLN>(" <tr> ");

<PRINTLN>(" <td width=196><strong>GST on Reverse Charge </strong></td> ");

<PRINTLN>(" <td width=254>&nbsp;"+reversecharge+"</td>");

<PRINTLN>(" </tr> ");

<PRINTLN>("</table> ");

<PRINTLN>("<table id=t01 width=468 height=179 border=1 bgcolor=#f1f1c1> ");

<PRINTLN>("<tr> ");

<PRINTLN>(" <td><div align=center><em>Certified that the particulars given above are true and correct </em></div></td> ");

<PRINTLN>(" </tr> ");

<PRINTLN>("</table> ");

<PRINTLN>(" <p align=center><strong>For Marujyu Technology India Pvt Ltd </strong></p> ");

<PRINTLN>("<p>&nbsp;</p> ");

<PRINTLN>("<p>&nbsp;</p> ");

<PRINTLN>("<p align=center <CLASS>=style16>Authorised signatory </p> ");

<PRINTLN>(" <table id=t01 width=467 height=182 border=1 bgcolor=#f1f1c1> ");

<PRINTLN>("<tr> ");

<PRINTLN>(" <td ><span <CLASS>=style19></span></td> ");

<PRINTLN>(" </tr> ");

<PRINTLN>("</table> ");

<PRINTLN>("<p>&nbsp;</p> ");

<PRINTLN>(" <p>&nbsp;</p> ");

<PRINTLN>(" <p>&nbsp;</p> ");

<PRINTLN>(" <p>&nbsp;</p></td> ");

<PRINTLN>("</tr> ");

<PRINTLN>("</table> ");

<PRINTLN>("<p>&nbsp;</p> ");

<PRINTLN>("<p>&nbsp;</p> ");

<PRINTLN>("<p>&nbsp;</p> ");

<PRINTLN>("<p>&nbsp;</p> ");

<PRINTLN>("<p>&nbsp;</p> ");

<PRINTLN>("</form></body> ");

<PRINTLN>("</html> ");

*/

<PRINTLN>("<table width=1027 border=1 bgcolor=#fff>");

<PRINTLN>("<tr>");

<PRINTLN>("<td width=294 height=203><table width=296 height=216 border=1 bgcolor=#fff>");

<PRINTLN>("<tr>");

<PRINTLN>(" <td width=238><div align=center><strong>Bank Details </strong></div></td>");

<PRINTLN>(" </tr>");

<PRINTLN>(" <tr>");

<PRINTLN>(" <td><strong>Name:</strong>"+bname+"</td>");

<PRINTLN>("</tr>");

<PRINTLN>("<tr>");

<PRINTLN>("<td><strong>Bank A/C: </strong>"+bankaccount+"</td>");

<PRINTLN>("</tr>");

<PRINTLN>("<tr>");

<PRINTLN>(" <td><strong>Bank IFSC: </strong>"+bankifsc+"</td>");

<PRINTLN>("</tr>");

<PRINTLN>("<tr>");

<PRINTLN>(" <td height=61>&nbsp;</td>");

<PRINTLN>("</tr>");

<PRINTLN>("</table></td>");

<PRINTLN>("<td width=163><table width=200 height=231 border=1 bgcolor=#fff>");

<PRINTLN>("<tr>");

<PRINTLN>(" <td height=121>&nbsp;</td>");

<PRINTLN>("</tr>");

<PRINTLN>("<tr>");

<PRINTLN>("<td height=102><div align=center class=style22>Common Seal </div></td>");

<PRINTLN>(" </tr>");

<PRINTLN>("</table></td>");

<PRINTLN>("<td width=551><table width=514 height=224 border=1 bgcolor=#fff>");

<PRINTLN>("<tr>");

<PRINTLN>(" <td><div align=center><em>Certified that the particulars given above are true and correct </em></div></td>");

<PRINTLN>("</tr>");

<PRINTLN>("<tr>");

<PRINTLN>("<td><div align=center><strong>For Marujyu Technnology India (p) Ltd </strong></div>");

<PRINTLN>("<p>&nbsp;</p>");

<PRINTLN>("<p align=center class=style13>Authorised signatory </p></td>");

<PRINTLN>("</tr>");

<PRINTLN>("</table></td>");

<PRINTLN>("</tr>");

<PRINTLN>("</table>");

<PRINTLN>("<p>&nbsp;</p>");

<PRINTLN>("<p>&nbsp;</p>");

<PRINTLN>("<p>&nbsp;</p>");

<PRINTLN>("<p>&nbsp;</p>");

<PRINTLN>("<p>&nbsp;</p>");

<PRINTLN>("<p>&nbsp;</p>");

<PRINTLN>("</body>");

<PRINTLN>("</html>");

//Database name as datastores , path as

String g = WDBASQL.WDBASQLS("datastores", "USEDATABASE", "dbpwds", "C:\\Programs\\WNOSQL\\WNOSQLProgramfiles\\WNOSQL-cod");

//dbuser as usertable and dbpwds as password table and wilmix78 as userid and password respectively

String t = WDBASQL.WDBASQLS("dbuser", "dbpwds", 1, "wilmix78", "wilmix78", 1, 5, g);

// create table invoicebill as two partitions InvoiceBill,InvoiceBill2 respectively...

String q = "CREATETABLE from Invoicebill 0 to 0 , 1 to 5 ?= 6639 By 6639 f(x) : {CADDRESS,INO,IDATE,Charge,State,code1,Name,Address,GSTIN,State,code2,sno,productdesc,hsncode,qty}: {} :{2,4}";

String q1 ="CREATETABLE from Invoicebill2 0 to 0 , 1 to 5 ?= 6639 By 6639 f(x) : {rate,Amt,discount,Rate1,Amt1,Rate2,Amt2,total,ReverseCharge,Bankname,BankAccount,BankIFSC}: {} :{2,4}";

wdbaconn.WDBAQUERY(q);

wdbaconn.WDBAQUERY(q1);

Char c= ' ';

// calculate the table size for InvoiceBill and InvoiceBill2

ArrayList datas1=WDBASQL.Query("TABLESIZE()","Invoicebill","0",null,27,"","", null,"",0,"","",c,null,t,1,5);

ArrayList datas11=WDBASQL.Query("TABLESIZE()","Invoicebill2","0",null,27,"","", null,"",0,"","",c,null,t,1,5);

String t1="";String t2="";

t1=CADDRESS+","+invoiceno+","+invoicedate+","+reversecharge+","+state+","+code+","+name+","+BADDRESS+","+gstin+","+state1+","+code1+","+sno+","+productdescription+","+hsncode+","+qty;

t2=rate+","+amount+","+discount+","+rate1+","+amount1+","+rate2+","+amount2+","+totalamount+","+reversecharge+","+bname+","+bankaccount+","+bankifsc;

// Insert the values in to Invoicebill and InvoiceBill2 repectively...

String s12 ="INSERTINTO from Invoicebill 0 to "+datas1.size()+" , 1 to 5 ?= A By 1 1 : {0} : {"+t1+"} : {0}";

wdbaconn.WDBAQUERY(s12);

String s121 ="INSERTINTO from Invoicebill2 0 to "+datas11.size()+" , 1 to 5 ?= A By 1 1 : {0} : {"+t2+"} : {0}";

wdbaconn.WDBAQUERY(s121);

}

}

}

Output in Mobiles is

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

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

SAMPLE -3 : EMPDETAILS FORM AND STORE AND LIST

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

SAMPLE-3 : Create the emp1 table with fields as empname,dept,designation using wnosql db

get the details from employee details form and store it in emp1 table and

list the emp1 table details by using Chdollar-jdollar program

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

<SCROLL>

public class index1 {

static void main(String args[])

{

HTML.displayhtml("Register2.html");

}

}

</SCROLL>

Register2.html

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

<html>

<head>

<title>EMPLOYEE DETAILS</title>

</head>

<body class="fancy">

<form action="http://localhost:8090/EmployeeList.exe" method="post" >

<div id="pageContainer">

<div id="pageContent">

<div id="chaptersAccordion">

<h2><a href="#chapter1">Enter your Details</a></h2>

<div>

<p>Enter Your Employee Name: <input type="text" name="ename" size="25" /></p>

<p>Enter Your Department : <input type="text" name="dept" size="15"/></p>

<p>Enter the Designation : <input type="password" name="design" size="15" /></p>

</div>

<h2><a href="#chapter2">REGISTER</a></h2>

<div>

<input type="submit" name="Click">

<input type="reset" name="Clear">

</div>

<div class="container" style="background-color:#f1f1f1">

<a href=http://localhost:8090/EMPLIST.exe> Click here to view EMPLOYEELIST ...

</div>

</form>

</body>

</html>

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

EMPLOYEELIST.web

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

<WEB>

<USE> <CDOLLARS>.util;

<USE> Security;

<USE> CDollar.WDBA; // load Cdollar.wdba packages

<USE> WDBA; //load wdba packages

<PACK> Program8

{

<CLASS> Prog

{

public void main()

{

<PRINTLN>("<HTML>");

<PRINTLN>("<head> <style>");

<PRINTLN>("table {");

<PRINTLN>(" width:100%;");

<PRINTLN>("}");

<PRINTLN>("table, th, td {");

<PRINTLN>("border: 1px solid black;");

<PRINTLN>(" border-collapse: collapse;");

<PRINTLN>("}");

<PRINTLN>("th, td {");

<PRINTLN>(" padding: 5px;");

<PRINTLN>(" text-align: left;");

<PRINTLN>("}");

<PRINTLN>("table#t01 tr:nth-child(even) {");

<PRINTLN>(" background-color: grey;");

<PRINTLN>("}");

<PRINTLN>("table#t01 tr:nth-child(odd) {");

<PRINTLN>("background-color:yellow;");

<PRINTLN>("}");

<PRINTLN>("table#t01 th {");

<PRINTLN>(" background-color: black;");

<PRINTLN>("color: white;");

<PRINTLN>("}");

<PRINTLN>("</style>");

<PRINTLN>("</head>");

<PRINTLN>("<BODY >");

<PRINTLN>("<form>");

<PRINTLN>("<p>&nbsp;</p>");

<PRINTLN>("<p>&nbsp;</p>");

<PRINTLN>("<p>&nbsp;</p>");

<PRINTLN>("<p>&nbsp;</p>");

<PRINTLN>("<p>&nbsp;</p>");

<PRINTLN>("<p>&nbsp;</p>");

<PRINTLN>("</body>");

<PRINTLN>("</html>");

ArrayList arm1 = new ArrayList();

arm1.add("ename");

arm1.add("dept");arm1.add("design");

arm1.add("!");

ArrayList armg= Request.Query(arm1,"index1.dsn",3,1);

String g = WDBASQL.WDBASQLS("datastores", "USEDATABASE", "dbpwds", "C:\\Programs\\WNOSQL\\WNOSQLProgramfiles\\WNOSQL-cod");

String t = WDBASQL.WDBASQLS("dbuser", "dbpwds", 1, "wilmix78", "wilmix78", 1, 5, g);

//String q = "CREATETABLE from EMP1 0 to 0 , 1 to 7 ?= 6639 By 6639 f(x) : {EMPNAME,DEPT,DESIGNATION}: {} :{2,4}";

// wdbaconn.WDBAQUERY(q);

Char c= ' ';

ArrayList datas1=WDBASQL.Query("TABLESIZE()","EMP1","0",null,19,"","", null,"",0,"","",c,null,t,1,7);

String t1="";

t1=armg.get(0).ToString()+","+armg.get(1).ToString()+","+armg.get(2).ToString();

String s12 ="INSERTINTO from EMP1 0 to "+datas1.size()+" , 1 to 7 ?= A By 1 1 : {0} : {"+t1+"} : {0}";

wdbaconn.WDBAQUERY(s12);

}

}

}

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

Chdollar-JDollar Program to List emp Details and compile the emplist.j$ by Jdollarc <filename>.j$

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

emplist.j$

===========

<JDollar> //starting of chdollar-jdollar program

<USE> <WEB>.util;// loading util package

<USE> Security; // loading security package

<USE> CUTIL; //loading CUTIL packages

<PACK> Program5

{

<CLASS> Prog

{

public void Main()

{

wdbaconn.JSTARWDBAQUERY("datastores", "USEDATABASE", "dbpwds", "C:\\Programs\\WNOSQL\\WNOSQLProgramfiles\\WNOSQL-cod");

wdbaconn.JSTARWDBAUSERQUERY("dbuser", "dbpwds", "wilmix78", "wilmix78");

String qh2="SELECTRVAL from EMP1 0 to 6 , 1 to 7 ?= A By 1 1 : {0} : {0} :{0}";

wdbaconn.WDBAQUERY(qh2);

// use ArrayLinearList dts

ArrayLinearList x = new ArrayLinearList();

<TRY>

{

String s=Secure.RetreiveSecure("output.wdba" ,0); //retrieve the query output from wdba file

s=s.Replace("[","").Replace("]","");

string []ename = s.Split(' ');

int lengthA = ename.Length;

<PRINTLN>(" <html>");

<PRINTLN>(" <form>");

<PRINTLN>(" <Table bgcolor=gold>");

<PRINTLN> ("EMployeeList...");

<PRINTLN> ("<BR>********************");

int c=0;

for (int i=0;i<lengthA;i+=1)

{

// add the parameter values from wnosql db -emp

x.add(c,ename[i].Replace(",","").Replace("%2F","/").Replace("%40","@").Replace("+"," "));

c++;

}

<PRINTLN>(" </table>");

<PRINTLN>(" </form>");

<PRINTLN>(" </html>");

// output using an iterator

Iterator y = x.iterator();

while (y.hasNext())

<PRINTLN>(y.next() + " ");

Environment.Exit(-1);

}

<CATCH>(<EXE> e)

{

}


}

}

}

OUTPUT

=========

EMPFORM
EMPLIST
EMPLIST

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

create a oakjava7 to delete an employee name is wilfred...

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

empdelete.web

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

<WEB>

<USE> <CDOLLARS>.util;

<USE> Security;

<USE> CDollar.WDBA; // load Cdollar.wdba packages

<USE> WDBA; //load wdba packages

<PACK> Program8

{

<CLASS> Prog

{

public void main()

{

<PRINTLN>("<HTML>");

<PRINTLN>("<head> <style>");

<PRINTLN>("table {");

<PRINTLN>(" width:100%;");

<PRINTLN>("}");

<PRINTLN>("table, th, td {");

<PRINTLN>("border: 1px solid black;");

<PRINTLN>(" border-collapse: collapse;");

<PRINTLN>("}");

<PRINTLN>("th, td {");

<PRINTLN>(" padding: 5px;");

<PRINTLN>(" text-align: left;");

<PRINTLN>("}");

<PRINTLN>("table#t01 tr:nth-child(even) {");

<PRINTLN>(" background-color: grey;");

<PRINTLN>("}");

<PRINTLN>("table#t01 tr:nth-child(odd) {");

<PRINTLN>("background-color:yellow;");

<PRINTLN>("}");

<PRINTLN>("table#t01 th {");

<PRINTLN>(" background-color: black;");

<PRINTLN>("color: white;");

<PRINTLN>("}");

<PRINTLN>("</style>");

<PRINTLN>("</head>");

<PRINTLN>("<BODY >");

<PRINTLN>("<form>");

<PRINTLN>("<p>&nbsp;</p>");

<PRINTLN>("<p>&nbsp;</p>");

<PRINTLN>("<p>&nbsp;</p>");

<PRINTLN>("<p>&nbsp;</p>");

<PRINTLN>("<p>&nbsp;</p>");

<PRINTLN>("<p>&nbsp;</p>");

<PRINTLN>("</body>");

<PRINTLN>("</html>");

String g = WDBASQL.WDBASQLS("datastores", "USEDATABASE", "dbpwds", "C:\\Programs\\WNOSQL\\WNOSQLProgramfiles\\WNOSQL-cod");

String t = WDBASQL.WDBASQLS("dbuser", "dbpwds", 1, "wilmix78", "wilmix78", 1, 5, g);

Char c= ' ';

ArrayList datas1=WDBASQL.Query("TABLESIZE()","EMP1","0",null,19,"","", null,"",0,"","",c,null,t,1,7);

String s12 ="DELETE from EMP1 0 to "+datas1.size()+" , 1 to 7 ?= A By 1 1 : {wilfred} : {0} : {0}";

wdbaconn.WDBAQUERY(s12);

}

}

}

Create an OAKJAVA7 and scroll program to update an employee

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

Register3.html

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

<html>

<head>

<title>EMPLOYEE DETAILS</title>

</head>

<body class="fancy">

<form action="http://localhost:8090/update.exe" method="post" >

<div id="pageContainer">

<div id="pageContent">

<div id="chaptersAccordion">

<h2><a href="#chapter1">Enter your Details</a></h2>

<div>

<p>Enter Your Employee Name: <input type="text" name="ename" size="25"/></p>

<p>Enter Your Employee Name1: <input type="text" name="ename1" size="25"/></p>

</div>

<h2><a href="#chapter2">REGISTER</a></h2>

<div>

<input type="submit" name="Click">

<input type="reset" name="Clear">

</div>

<div class="container" style="background-color:#f1f1f1">

<a href=http://localhost:8090/EMPLIST.exe> Click here to view EMPLOYEELIST ...

</div>

</form>

</body>

</html>

<SCROLL>

public class index2 {

static void main(String args[])

{

HTML.displayhtml("Register3.html");

}

}

</SCROLL>

update.web

==========

<WEB>

<USE> <CDOLLARS>.util;

<USE> Security;

<USE> CDollar.WDBA; // load Cdollar.wdba packages

<USE> WDBA; //load wdba packages

<PACK> Program8

{

<CLASS> Prog

{

public void main()

{

<PRINTLN>("<HTML>");

<PRINTLN>("<head> <style>");

<PRINTLN>("table {");

<PRINTLN>(" width:100%;");

<PRINTLN>("}");

<PRINTLN>("table, th, td {");

<PRINTLN>("border: 1px solid black;");

<PRINTLN>(" border-collapse: collapse;");

<PRINTLN>("}");

<PRINTLN>("th, td {");

<PRINTLN>(" padding: 5px;");

<PRINTLN>(" text-align: left;");

<PRINTLN>("}");

<PRINTLN>("table#t01 tr:nth-child(even) {");

<PRINTLN>(" background-color: grey;");

<PRINTLN>("}");

<PRINTLN>("table#t01 tr:nth-child(odd) {");

<PRINTLN>("background-color:yellow;");

<PRINTLN>("}");

<PRINTLN>("table#t01 th {");

<PRINTLN>(" background-color: black;");

<PRINTLN>("color: white;");

<PRINTLN>("}");

<PRINTLN>("</style>");

<PRINTLN>("</head>");

<PRINTLN>("<BODY >");

<PRINTLN>("<form>");

<PRINTLN>("<p>&nbsp;</p>");

<PRINTLN>("<p>&nbsp;</p>");

<PRINTLN>("<p>&nbsp;</p>");

<PRINTLN>("<p>&nbsp;</p>");

<PRINTLN>("<p>&nbsp;</p>");

<PRINTLN>("<p>&nbsp;</p>");

<PRINTLN>("</body>");

<PRINTLN>("</html>");

ArrayList arm1 = new ArrayList();

arm1.add("ename");

arm1.add("ename1");

arm1.add("!");

ArrayList armg= Request.Query(arm1,"index2.dsn",2,1);

String g = WDBASQL.WDBASQLS("datastores", "USEDATABASE", "dbpwds", "C:\\Programs\\WNOSQL\\WNOSQLProgramfiles\\WNOSQL-cod");

String t = WDBASQL.WDBASQLS("dbuser", "dbpwds", 1, "wilmix78", "wilmix78", 1, 5, g);

Char c= ' ';

ArrayList datas1=WDBASQL.Query("TABLESIZE()","EMP1","0",null,19,"","", null,"",0,"","",c,null,t,1,7);

String t1="";

t1=armg.get(0).ToString();

String t2="";

t2=armg.get(1).ToString();

String s171 ="UPDATE from EMP1 0 to 0 , 1 to 7 ?= C By 1 1 : {"+t1+"} :{"+t2+"}:{0}";

wdbaconn.WDBAQUERY(s171);

}

}

}

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

SAMPLE-4 : Insert the value into employee table using Oracle and scroll program only.

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

index5.scroll

===========

<SCROLL>

public class index5 {

static void main(String args[])

{

HTML.displayhtml("Register31.html");

}

}

</SCROLL>

index51.scroll

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

<SCROLL>

import java.util.*;

import java.sql.*;

import jxl.Cell;

import jxl.Sheet;

import jxl.Workbook;

import jxl.read.biff.BiffException;

import jxl.write.Number;

import jxl.write.WritableSheet;

import jxl.write.WritableWorkbook;

import jxl.write.WriteException;

public class index51

{

static void main(String args[] ) throws BiffException ,Exception

{

ArrayList<String> arm1= new ArrayList<String>();

arm1.add("sno");

arm1.add("ename");

arm1.add("designation");

arm1.add("!");

ArrayList<String> armg=SPLITREQUEST.RESULT(arm1,"index5.dsn",3,1);

String insertTableSQL = "INSERT INTO employee"

+ "(sno,ename, designation) VALUES"

+ "(?,?,?)";

PreparedStatement preparedStatement = null;

try

{

//step1 load the driver class

Class.forName("oracle.jdbc.driver.OracleDriver");

//step2 create the connection object

Connection con=DriverManager.getConnection(

"jdbc:oracle:thin:@localhost:1521:xe","hr","Dove1234");

preparedStatement =con.prepareStatement(insertTableSQL);

preparedStatement.setString(1,armg.get(0).toString());

preparedStatement.setString(2,armg.get(1).toString());

preparedStatement.setString(3,armg.get(2).toString());

preparedStatement.executeUpdate();

//step5 close the connection object

con.close(); System.out.println(" Record inserted Successfully");

System.out

}

catch(Exception e){System.out.println(e);}

}

}

</SCROLL>

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

SAMPLE5:Write a Scroll OAKJAVA7 PROGRAM FOR NEXT ASCENDING ORDER SEQUENCES?

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

Write a Scroll OAKJAVA7 PROGRAM FOR NEXT ASCENDING ORDER SEQUENCES?

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

NEXT10ROWS.scroll

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

<SCROLL>

import java.util.*;

import java.sql.*;

import jxl.Cell;

import jxl.Sheet;

import jxl.Workbook;

import jxl.read.biff.BiffException;

import jxl.write.Number;

import jxl.write.WritableSheet;

import jxl.write.WritableWorkbook;

import jxl.write.WriteException;

public class NEXT10ROWS

{

static ArrayList<String> armg=null;

static int rowsperPage=1;

static int rowcount=100;

static void main(String args[] ) throws BiffException ,Exception

{

int totalRows=0;

// This will be true if there is still more data in the

// table

boolean more = false;

int r=0;

int c=0;

//if (rowcount NOT=1)

{

ArrayList<String> arm1= new ArrayList <String>();

arm1.add("id");

arm1.add("page");

arm1.add("!");

System.out.println("<form method=post action = http://localhost:8090/NEXT10ROWS.scroll >");

armg=SPLITREQUEST.RESULT(arm1,"NEXT10ROWS.dsn",2,1);

c=Integer.parseInt(armg.get(1).toString());

r=Integer.parseInt(armg.get(0).toString());

rowcount=c;

rowsperPage=r;

//System.out.println("r="+r);

//System.out.println("c="+c);

}


PreparedStatement preparedStatement = null;

//PreparedStatement preparedStatement1 = null;

String sql="select count(*) from Employees";

try

{

//step1 load the driver class

Class.forName("oracle.jdbc.driver.OracleDriver");

//step2 create the connection object

Connection con=DriverManager.getConnection(

"jdbc:oracle:thin:@localhost:1521:xe","hr","Dove1234");

//preparedStatement1 =con.prepareStatement(sql);

//ResultSet rs2 = preparedStatement1.executeQuery();

// get the number of rows from the result set

// rs2.next();

// int rowCount = rs2.getInt(1);

// System.out.println(rowCount);

// rs2.close();

//preparedStatement1.close();

//totalRows=rowCount;

//if ((rowcount ==1) AND (rowsperPage ==1))

{

preparedStatement =con.prepareStatement("select First_name from employees where Employee_ID between "+rowsperPage+" and "+rowcount+" ORDER BY First_Name ASC");

}

ResultSet rs = preparedStatement.executeQuery();

// Create the table

// Process the results. First dump out the column

// headers as found in the ResultSetMetaData

ResultSetMetaData rsmd = rs.getMetaData();

int columnCount = rsmd.getColumnCount();

// Start the table row

// Now walk through the entire ResultSet and get each

// row

int i=0;int rows1=0;

String insertTableSQL ="";

System.out.println("<TABLE bgcolor=yellow>");

System.out.println("<TH>FOUNDDATA</TH>");

while (rs.next()) {

rowcount++;

rows1++;

String id = rs.getString(1);



System.out.println("<Tr>");

System.out.println("<TD>"+id+"<td>");

System.out.println("</Tr>");

}

System.out.println("</table>");

System.out.println("<form method=post action = http://localhost:8090/NEXT10ROWS.scroll >");

System.out.println("<input type=hidden name=id value="+rowsperPage+" />");

System.out.println("<input type=hidden name=page value="+rowcount+" />");

System.out.println("<input type=submit name=submit value=NextAscendingOrderSequences />");


con.close();

}

catch(Exception e){ System.out.println(e);}

}

}

</SCROLL>

OUTPUT:

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

SAMPLE -6: LOGIN

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

Write a Scroll program using OAKJAVA7 with SecureDB wnosql and create a Login page with username and password

and check if the username and password correct or not if

correct print login succesfully and apply design11 of Web1.0 :-

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

Register4.html

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

<html>

<head>

<title>EMPLOYEE DETAILS</title>

<link rel="stylesheet" href="http://localhost:8081/design11.WS"> //web1.0 design 11 applied

</head>

<body class="fancy">

<form action="http://localhost:8090/authenticate.exe" method="post" >

<div class="box sidebar">

<div id="wrapper">

<div id="box">

<div class="container">

<div class="modal-body">

<h2><a href="#chapter1">Enter your Details</a></h2>

<div class="box content">

<p>Enter Your Employee Name: <input type="text" name="uname" size="25" /></p>

<p>Enter Your Password: <input type="text" name="pwd" size="25"/></p>

<h2><a href="#chapter2">REGISTER</a></h2>

<div>

<input type="submit" name="Click">

<input type="reset" name="Clear">

</div>

</div>

<div class="container" style="background-color:#f1f1f1">

<a href=http://localhost:8090/EMPLIST.exe> Click here to view EMPLOYEELIST ...

</div>

</div>

</div>

</div>

</div>

</div>

</form>

</body>

</html>

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

index4.scroll

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

<SCROLL>

public class index4 {

static void main(String args[])

{

HTML.displayhtml("Register4.html");

}

}

</SCROLL>

authenticate.web

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

<WEB>

<USE> <CDOLLARS>.util;

<USE> Security;

<USE> CDollar.WDBA; // load Cdollar.wdba packages

<USE> WDBA; //load wdba packages

<PACK> Program8

{

<CLASS> Prog

{

public void main()

{

<PRINTLN>("<HTML>");

<PRINTLN>("<head> <style>");

<PRINTLN>("table {");

<PRINTLN>(" width:100%;");

<PRINTLN>("}");

<PRINTLN>("table, th, td {");

<PRINTLN>("border: 1px solid black;");

<PRINTLN>(" border-collapse: collapse;");

<PRINTLN>("}");

<PRINTLN>("th, td {");

<PRINTLN>(" padding: 5px;");

<PRINTLN>(" text-align: left;");

<PRINTLN>("}");

<PRINTLN>("table#t01 tr:nth-child(even) {");

<PRINTLN>(" background-color: grey;");

<PRINTLN>("}");

<PRINTLN>("table#t01 tr:nth-child(odd) {");

<PRINTLN>("background-color:yellow;");

<PRINTLN>("}");

<PRINTLN>("table#t01 th {");

<PRINTLN>(" background-color: black;");

<PRINTLN>("color: white;");

<PRINTLN>("}");

<PRINTLN>("</style>");

<PRINTLN>("</head>");

<PRINTLN>("<BODY >");

<PRINTLN>("<form>");

<PRINTLN>("<p>&nbsp;</p>");

<PRINTLN>("<p>&nbsp;</p>");

<PRINTLN>("<p>&nbsp;</p>");

<PRINTLN>("<p>&nbsp;</p>");

<PRINTLN>("<p>&nbsp;</p>");

<PRINTLN>("<p>&nbsp;</p>");

<PRINTLN>("</body>");

<PRINTLN>("</html>");

ArrayList arm1 = new ArrayList();

arm1.add("uname");

arm1.add("pwd");

arm1.add("!");

ArrayList armg= Request.Query(arm1,"index4.dsn",2,1);

String g = WDBASQL.WDBASQLS("datastores", "USEDATABASE", "dbpwds", "C:\\Programs\\WNOSQL\\WNOSQLProgramfiles\\WNOSQL-cod");

String t = WDBASQL.WDBASQLS("dbuser", "dbpwds", 1, "wilmix78", "wilmix78", 1, 5, g);

String t1="";

t1=armg.get(0).ToString();

String t2="";

t2=armg.get(1).ToString();

<TRY>

{

String qh2="SelectIN from EMP1 0 to 6 , 1 to 7 ?= "+t1+" By 1 1 : {0} : {0} :{0}";

wdbaconn.WDBAQUERY(qh2);

ArrayList ar=WDBALIB.WDBAQUERY(qh2, t);

<PRINTLN>("jm="+ar);

String qh21="SelectIN from EMP1 0 to 6 , 1 to 7 ?= "+t2+" By 1 1 : {0} : {0} :{0}";

wdbaconn.WDBAQUERY(qh2);

ArrayList ar1=WDBALIB.WDBAQUERY(qh21, t);

<PRINTLN>("jm="+ar1);

if ((ar.get(0).ToString()==t1) && (ar1.get(0).ToString()==t2))

<PRINTLN>("user login succesfully");

else

<PRINTLN>("user not login succesfully");

<PRINTLN>(" </table>");

<PRINTLN>("<input type=submit name=Click>");

<PRINTLN>(" </form>");

<PRINTLN>(" </html>");

}

<CATCH>(<EXE> e)

{

<PRINTLN>("user not login succesfully");

}

}

}

}

Output in IPAD device

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

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

FAQS?

======

What are the compiler used in JAVA8.0? Why it is

called JAVA8.0 (OAKJAVA8.0) ?

Here OAKJAVA7(JAVA7.0) ,Chdollar ,chdollar-Jdollar compiler

and Chdollar Java runtime is used..

but JAVA-JDK compiler is not focused and is not used.

such compilers[OAKJAVA7(JAVA7.0) ,Chdollar ,chdollar-Jdollar ] ,ScrollServer focused for mobiles such

arrangement is called OakJAVA8(JAVA8.0).