±Û¾´ÀÌ :¾ÈÁ¤ÇÑ 1999³â 9¿ù 07ÀÏ 17:40:55
informix°¡ installµÇ¾î ÀÖ´Â »óÅ¿¡¼
informix¿¡¼ Á¦°øÇÏ´Â JDBC Driver¸¦ install¶ó°í Apache Web Server¸¦ installÇÏ¿´½À´Ï´Ù.
±×¸®°í JDBC¿¡ ÀÖ´Â Demo9.java¸¦ compileÇÏ°í
demo9.htmlÀ» web¿¡¼ ºÎ¸£°í ½ÇÇàÇϴµ¥
connect button(ÀÌ ÇÁ·Î±×·¥¿¡¼ DB¿Í ¿¬°áÇÒ¶§)À» ClickÇÏ¸é ´ÙÀ½°í °°Àº Error°¡ ³³´Ï´Ù.
Could not connect to the database!!
com/informix/jdbc/IfxDriver
Error°¡ ³ª´Â Source ºÎºÐÀº
String jdbcURL = "jdbc:informix-sqli://"
+hostname + ":" + portNum +
"/" + dbName + ":" +
"INFORMIXSERVER=" +
ifmxServer + ";user=" +
userName + ";password=" +
password;
//À§ÀÇ parameterºÎºÐÀº À§¿¡¼ Á¤ÀÇÇÏ°í ÀÔ·ÂÇÏ¿´½¿.
System.out.println(jdbcURL);
try
{
// Register the INFORMIX-JDBC driver
Driver IfmxDrv = (Driver) Class.forName("com.informix.jdbc.IfxDriver").newInstance();
// Get a connection to the database server
conn = DriverManager.getConnection(jdbcURL);
//ÀÌ ºÎºÐ¿¡¼ Error°¡ ³ª´Â °Í °°½À´Ï´Ù.
// Populate tables list
Statement tableQueryStmt = conn.createStatement();
ResultSet tableQueryResults = tableQueryStmt.executeQuery("SELECT tabname from systable
s where tabid > 99");
while (tableQueryResults.next())
tablesList.add(tableQueryResults.getString(1));
resultsArea.append("\nDriver loaded...and connection established");
}
catch (Exception e)
{
resultsArea.append("\nError in connecting to the DATABASE for\n" + jdbcURL + "\nPlease
check connection parameters");
System.out.println(e.toString());
}