SlideShare a Scribd company logo
1 of 42
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import javax.microedition.lcdui.Alert;
import javax.microedition.lcdui.AlertType;
import javax.microedition.lcdui.Command;
import
javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Form;
import javax.microedition.midlet.MIDlet;
import javax.microedition.rms.RecordStore;

public class WREx2 extends MIDlet implements
CommandListener
{
private Display d;
private Alert a;
private Form f;
private Command exit;
private Command start;
private RecordStore rec = null;
public WREx2 ()
{
d = Display.getDisplay(this);
exit = new
Command("Exit", Command.EXIT, 1);
//exit = new
Command("Exit", Command.SCREEN, 1);
start = new
Command("Start", Command.SCREEN, 1);
f = new Form("Mixed Record");
f.addCommand(start);
f.addCommand(exit);
f.setCommandListener(this);
}
public void startApp()
{
d.setCurrent(f);
}
public void pauseApp()
{
}
public void destroyApp( boolean b )
{
}
public void commandAction(Command
c, Displayable dd)
{
if (c == exit)
{
destroyApp(true);
notifyDestroyed();
}
else if (c == start)
{
try
{
rec =
RecordStore.openRecordStore("myRecordStore
", true );
}
catch (Exception e)
{
/*a = new Alert("Error Creating",
e.toString(), null, AlertType.WARNING);
a.setTimeout(Alert.FOREVER);
d.setCurrent(a);*/
}
//String oS = "First Record";
String oS = "Rama Rao";
int oI = 15;
boolean oB = true;
//ByteArrayOutputStream outputStream = new
ByteArrayOutputStream();
ByteArrayOutputStream baos = new
ByteArrayOutputStream();
DataOutputStream ods =
new DataOutputStream(baos);
ods.writeUTF(oS);
ods.writeBoolean(oB);
ods.writeInt(oI);
ods.flush();
by = baos.toByteArray();//copies from baos[]
array into by array,it creates a newly byte[]
array, and returns byte[] reference
rec.addRecord(by, 0, by.length);
baos.reset();
baos.close();
ods.close();
}
catch ( Exception error)
{
/*a = new Alert("Error Writing",
try
{
String s = null;
int i = 0;
boolean b = false;
byte[] by = new byte[100];
ByteArrayInputStream ist = new
ByteArrayInputStream(by);
//DataInputStream inputDataStream =
DataInputStream ids =
new DataInputStream(ist);
for (int x = 1; x <= rec.getNumRecords(); x++)
{
rec.getRecord(x, by, 0);
s = ids.readUTF();
b = ids.readBoolean();
i = ids.readInt ();
ist.reset();
}
ist.close();
ids.close();
a = new Alert("Reading", s + " " +i + " " + b,
null, AlertType.WARNING);
a.setTimeout(Alert.FOREVER); //alert msg is
not dissappear immediately
d.setCurrent(a);
}
catch (Exception error)
{
/*a = new Alert("Error Reading",
error.toString(), null, AlertType.WARNING);
a.setTimeout(Alert.FOREVER);
d.setCurrent(a);*/
}
try
{
rec.closeRecordStore();
}
catch (Exception error)
{
/*a = new Alert("Error Closing",
error.toString(), null, AlertType.WARNING);
a.setTimeout(Alert.FOREVER);
d.setCurrent(a);*/
if (RecordStore.listRecordStores() != null)
{
try
{
RecordStore.deleteRecordStore("myRecordStor
e");
}
catch (Exception error)
{
/*a = new Alert("Error Removing",
error.toString(), null, AlertType.WARNING);
a.setTimeout(Alert.FOREVER);
d.setCurrent(a);*/
}
}
}
}
}
Wr ex2

More Related Content

Viewers also liked

Viewers also liked (18)

Exceptions
ExceptionsExceptions
Exceptions
 
Class
ClassClass
Class
 
Class
ClassClass
Class
 
1 introduction to html
1 introduction to html1 introduction to html
1 introduction to html
 
Sessionex1
Sessionex1Sessionex1
Sessionex1
 
Headings
HeadingsHeadings
Headings
 
Interface connection
Interface connectionInterface connection
Interface connection
 
Record store
Record storeRecord store
Record store
 
Driver
DriverDriver
Driver
 
4 jdbc step1
4 jdbc step14 jdbc step1
4 jdbc step1
 
Interface database metadata
Interface database metadataInterface database metadata
Interface database metadata
 
Properties
PropertiesProperties
Properties
 
Interface result set
Interface result setInterface result set
Interface result set
 
Views
ViewsViews
Views
 
Views
ViewsViews
Views
 
Views
ViewsViews
Views
 
Interface callable statement
Interface callable statementInterface callable statement
Interface callable statement
 
Starting jdbc
Starting jdbcStarting jdbc
Starting jdbc
 

Similar to Wr ex2

Praktikum sistem tertanam 2
Praktikum sistem tertanam   2Praktikum sistem tertanam   2
Praktikum sistem tertanam 2sulaiman yunus
 
Contoh bahan latihan programan mobile java
Contoh bahan latihan programan mobile javaContoh bahan latihan programan mobile java
Contoh bahan latihan programan mobile javaJurnal IT
 
04 J2ME Wireless Tool Kit
04 J2ME Wireless Tool Kit04 J2ME Wireless Tool Kit
04 J2ME Wireless Tool Kitcorneliuskoo
 
CDI e as ideias pro futuro do VRaptor
CDI e as ideias pro futuro do VRaptorCDI e as ideias pro futuro do VRaptor
CDI e as ideias pro futuro do VRaptorCaelum
 
Programming Language- C++ or Java Write to program to generate a pair.docx
Programming Language- C++ or Java Write to program to generate a pair.docxProgramming Language- C++ or Java Write to program to generate a pair.docx
Programming Language- C++ or Java Write to program to generate a pair.docxtodd921
 
ViewerFrame.java import javax.swing.JFrame;public class Viewer.pdf
ViewerFrame.java import javax.swing.JFrame;public class Viewer.pdfViewerFrame.java import javax.swing.JFrame;public class Viewer.pdf
ViewerFrame.java import javax.swing.JFrame;public class Viewer.pdfannaindustries
 
J2ME Lwuit, Storage & Connections (Ft Prasanjit Dey)
J2ME Lwuit, Storage & Connections (Ft   Prasanjit Dey)J2ME Lwuit, Storage & Connections (Ft   Prasanjit Dey)
J2ME Lwuit, Storage & Connections (Ft Prasanjit Dey)Fafadia Tech
 
Visage Android Hands-on Lab
Visage Android Hands-on LabVisage Android Hands-on Lab
Visage Android Hands-on LabStephen Chin
 
Hacking the Codename One Source Code - Part IV.pdf
Hacking the Codename One Source Code - Part IV.pdfHacking the Codename One Source Code - Part IV.pdf
Hacking the Codename One Source Code - Part IV.pdfShaiAlmog1
 
assigemt calculater.docx
assigemt calculater.docxassigemt calculater.docx
assigemt calculater.docxzekfeker
 
Daggerate your code - Write your own annotation processor
Daggerate your code - Write your own annotation processorDaggerate your code - Write your own annotation processor
Daggerate your code - Write your own annotation processorBartosz Kosarzycki
 
Code to DI For - Dependency Injection for Modern Applications
Code to DI For - Dependency Injection for Modern ApplicationsCode to DI For - Dependency Injection for Modern Applications
Code to DI For - Dependency Injection for Modern ApplicationsCaleb Jenkins
 
Thomas braun dependency-injection_with_robo_guice-presentation-final
Thomas braun dependency-injection_with_robo_guice-presentation-finalThomas braun dependency-injection_with_robo_guice-presentation-final
Thomas braun dependency-injection_with_robo_guice-presentation-finalDroidcon Berlin
 

Similar to Wr ex2 (20)

Praktikum sistem tertanam 2
Praktikum sistem tertanam   2Praktikum sistem tertanam   2
Praktikum sistem tertanam 2
 
Contoh bahan latihan programan mobile java
Contoh bahan latihan programan mobile javaContoh bahan latihan programan mobile java
Contoh bahan latihan programan mobile java
 
04 J2ME Wireless Tool Kit
04 J2ME Wireless Tool Kit04 J2ME Wireless Tool Kit
04 J2ME Wireless Tool Kit
 
CDI e as ideias pro futuro do VRaptor
CDI e as ideias pro futuro do VRaptorCDI e as ideias pro futuro do VRaptor
CDI e as ideias pro futuro do VRaptor
 
package org dev
package org devpackage org dev
package org dev
 
Package org dev
Package org devPackage org dev
Package org dev
 
Programming Language- C++ or Java Write to program to generate a pair.docx
Programming Language- C++ or Java Write to program to generate a pair.docxProgramming Language- C++ or Java Write to program to generate a pair.docx
Programming Language- C++ or Java Write to program to generate a pair.docx
 
ViewerFrame.java import javax.swing.JFrame;public class Viewer.pdf
ViewerFrame.java import javax.swing.JFrame;public class Viewer.pdfViewerFrame.java import javax.swing.JFrame;public class Viewer.pdf
ViewerFrame.java import javax.swing.JFrame;public class Viewer.pdf
 
Scrollable Demo App
Scrollable Demo AppScrollable Demo App
Scrollable Demo App
 
J2ME Lwuit, Storage & Connections (Ft Prasanjit Dey)
J2ME Lwuit, Storage & Connections (Ft   Prasanjit Dey)J2ME Lwuit, Storage & Connections (Ft   Prasanjit Dey)
J2ME Lwuit, Storage & Connections (Ft Prasanjit Dey)
 
Visage Android Hands-on Lab
Visage Android Hands-on LabVisage Android Hands-on Lab
Visage Android Hands-on Lab
 
DBTool
DBToolDBTool
DBTool
 
Rcp by example
Rcp by exampleRcp by example
Rcp by example
 
Hacking the Codename One Source Code - Part IV.pdf
Hacking the Codename One Source Code - Part IV.pdfHacking the Codename One Source Code - Part IV.pdf
Hacking the Codename One Source Code - Part IV.pdf
 
assigemt calculater.docx
assigemt calculater.docxassigemt calculater.docx
assigemt calculater.docx
 
#JavaFX.forReal() - ElsassJUG
#JavaFX.forReal() - ElsassJUG#JavaFX.forReal() - ElsassJUG
#JavaFX.forReal() - ElsassJUG
 
Daggerate your code - Write your own annotation processor
Daggerate your code - Write your own annotation processorDaggerate your code - Write your own annotation processor
Daggerate your code - Write your own annotation processor
 
Code to DI For - Dependency Injection for Modern Applications
Code to DI For - Dependency Injection for Modern ApplicationsCode to DI For - Dependency Injection for Modern Applications
Code to DI For - Dependency Injection for Modern Applications
 
Popup view on Mortar
Popup view on MortarPopup view on Mortar
Popup view on Mortar
 
Thomas braun dependency-injection_with_robo_guice-presentation-final
Thomas braun dependency-injection_with_robo_guice-presentation-finalThomas braun dependency-injection_with_robo_guice-presentation-final
Thomas braun dependency-injection_with_robo_guice-presentation-final
 

More from myrajendra

More from myrajendra (11)

Fundamentals
FundamentalsFundamentals
Fundamentals
 
Data type
Data typeData type
Data type
 
Hibernate example1
Hibernate example1Hibernate example1
Hibernate example1
 
Jdbc workflow
Jdbc workflowJdbc workflow
Jdbc workflow
 
2 jdbc drivers
2 jdbc drivers2 jdbc drivers
2 jdbc drivers
 
3 jdbc api
3 jdbc api3 jdbc api
3 jdbc api
 
Dao example
Dao exampleDao example
Dao example
 
2. attributes
2. attributes2. attributes
2. attributes
 
Css
CssCss
Css
 
Java.sql package
Java.sql packageJava.sql package
Java.sql package
 
Indexing
IndexingIndexing
Indexing
 

Recently uploaded

Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 

Recently uploaded (20)

DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 

Wr ex2

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32. import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.DataInputStream; import java.io.DataOutputStream; import javax.microedition.lcdui.Alert; import javax.microedition.lcdui.AlertType; import javax.microedition.lcdui.Command; import javax.microedition.lcdui.CommandListener; import javax.microedition.lcdui.Display; import javax.microedition.lcdui.Displayable; import javax.microedition.lcdui.Form; import javax.microedition.midlet.MIDlet; import javax.microedition.rms.RecordStore; public class WREx2 extends MIDlet implements CommandListener { private Display d; private Alert a; private Form f; private Command exit; private Command start; private RecordStore rec = null;
  • 33.
  • 34. public WREx2 () { d = Display.getDisplay(this); exit = new Command("Exit", Command.EXIT, 1); //exit = new Command("Exit", Command.SCREEN, 1); start = new Command("Start", Command.SCREEN, 1); f = new Form("Mixed Record"); f.addCommand(start); f.addCommand(exit); f.setCommandListener(this); }
  • 35. public void startApp() { d.setCurrent(f); } public void pauseApp() { } public void destroyApp( boolean b ) { } public void commandAction(Command c, Displayable dd) { if (c == exit) { destroyApp(true); notifyDestroyed(); }
  • 36. else if (c == start) { try { rec = RecordStore.openRecordStore("myRecordStore ", true ); } catch (Exception e) { /*a = new Alert("Error Creating", e.toString(), null, AlertType.WARNING); a.setTimeout(Alert.FOREVER); d.setCurrent(a);*/ }
  • 37. //String oS = "First Record"; String oS = "Rama Rao"; int oI = 15; boolean oB = true; //ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); DataOutputStream ods = new DataOutputStream(baos); ods.writeUTF(oS); ods.writeBoolean(oB); ods.writeInt(oI); ods.flush(); by = baos.toByteArray();//copies from baos[] array into by array,it creates a newly byte[] array, and returns byte[] reference rec.addRecord(by, 0, by.length); baos.reset(); baos.close(); ods.close(); } catch ( Exception error) { /*a = new Alert("Error Writing",
  • 38. try { String s = null; int i = 0; boolean b = false; byte[] by = new byte[100]; ByteArrayInputStream ist = new ByteArrayInputStream(by); //DataInputStream inputDataStream = DataInputStream ids = new DataInputStream(ist);
  • 39. for (int x = 1; x <= rec.getNumRecords(); x++) { rec.getRecord(x, by, 0); s = ids.readUTF(); b = ids.readBoolean(); i = ids.readInt (); ist.reset(); }
  • 40. ist.close(); ids.close(); a = new Alert("Reading", s + " " +i + " " + b, null, AlertType.WARNING); a.setTimeout(Alert.FOREVER); //alert msg is not dissappear immediately d.setCurrent(a); } catch (Exception error) { /*a = new Alert("Error Reading", error.toString(), null, AlertType.WARNING); a.setTimeout(Alert.FOREVER); d.setCurrent(a);*/ } try { rec.closeRecordStore(); } catch (Exception error) { /*a = new Alert("Error Closing", error.toString(), null, AlertType.WARNING); a.setTimeout(Alert.FOREVER); d.setCurrent(a);*/
  • 41. if (RecordStore.listRecordStores() != null) { try { RecordStore.deleteRecordStore("myRecordStor e"); } catch (Exception error) { /*a = new Alert("Error Removing", error.toString(), null, AlertType.WARNING); a.setTimeout(Alert.FOREVER); d.setCurrent(a);*/ } } } } }