This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how do i convert 0x64766972 to dvir

 
Dorj Galaa
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I read data from Oracle Database
String st2=Result.getString("user_name");
out.println(st2);
but result is
0x64766972 not dir how do i convert?
 
grisha37
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you read things? What is the query? Perhaps
you need to use the number of the field (like getString(3)
instead of the name. It depends...
 
Dorj Galaa
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
import java.sql.*;
import java.io.*;
public class ConnectToOracle
{
public static void main(String args[])
{
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection ("jdbc racle:thin:@serverhost:1521:sid","username","password");
String Query="select province_name from province_info";
PreparedStatement st=conn.prepareStatement(Query);
ResultSet Result=st.executeQuery();
while (Result.next())
{
System.out.println(Result.getString("province_name"));
}
Result.close();
st.close();
conn.close();
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
}
}
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic