http://members.aol.com/kgb1001001/Articles/JDBCMetadata/JDBC_Metadata.htm
| SQL Type | Java Method |
|---|---|
| BIGINT | getLong() |
| BINARY | getBytes() |
| BIT | getBoolean() |
| CHAR | getString() |
| DATE | getDate() |
| DECIMAL | getBigDecimal() |
| DOUBLE | getDouble() |
| FLOAT | getDouble() |
| INTEGER | getInt() |
| LONGVARBINARY | getBytes() |
| LONGVARCHAR | getString() |
| NUMERIC | getBigDecimal() |
| OTHER | getObject() |
| REAL | getFloat() |
| SMALLINT | getShort() |
| TIME | getTime() |
| TIMESTAMP | getTimestamp() |
| TINYINT | getByte() |
| VARBINARY | getBytes() |
| VARCHAR | getString() |
| SQL Type | Java Method |
|---|---|
| ARRAY | getArray() |
| BLOB | getBlob() |
| CLOB | getClob() |
| DISTINCT | getUnderlyingType() |
| REF | getRef() |
| STRUCT | (castToStruct)getObject() |
| JAVA_OBJECT | (castToObjectType)getObject() |
댓글을 달아 주세요
댓글을 달아 주세요
http://en.wikipedia.org/wiki/Template_engine_%28web%29
freemaker
http://freemarker.sourceforge.net/
velocity
http://velocity.apache.org/
java source code generation suite based on Velocity
http://www.dishevelled.org/codegen/
JDT
Java model
The Java model is the set of classes that model the objects associated with creating, editing, and building a Java program. The Java model classes are defined in org.eclipse.jdt.core. These classes implement Java specific behavior for resources and further decompose Java resources into model elements.
Java elements
The package org.eclipse.jdt.core defines the classes that model the elements that compose a Java program. The JDT uses an in-memory object model to represent the structure of a Java program. This structure is derived from the project's class path. The model is hierarchical. Elements of a program can be decomposed into child elements.
Manipulating Java elements is similar to manipulating resource objects. When you work with a Java element, you are actually working with a handle to some underlying model object. You must use the exists() protocol to determine whether the element is actually present in the workspace.
The following table summarizes the different kinds of Java elements.
| Element | Description |
|---|---|
| IJavaModel | Represents the root Java element, corresponding to the workspace. The parent of all projects with the Java nature. It also gives you access to the projects without the java nature. |
| IJavaProject | Represents a Java project in the workspace. (Child of IJavaModel) |
| IPackageFragmentRoot | Represents a set of package fragments, and maps the fragments to an underlying resource which is either a folder, JAR, or ZIP file. (Child of IJavaProject) |
| IPackageFragment | Represents the portion of the workspace that corresponds to an entire package, or a portion of the package. (Child of IPackageFragmentRoot ) |
| ICompilationUnit | Represents a Java source (.java) file. (Child of IPackageFragment ) |
| IPackageDeclaration | Represents a package declaration in a compilation unit. (Child of ICompilationUnit ) |
| IImportContainer | Represents the collection of package import declarations in a compilation unit. (Child of ICompilationUnit ) |
| IImportDeclaration | Represents a single package import declaration. (Child of IImportContainer ) |
| IType | Represents either a source type inside a compilation unit, or a binary type inside a class file. |
| IField | Represents a field inside a type. (Child of IType ) |
| IMethod | Represents a method or constructor inside a type. (Child of IType ) |
| IInitializer | Represents a static or instance initializer inside a type. (Child of IType ) |
| IClassFile | Represents a compiled (binary) type. (Child of IPackageFragment ) |
| ITypeParameter | Represents a type parameter. (Not a child of any Java element, it is obtained using IType.getTypeParameter(String) or IMethod.getTypeParameter(String)) |
| ILocalVariable | Represents a local variable in a method or an initializer. (Not a child of any Java element, it is obtained using ICodeAssist.codeSelect(int, int)) |
All Java elements support the IJavaElement interface.
Some of the elements are shown in the Packages view. These elements implement the IOpenable interface, since they must be opened before they can be navigated. The figure below shows how these elements are represented in the Packages view.
The Java elements that implement IOpenable are created primarily from information found in the underlying resource files. The same elements are represented generically in the resource navigator view.
Other elements correspond to the items that make up a Java compilation unit. The figure below shows a Java compilation unit and a content outliner that displays the source elements in the compilation unit.
These elements implement the ISourceReference interface, since they can provide corresponding source code. (As these elements are selected in the content outliner, their corresponding source code is shown in the Java editor).
Manipulating Java code
The first snippet is the generated output: package example;
import java.util.*;
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello" + " world");
}
}
The following snippet is the corresponding code that generates the output. AST ast = new AST();
CompilationUnit unit = ast.newCompilationUnit();
PackageDeclaration packageDeclaration = ast.newPackageDeclaration();
packageDeclaration.setName(ast.newSimpleName("example"));
unit.setPackage(packageDeclaration);
ImportDeclaration importDeclaration = ast.newImportDeclaration();
QualifiedName name =
ast.newQualifiedName(
ast.newSimpleName("java"),
ast.newSimpleName("util"));
importDeclaration.setName(name);
importDeclaration.setOnDemand(true);
unit.imports().add(importDeclaration);
TypeDeclaration type = ast.newTypeDeclaration();
type.setInterface(false);
type.setModifiers(Modifier.PUBLIC);
type.setName(ast.newSimpleName("HelloWorld"));
MethodDeclaration methodDeclaration = ast.newMethodDeclaration();
methodDeclaration.setConstructor(false);
methodDeclaration.setModifiers(Modifier.PUBLIC | Modifier.STATIC);
methodDeclaration.setName(ast.newSimpleName("main"));
methodDeclaration.setReturnType(ast.newPrimitiveType(PrimitiveType.VOID));
SingleVariableDeclaration variableDeclaration = ast.newSingleVariableDeclaration();
variableDeclaration.setModifiers(Modifier.NONE);
variableDeclaration.setType(ast.newArrayType(ast.newSimpleType(ast.newSimpleName("String"))));
variableDeclaration.setName(ast.newSimpleName("args"));
methodDeclaration.parameters().add(variableDeclaration);
org.eclipse.jdt.core.dom.Block block = ast.newBlock();
MethodInvocation methodInvocation = ast.newMethodInvocation();
name =
ast.newQualifiedName(
ast.newSimpleName("System"),
ast.newSimpleName("out"));
methodInvocation.setExpression(name);
methodInvocation.setName(ast.newSimpleName("println"));
InfixExpression infixExpression = ast.newInfixExpression();
infixExpression.setOperator(InfixExpression.Operator.PLUS);
StringLiteral literal = ast.newStringLiteral();
literal.setLiteralValue("Hello");
infixExpression.setLeftOperand(literal);
literal = ast.newStringLiteral();
literal.setLiteralValue(" world");
infixExpression.setRightOperand(literal);
methodInvocation.arguments().add(infixExpression);
ExpressionStatement expressionStatement = ast.newExpressionStatement(methodInvocation);
block.statements().add(expressionStatement);
methodDeclaration.setBody(block);
type.bodyDeclarations().add(methodDeclaration);
unit.types().add(type);
댓글을 달아 주세요
A : That was quite a storm last night.
B : Well, We need the rain.
A : Crazy weather, It's so unpredictable.
B : Oh, it's not so bad.
A : There're report up hail the size of golf ball.
B : Hail?, This time of year.
A : Look out side if you don't believe me.
B : Oh, my pool litte tulips. what a crazy weather.
댓글을 달아 주세요
2007/03/12
A : Good morning.
B : What's good about it.
A : Something Happen?
B : Stinky is sick.
A : No. Is she going to be okay?
B : My vet(veterinarian) says she has Fifty-Fifty chance of making it.
A : You must be so worried.
B : Look! she stretching.
A : I think she will be fine.
2007/03/13
A : I'm Homesick. I miss my family and my friends. ( Home is where the heart is.. )
B : Hey, I'm a friend.
A : Yes, You are.
B : I have the opposite problem. I'm sick of my home. No one appreciates me.
A : I appreciate you.
B : You do.
A : Of course.
2007/03/14
A : Have you been under any stress lately.
B : Well, No more than usual.
A : Did you drink coffee.
B : Oh yes, I love coffee.
A : How many cups a day?
B : I don't know. maybe eight.
A : That could be the problem. try to cut down.
B : I don't know If I can? I drink to relax.
댓글을 달아 주세요
영문
Sun에서 제공하는 Overview
http://java.sun.com/j2se/1.5.0/docs/guide/language/index.html
간단하지만 한눈에 들어오는 PPT 제일 먼저 보자.
http://java.sun.com/j2se/1.5/pdf/Tiger-lang.pdf
한글
http://www.dev2dev.co.kr/pub/a/2005/12/java_5_features.jsp
블로그에서 찾은 글(Generics에 대해 좀더 자세한 내용)
http://blog.naver.com/sleepman0408?Redirect=Log&logNo=20022946224
ppt 내용중.. 감동적인.. 소스..
public class Freq {
private static final Integer ONE = new Integer(1);
public static void main(String[] args) {
// Maps word (String) to frequency (Integer)
Map m = new TreeMap();
for (int i=0; i<args.length; i++) {
Integer freq = (Integer) m.get(args[i]);
m.put(args[i], (freq==null ? ONE :
new Integer(freq.intValue() + 1)));
}
System.out.println(m);
}
}
거지 같은 자바 소스가... 이렇게 깔끔하게 바꼈네요..
public static void main(String[] args) {
Map<String, Integer> m = new TreeMap<String, Integer>();
for (String word : args) {
Integer freq = m.get(word);
m.put(word, (freq == null ? 1 : freq + 1));
}
System.out.println(m);
}
}
댓글을 달아 주세요
-
goeasylife
2007/01/24 09:05
댓글주소
수정/삭제
댓글쓰기
자바5 공부도 좀 해야 하는데 저번에 온라이스터디 참여 했다가 탈퇴 당하고.... 이제 시간이 좀 나시나 봐요 ^^
\n\s[^\/\/]+\s*echo.*$
설명 : 뉴라인부터 // 이 없는 echo문장 찾기
댓글을 달아 주세요
아직 완변하지는 않지만..
아쉬운데로 충분히 활용가능하다..
EBS 영어 청취목록
7:20 EASY ENGLISH
7:40 POWER ENGLISH
8:00 MORNING SPEICAL
http://rodream.net
댓글을 달아 주세요
하루 8시간을 넘어 답답한 사무실에서 일을 하다보면 의욕도 떨어지고 집중력도 떨어져서 지금 무슨일을 하고 있었는지 잊어버리는 경우가 종종있다. 흐물흐물해진 몸과 머리에 산듯한 자극을 주고, 적극적인 직장생활을 위해 답답한 사무실을 벗어나자.
점심시간 식사를 하고 하루 30분 정도 산책을 한다. 좋은 경치과 좋은 사람과 부담없는 대화로 즐거운 시간을 보내면 보다 집중력있는 일처리가 가능하다.
저랑 walking mate 하실분... 손!! ^^;
구글에서도??
http://googlekoreablog.blogspot.com/2006/04/google-weekly-walk.html
rodreamradio.exe



댓글을 달아 주세요