Á¦¸ñ : WebSpere V3, DataSource + DB2 6.1(fixpack4) ±Û¾´ÀÌ: ÀÌ¿ø¿µ(javaservice) 2001/05/22 19:28:23 Á¶È¸¼ö:3288 ÁÙ¼ö:227 |
|
>
> {WAS3.5¿¡¼ datasource¿Í class.forNameÀÇ Â÷ÀÌ¿¡ ´ëÇÑÁú¹®?}
> {¼Õ´Ô(guest), hcchoi@jisman.co.kr}
>
> Ç×»ó ÀÌ »çÀÌÆ®¿¡¼ µµ¿òÀ» ¹Þ´Â »ç¶÷ÀÔ´Ï´Ù.
> Å×½ºÆ® ÇÏ´ÂÁß¿¡ ÀÌ»óÇÑ Á¡ÀÌ ÀÖ¾î¼ ÀÌ·¸°Ô ±ÛÀ» ¿Ã¸®°Ô µÆ½À´Ï´Ù.
> ¸ÕÀú Å×½ºÆ® ȯ°æÀ» ¸»¾¸µå¸®ÀÚ¸é
> win2000+was3.5.3À̰í UDB6.1+fixpack4¸¦ Àû¿ëÇß½À´Ï´Ù.
>
> ¹®Á¦ÀÇ ¿øÀÎÀº QueryÇÑ °á°ú¸¦ rs¿¡ ³Ö¾î¼ while loop¸¦ µ¹¸®¸é
> loop¾È¿¡ ´Ù¸¥ Table¸¦ ¶Ç´Ù½Ã Query¸¦ ÇÏ¸é ´ÙÀ½°ú °°ÀÌ ¸Þ¼¼Áö°¡ »Ñ·ÁÁÝ´Ï´Ù.
> Á¦ »ý°¢À¸·Î´Â ResultSet¸¦ 2°³ÀÌ»ó ¸¸µé¾úÀ»¶§ ¹®Á¦°¡ µÇ´Â°Í °°Àºµ¥....
> [IBM][CLI Driver] CLI0125E Function sequence error. SQLSTATE=HY010
>
> Á¦°¡ ÀÌ»óÇÏ°Ô »ý°¢ÇѰÍÀº Class.forNameÀ¸·Î DB¿¬°áÀ» ÇÏ¸é ±¦ÂúÀºµ¥....
> DataSource¸¦ ÀÌ¿ëÇÏ¸é ´ÙÀ½°ú °°Àº ¿¡·¯°¡ ¶³¾îÁö´õ±º¿©....
> Á¦°¡ º¼¶§ WebSphereÀÇ ¹®Á¦°°Àºµ¥...
>
> º¸½Ã°í µµ¿ò¹Ù¶ø´Ï´Ù.
>
>
ÃÖ±Ù¼öÁ¤ÀÏ: 2001.05.24 : Oracle Test Ãß°¡
µ¿ÀÏÇÑ Windows ȯ°æ¿¡¼ DB2 App Driver ¸¦ ÀÌ¿ëÇÏ¿© DataSource ¸¦ ¸¸µé¾úÀ» ¶§,
±×¿Í °°ÀÌ Nested JDBC Statement Query ¸¦ ³¯¸®´Ï µ¿ÀÏÇÑ ¿¡·¯°¡ ¹ß»ýÇÏ´Â ±º¿ä..
¸î°¡Áö °æ¿ì¸¦ Å×½ºÆ® ÇØ º» °á°ú (ÇöÀç·Î¼´Â) ¹ö±×·Î º¸ÀÔ´Ï´Ù.
ÇØ´ç ³»¿ëÀº IBM PMRÀ» ÅëÇØ Á¶¼ÓÇÑ ½ÃÀϳ»¿¡ ÇØ°áÅä·Ï ÇϰڽÀ´Ï´Ù.
Windows 2000 ( ´Ù¸¥ OS ´Â °ËÁõÁß),
WebSphere 3.5.3, 3.5.4,
DB2 6.1+ fixpack4 ,
DataSource ¸¦ ¸¸µé±â À§ÇØ "DB2 App Driver" ¸¦ ÀÌ¿ëÇßÀ» ¶§¸¸ À§¿Í °°Àº Áõ»óÀÌ
ÀϾ´Ï´Ù.
DataSource ¸¦ »ç¿ëÄ¡ ¾Ê°í ±×³É Class.forName("...") À» ÀÌ¿ëÇÏ¿© Á÷Á¢ Á¢¼ÓÇϸé
DB2 App JDBC µå¶óÀ̹öµç, DB2 Net JDBC µå¶óÀ̹öµç ¹®Á¦°¡ ¾ø½À´Ï´Ù.
±×·¯³ª, Connection Pooling À» »ç¿ëÄ¡ ¾ÊÀ¸¹Ç·Î ±ÇÀåÇÒ ¼ö ¾ø½À´Ï´Ù.
DataSource ¸¦ »ç¿ëÇϵÇ, JDBC µå¶óÀ̹ö¸¦ App µå¶óÀ̹ö´ë½Å Net µå¶óÀ̹ö¸¦ »ç¿ëÇϸé
À§¿Í °°Àº Çö»óÀº ÀϾÁö ¾Ê½À´Ï´Ù.
´çºÐ°£, ÇØ´ç DataSource °¡ »ç¿ëÇÏ´Â "JDBC Driver"¿¡¼ App Driver ´ë½Å
Net Driver¸¦ »ç¿ëÅä·Ï Á¶Á¤ ÇϽʽÿä.
Ŭ·¡½ºÀ̸§: com.ibm.db2.jdbc.app.DB2Driver
URL Á¢µÎ¾î: jdbc:db2
==>
Ŭ·¡½ºÀ̸§: COM.ibm.db2.jdbc.net.DB2Driver
URL Á¢µÎ¾î: jdbc:db2://localhost
"Ŭ·¡½ºÀ̸§"Àº DropDown ¸®½ºÆ®¿¡ ¾øÀ¸´Ï Á÷Á¢ ÀÔ·ÂÇÏ½Ã¸é µË´Ï´Ù.
Windows Á¦¾îÆÇ¿¡¼ "DB2 JDBC ¾ÖÇø´ ¼¹ö" °¡ "½ÃÀÛ"µÇ¾î ÀÖ¾î¾ß ÇÕ´Ï´Ù.
À§¿Í °°ÀÌ º¯°æÇÑ ÈÄ¿¡´Â ÇØ´ç "AppServer"¸¦ Àç ±âµ¿ÇÏ¿©¾ß ¹Ý¿µÀÌ µË´Ï´Ù.
----------------------------
2001.05.24
Oracle 8.1.6 OCI ¹æ½ÄÀ̳ª Thin ¹æ½ÄÀ¸·Î DataSource ¸¦ ¸¸µé¾î Á¢¼ÓÇÏ¿©µµ
À§¿Í °°Àº ¹®Á¦´Â ÀϾÁö ¾Ê½À´Ï´Ù.
---------------------------------------------------------------------------------
Nested Statement Query Problem
Abstract : Nested JDBC Statement query produce "Function sequence error"
when they use a DataSource using JDBC App Driver for DB2.
Environment :
- Windows 2000
- WebSphere 3.5.3 (or + PQ47404) / WebSphere 3.5.4
- DB2 6.1 + fixpack 4
- DataSource using JDBC App Driver for UDB DB2
- DB and WebSphere are located in the same PC
- UDB DB2 already issued with command "...\sqllib\java12\usejdbc2"
Regeneration Error Senario :
db2 => describe select * from emp
SQLDA Info
sqldaid : SQLDA sqldabc: 896 sqln: 20 sqld: 2
Column Info
sqltype sqllen sqlname.data sqlname.length
-------------------- ------ ------------------------------ --------------
485 DECIMAL 4, 0 EMPNO 5
449 VARCHAR 8 ENAME 5
db2 => select * from emp
EMPNO ENAME
------ --------
1000. aaaaa
1001. bbbbb
1002. cccccc
1003. ddddd
1004. eeeee
1005. fffff
6 records selected.
http://localhost/test1.jsp
---------------------------------------------------------------------
<%@ page contentType="text/html; charset=euc-kr" %>
<%@ page import="java.sql.*,javax.sql.*,javax.naming.*" %>
<%!
private static DataSource ds = null;
private static String source = "jdbc/LWYDB";
private static String user = "db2admin";
private static String password = "db2admin";
static {
try {
java.util.Hashtable props = new java.util.Hashtable();
props.put(Context.INITIAL_CONTEXT_FACTORY,
"com.ibm.ejs.ns.jndi.CNInitialContextFactory");
Context ctx = null;
try {
ctx = new InitialContext(props);
ds = (DataSource)ctx.lookup(source);
}
finally {
if ( ctx != null ) ctx.close();
}
}
catch (Exception e) {
System.err.println(e.toString());
}
}
%>
<xmp>
<%
Connection conn = null;
Statement stmt = null;
try {
conn = ds.getConnection(user, password);
//Class.forName("COM.ibm.db2.jdbc.app.DB2Driver").newInstance();
//conn = DriverManager.getConnection("jdbc:db2:LWYDB",user,password);
//Class.forName("COM.ibm.db2.jdbc.net.DB2Driver").newInstance();
//conn = DriverManager.getConnection("jdbc:db2://localhost/LWYDB",user,password);
stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("select empno from emp");
while(rs.next()){
Statement stmt2 = null;
try {
stmt2 = conn.createStatement();
ResultSet rs2 = stmt2.executeQuery(
"select * from emp where empno = " + rs.getString(1));
while(rs2.next()) {
out.println(rs2.getString(1) + ", " + rs2.getString(2) );
}
rs2.close();
}
finally{
if(stmt2 != null) try{stmt2.close();}catch(Exception e){}
}
}
rs.close();
}
catch(Exception e){
java.io.ByteArrayOutputStream bout =
new java.io.ByteArrayOutputStream();
java.io.PrintWriter pw = new java.io.PrintWriter(bout);
e.printStackTrace(pw);
pw.flush();
out.println(bout.toString());
}
finally {
if(stmt != null) try {stmt.close();}catch(Exception e){}
if(conn != null) try {conn.close();}catch(Exception e){}
}
%>
</xmp>
---------------------------------------------------------------------
Result:
---------------------------------------------------------------------
1000, aaaaa
COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver] CLI0125E
Function sequence error. SQLSTATE=HY010
at java.sql.SQLException.<init>(SQLException.java:45)
at COM.ibm.db2.jdbc.DB2Exception.<init>(DB2Exception.java:71)
at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException
(SQLExceptionGenerator.java(Compiled Code))
at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException
(SQLExceptionGenerator.java:187)
at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.check_return_code(
SQLExceptionGenerator.java:438)
at COM.ibm.db2.jdbc.app.DB2ResultSet.next(DB2ResultSet.java:444)
at com.ibm.ejs.cm.proxy.ResultSetProxy.next(ResultSetProxy.java:
495)
at D_0003a.WebSphere.AppServer.hosts.d_00025fault_0005fhost.AppS
erverWebApp.web._test1_2E_jsp_jsp_6._jspService(_test1_2E_jsp_js
p_6.java(Compiled Code))
at com.sun.jsp.runtime.HttpJspBase.service(HttpJspBase.java:175)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:214)
......
---------------------------------------------------------------------
No error Cases :
- Withoutout DataDource, just using DB2 App Driver:Class.forName(..)
- Withoutout DataDource, just using DB2 Net Driver:Class.forName(..)
- DataSource using DB2 Net Driver
Error Case:
- DataSource using DB2 App Driver
---------------------------------------------
WonYoung Lee. Advisory IT Specialist,
IBM WebSphere Tech. Support,TSS-ATS,IBM Korea.
E-mail: lwy@kr.ibm.com, javaservice@hanmail.net
---------------------------------------------
ds_net.gif (28084 Bytes)
|
Á¦¸ñ : Re: Function sequence error ±Û¾´ÀÌ: ÁøÇö¿ì(ozjames) 2001/05/30 01:43:35 Á¶È¸¼ö:6044 ÁÙ¼ö:72 |
|
We've got the reply from PMR.
-------------------------------------------------------------------------------
S5> SERVICE GIVEN= 99 SG/99/
Hello,
I have done much searching on this error. In every PMR that I found,
DB2 support was engaged. The "Function sequence error" can be caused
by many different things and is rather a generic error. This can happen
when autocommit is turned ON and cusrsorhold is OFF.
PMR 03015,B724,C724 was encountering the same exact problem with the
APP driver at DB2 6.1 FP4. Applying FP5 solved the problem.
Furthermore, I have seen evidence that the following work-around
can be successful:
1) in .../WebSphere/AppServer/properties, define/create a datasources.xml File with
-----------------------------------------------
<?xml version="1.0"?>
<data-sources>
<data-source name="SampleDB"> <-- your DataSource name
<attribute name="CURSORHOLD" value="1" />
</data-source>
</data-sources>
-----------------------------------------------
Put the right DS name there and restart WAS.
You can have the customer try either of these options or engage the
DB2 team for advice.
Regards,
Matt
-------------------------------------------------------------------------------
DB2 6.1 + fixpack 5¸¦ ¼³Ä¡ÇÏ¸é ¹®Á¦°¡ ÇØ°áµÈ´Ù°í ÇÏ¿´À¸³ª, ¸·»ó Å×½ºÆ®Çغ¸´Ï
fixpack 5¿¡¼µµ ÇØ°áµÇÁö ¾Ê¾Ò½À´Ï´Ù.
¹Ý¸é, datasources.xml Àº ¾Æ·¡Ã³·³ ÀÛ¼ºÇÏ¿© »õ·Î ±âµ¿ÇÏ´Ï ¹®Á¦°¡ ÇØ°áµÇ¾ú½À´Ï´Ù.
C:\WebSphere\AppServer\properties\ ¹Ø¿¡ ¾Æ·¡¿Í °°ÀÌ datasource.xmlÀ̶ó´Â
FileÀ» ¸¸µé¾î ÁÖ½ÅÈÄ WebSphere¸¦ RestartÇϽøé ÇØ°áÀÌ °¡´ÉÇÕ´Ï´Ù..
[$WAS_HOME/properties/datasources.xml]
-----------------------------------------------
<?xml version="1.0"?>
<data-sources>
<data-source name="LWYDB"> <-- your data source name
<attribute name="CURSORHOLD" value="1" />
</data-source>
</data-sources>
-----------------------------------------------
NOTE: CURSORHOLD = 1 À» ÅëÇØ ÇØ´ç ¹®Á¦´Â ÇØ°áµË´Ï´Ù¸¸, ºÎ°¡ÀûÀÎ ¿µÇâ¿¡ ´ëÇØ¼´Â
¾ÆÁ÷ ¾Ë·ÁÁø ¹Ù°¡ ¾ø½À´Ï´Ù.
Ȥ½Ã TestÈÄ¿¡ ÇØ°áÀÌ ¾ÈµÇ¸é ¾Ë·ÁÁֽñ⠹ٶø´Ï´Ù..
°¨»çÇÕ´Ï´Ù..
-----------------
2001.06.20
DB2 6.1 Fixpack 5,6,7,8 ¹ø ¸ðµÎ Àû¿ëÇØ º¸¾ÒÁö¸¸, fixpack¸¸À¸·Î´Â ÇØ°áµÇÁö
¾Ê½À´Ï´Ù.
-----------------
2001.06.30
AIX¿¡¼´Â À§¿Í °°Àº "Function sequence error" ¸Þ¼¼Áö ´ë½Å ¿¡·¯ÀÇ ³»¿ëÀÌ ´ÙÀ½°ú
°°Àº µí ÇÕ´Ï´Ù.
SQL0501N The cursor specified in a FETCH or CLOSE statement is not open.
SQLSTATE=24501
---------------------------------------------
HyunWoo Jin.
IT Specialist. ITS, IBM Korea.
E-mail: ozjames@kr.ibm.com
---------------------------------------------
|
|