Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access 7.1.253
  HXTT Cobol 5.0.252
  HXTT DBF 7.1.253
 
  Buy Now
  Support
  Download
  Document
  FAQ
  HXTT Excel 6.1.256
  HXTT Json 1.0.224
  HXTT Paradox 7.1.252
  HXTT PDF 2.0.252
  HXTT Text(CSV) 7.1.252
  HXTT Word 1.1.252
  HXTT XML 4.0.253
Offshore Outsourcing
Free Resources
  Firewall Tunneling
  Search Indexing Robot
  Conditional Compilation
  Password Recovery for MS Access
  Password Recovery for Corel Paradox
  Checksum Tool for MD5
  Character Set Converter
  Pyramid - Poker of ZYH
   
   
   
Heng Xing Tian Tai Lab of Xi'an City (abbr, HXTT)

HXTT DBF
Re:Re:Re:Re:Re:Re:Re:Re:Using DBF_JDBC30
Magna
2007-05-07 08:08:04
I am sending also the *.dbf file i got with this new try (still cannot opened it properly in Excel :()


import java.sql.*;
import java.util.Properties;


public class MyCreateTable2 {

/**
* @param args
*/
public static void main(String[] args) {
String strDefaultOutputDir="D:/instalados/eclipse/workspaceDIVA2007_RC8/GridIO";

String strNewOutputTable="example1";

Connection conOutputFile;

Statement stOutputFile;

String strSQLCols="\"ID\" VARCHAR (25), \"NAME\" VARCHAR (25),\"VALUE\" NUMERIC (4,1)";

try {

Class.forName("com.hxtt.sql.dbf.DBFDriver").newInstance();

String urltable = "jdbc:dbf:///" + strDefaultOutputDir + "";

Properties properties = new Properties();

conOutputFile = DriverManager.getConnection(

urltable,

properties);

stOutputFile = conOutputFile.createStatement();

stOutputFile.execute("CREATE TABLE " + '"' +

strNewOutputTable + '"' + " (" + strSQLCols +

")");

stOutputFile.close();

conOutputFile.close();



stOutputFile.close();

conOutputFile.close();

}

catch (SQLException sqle) {

do {

System.out.println(sqle.getMessage());

System.out.println("Error Code:" + sqle.getErrorCode());

System.out.println("SQL State:" + sqle.getSQLState());

sqle.printStackTrace();

}

while ( (sqle = sqle.getNextException()) != null);

}

catch (Exception e) {

System.out.println(e.getMessage());

e.printStackTrace();

}

}

}

Search Key   Search by Last 50 Questions




Google
 

Email: webmaster@hxtt.com
Copyright © 2003-2019 Heng Xing Tian Tai Lab of Xi'an City. | All Rights Reserved. | Privacy | Legal | Sitemap