티스토리 뷰
먼저 필요한 라이브러리
mybatis-3.3.0.jar
ojdbc14.jar
근데 이게 이클립스 프로젝트로 불러왔을때 잘 안되고 빨간줄 표시가 되는 경우가 있다. 클린 등의 작업을 해줘야 한다.
우선 구조는
APP
src
config
config.properties
myBatisConfig.xml
sql.xml
kr.co.aa
Main.java
SqlMapClient.java
Time.java
우선
config.properties
(여기서는 티베로씀)
driver=com.tmax.tibero.jdbc.TbDriver
url=jdbc:tibero:thin:@11.11.11.11:1234:DBNAME
username=AA
password=PP
isReal=N
myBatisConfig.xml
<?xml..
<!DOCTYPE ..
<configuration>
<properties resource="config/config.properties" />
..
<mappers>
</mappers>
</configuration>
이전글 참조
sql.xml
<mapper namespace="batch">
</mapper>
이전글 참조
Main.java
main 메소드에
new Time();
public class SqlMapClient{
private static SqlSession session=null;
static{
try{
String resource="config/myBatisConfig.xml";
Reader reader = Resource.getResourceAsReader(resource);
SqlSessionFactory sqlMapper=new SqlSessionFactoryBuilder().build(reader(;
session=sqlMapper.openSession();
}catch(IOException e){
}
public static SqlSession getSqlSession(){
return session;
}
}
public class Time(){
public Time(){
String resource="config/config.properties";
Properties prop=new Properties();
try{
Reader reader = Resources.getResourceAsReader(resource);
prop.load(reader);
String isReal=prop.getProperty("isReal");
SqlSession session = SqlMapClient.getSqlSession();
List<Map<String,Object>> list=session.selectList("batch.getTimeList");
}
이런식으로 하면됨..
        
 
          
mybatis-3.3.0.jar
ojdbc14.jar
근데 이게 이클립스 프로젝트로 불러왔을때 잘 안되고 빨간줄 표시가 되는 경우가 있다. 클린 등의 작업을 해줘야 한다.
우선 구조는
APP
src
config
config.properties
myBatisConfig.xml
sql.xml
kr.co.aa
Main.java
SqlMapClient.java
Time.java
우선
config.properties
(여기서는 티베로씀)
driver=com.tmax.tibero.jdbc.TbDriver
url=jdbc:tibero:thin:@11.11.11.11:1234:DBNAME
username=AA
password=PP
isReal=N
myBatisConfig.xml
<?xml..
<!DOCTYPE ..
<configuration>
<properties resource="config/config.properties" />
..
<mappers>
</mappers>
</configuration>
이전글 참조
sql.xml
<mapper namespace="batch">
</mapper>
이전글 참조
Main.java
main 메소드에
new Time();
public class SqlMapClient{
private static SqlSession session=null;
static{
try{
String resource="config/myBatisConfig.xml";
Reader reader = Resource.getResourceAsReader(resource);
SqlSessionFactory sqlMapper=new SqlSessionFactoryBuilder().build(reader(;
session=sqlMapper.openSession();
}catch(IOException e){
}
public static SqlSession getSqlSession(){
return session;
}
}
public class Time(){
public Time(){
String resource="config/config.properties";
Properties prop=new Properties();
try{
Reader reader = Resources.getResourceAsReader(resource);
prop.load(reader);
String isReal=prop.getProperty("isReal");
SqlSession session = SqlMapClient.getSqlSession();
List<Map<String,Object>> list=session.selectList("batch.getTimeList");
}
이런식으로 하면됨..
'자바(Java)' 카테고리의 다른 글
| delete command denied to user for table (0) | 2019.09.21 | 
|---|---|
| java.util.HashMap cannot be cast to java.lang.Integer (0) | 2019.08.24 | 
| 자바 spring mybatis standalone (0) | 2019.08.19 | 
| 자바 새벽시간일 경우 이전 날짜로 (0) | 2019.08.06 | 
| java – 날짜 문자열에서 시간 추출 (0) | 2019.08.06 | 
					댓글
						
					
					
					
				
			
										공지사항
										
								
							
							
							
								최근에 올라온 글
								
							
							
								
									최근에 달린 댓글
									
							
							
								- Total
 
- Today
 
- Yesterday
 
									링크
									
							
							
								
									TAG
									
							
							
							- JDBC
 - 문자열
 - 자바 smtp
 - XE
 - 프로씨
 - xe addon
 - C
 - MySQL
 - EC
 - php
 - ocajp
 - esql
 - 포인터
 - xe애드온
 - 오라클
 - KG
 - proc
 - 자바
 - 인포믹스
 - Python
 - ocjap
 - XE3
 - 이클립스
 - C언어
 - 스크래핑
 - 파싱
 - webix
 - 라이믹스
 - 플러터
 - 파이썬
 
| 일 | 월 | 화 | 수 | 목 | 금 | 토 | 
|---|---|---|---|---|---|---|
| 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 | 
									글 보관함
									
							
					