This discussion is archived
3 Replies Latest reply: Nov 10, 2007 8:14 AM by 807600 RSS

jdbc connection

807600 Newbie
Currently Being Moderated
i tried to run the following code through kawa.


import java.sql.*;
import oracle.jdbc.pool.OracleDataSource;


class JdbcTest {
public static void main (String args []) throws SQLException {
// Create DataSource and connect to the local database
OracleDataSource ods = new OracleDataSource();
ods.setURL("jdbc:oracle:thin:@//appshl.squarehospital.com:1521/shl");
ods.setUser("SHIS2");
ods.setPassword("ringtone");
Connection conn = ods.getConnection();

// Query the employee names
Statement stmt = conn.createStatement ();
ResultSet rset = stmt.executeQuery ("SELECT company_name FROM hpms_standard");
// Print the name out
while (rset.next ())
System.out.println (rset.getString (1));

//close the result set, statement, and the connection
rset.close();
stmt.close();
conn.close();
}
}



output :

C:\Java-Studio1.0\JDK\bin\java.exe JdbcTest
Working Directory - C:\Documents and Settings\akarim\My Documents\practice\
Class Path - D:\OracleDS\jdk\jre\bin;D:\OracleDS\jdk\jre\bin\client;D:\OracleDS\jlib;D:\OracleDS\bin;D:\OracleDS\jre\1.4.1\bin;D:\OracleDS\jre\1.1.8\bin;d:\oracleDS\jdbc\lib\classes12.jar;.;c:\Kawapro5.0\kawaclasses.zip;c:\java-studio1.0\jdk\lib\classes.zip
java.lang.NoClassDefFoundError: javax/naming/Referenceable

     at JdbcTest.main(Compiled Code)

Process Exit...

question : How i can get the values from the query. please help me.
  • 1. Re: jdbc connection
    807600 Newbie
    Currently Being Moderated
    I'm not surprised. JNDI wasn't included with the ancient JDK versions that Kawa used (I think the last version was for Java 1.1?).
  • 2. Re: jdbc connection
    807600 Newbie
    Currently Being Moderated
    I'm assuming the OP is referring to the Kawapro IDE that was abandoned years ago by Allaire, before they merged with Macromedia, before they merged with Adobe, and not the Scheme language clone Kawa.

    My recommendation is to ditch that IDE, use the command line, JEdit, MyEclipse, or Sun Studio Enterprise if you need an IDE. My current choice is MyEclipse although it costs money ($50).

    Also when you post to the forum, please use the code tags, otherwise you code is hard to read and prone to incorrect display if you name index variables i, b, u or code.
  • 3. Re: jdbc connection
    807600 Newbie
    Currently Being Moderated
    pkwooster wrote:
    I'm assuming the OP is referring to the Kawapro IDE that was abandoned years ago by Allaire, before they merged with Macromedia, before they merged with Adobe, and not the Scheme language clone Kawa.
    So did I. I actually hold a license to it (though I no longer have an installer, nor a desire to use it).
    My recommendation is to ditch that IDE, use the command line, JEdit, MyEclipse, or Sun Studio Enterprise if you need an IDE. My current choice is MyEclipse although it costs money ($50).
    My choice is IntelliJ, the $250 price is rapidly earned back through increased productivity and decreased bad vibes.