Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how do i convert 0x64766972 to dvir  RSS feed

 
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());
}
}
}
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!