"Omar Vazquez" <oj**@productosmavi.com> wrote in message
news:31*************************@posting.google.co m...
i'm trying to get the time with a store procedure but i don't nkow how
to do it. can someone help me?? tanks in advance.
If you are talking about the current clock time and if this is a Java stored
procedure, the following code will work, assuming you have already
instantiated your connection, which is called parmConn in this example:
ResultSet rs = null;
Statement stmt = null;
/* Get the current time. */
try {
String query = "Values(current time)";
stmt = parmConn.createStatement();
rs = stmt.executeQuery(query);
System.out.println("");
System.out.print(query + ": ");
while (rs.next()) {
System.out.print(rs.getTime(1)); //display time
System.out.println("");
}
stmt.close();
rs.close();
}
catch (SQLException sql_excp) {
sql_excp.printStackTrace();
}
The output I got when I ran it was:
Values(current time): 11:45:38
Rhino