hello i am wirting a java/ quizz engine that retrieves data from a database. i got some piece of code from devx.com but unfortunately that has been written to retrieve from xml file. i am witing one to retrieve questions from oracle please help. do you have any idea where i can get source code from?
So you just need help connecting to the database and getting a recordset back? It's quite easy;
//Create a connection to Oracle
Connection connection = DriverManager.getConnection("jdbc:oracle:kprb:");
//Create the statement, can scroll anyway and is updatable
Statement sel = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
//Execute a query and get a resultset.
resultSet = read.executeQuery("SELECT to_char(MIN("+cba_time+"), 'DD/MM/YYYY HH24:MI:SS') as x FROM " + final_table);
//loop while there's still records.
catch (SQLException e)
//It all went wrong
System.out.println("Error! - " + e);