xbase - How to connect to foxpro db using XbaseJ -
i want fetch data fox pro data base , insert mysql. purpose using xbasej. how can connect foxpro data base using xbasej.
thanks
have tried xbasej sample code?
/** **/ package org.xbasej.examples; /** * @author joseph mcverry * */ import org.xbasej.*; import org.xbasej.fields.charfield; import org.xbasej.fields.logicalfield; import org.xbasej.fields.numfield; public class example2 { public static void main(string args[]){ string dow[] = {"sun", "mon", "tue", "wed", "thu", "fri", "sat"}; try{ //open dbf file dbf classdb=new dbf("class.dbf"); //define fields charfield classid = (charfield) classdb.getfield("classid"); charfield name = (charfield) classdb.getfield("classname"); charfield teacher = (charfield) classdb.getfield("teacherid"); charfield daysmeet = (charfield) classdb.getfield("daysmeet"); charfield time = (charfield) classdb.getfield("timemeet"); numfield credits = (numfield) classdb.getfield("credits"); logicalfield undergrad = (logicalfield) classdb.getfield("undergrad"); (int = 1; <= classdb.getrecordcount(); i++) { classdb.read(); if (undergrad.getboolean()) // show undergrad courses { system.out.println(name.get() + " id " + classid.get()); system.out.print(" meets at: " + time.get() + " on "); (int j = 0; j < 7; j++) { if (daysmeet.get().charat(j) == 'y') system.out.print(dow[j] + " "); } system.out.println(""); system.out.println(" credits: " + credits.get()); } // end if undergrad test } }catch(exception e){ e.printstacktrace(); } } }
Comments
Post a Comment