FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
java-code-example/DbfReader/src/TestWriter.java at master · cherkavi/java-code-example · GitHub
cherkavi
/
java-code-example
Public
Notifications
You must be signed in to change notification settings
Fork
4
Star
0
Code
Issues
0
Pull requests
42
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
java-code-example
/
DbfReader
/
src
/
TestWriter.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
39 lines (29 loc) · 1.06 KB
Breadcrumbs
java-code-example
/
DbfReader
/
src
/
TestWriter.java
Copy path
File metadata and controls
executable file
·
39 lines (29 loc) · 1.06 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
33
34
35
36
37
38
39
import
java
.
io
.
FileOutputStream
;
import
java
.
io
.
IOException
;
import
com
.
linuxense
.
javadbf
.
DBFException
;
import
com
.
linuxense
.
javadbf
.
DBFField
;
import
com
.
linuxense
.
javadbf
.
DBFWriter
;
public
class
TestWriter
{
public
static
void
main
(
String
[]
args
)
throws
DBFException
,
IOException
{
// let us create field definitions first
// we will go for 3 fields
//
DBFField
fields
[] =
new
DBFField
[
2
];
fields
[
0
] =
new
DBFField
();
fields
[
0
].
setName
(
"emp_code"
);
fields
[
0
].
setDataType
(
DBFField
.
FIELD_TYPE_C
);
fields
[
0
].
setFieldLength
(
50
);
fields
[
1
] =
new
DBFField
();
fields
[
1
].
setName
(
"emp_code"
);
fields
[
1
].
setDataType
(
DBFField
.
FIELD_TYPE_C
);
fields
[
1
].
setFieldLength
(
50
);
Object
[]
rowData
=
new
Object
[]{
"Value1"
,
"Value2"
};
DBFWriter
writer
=
new
DBFWriter
();
writer
.
setFields
(
fields
);
writer
.
addRecord
(
rowData
);
FileOutputStream
fos
=
new
FileOutputStream
(
"c:
\\
craeting.dbf"
);
writer
.
write
(
fos
);
fos
.
close
();
System
.
out
.
println
(
"OK"
);
}
}
Back
|
FazBrowse Home
|
New Git URL