Plugins (1067)


Training and Consulting (40)



EPIC Poll

What is your favourite developer portal?

[ Results | Polls ]

Votes: 539
Comments: 0

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
saalkam
Post subject: How to get the CHAR() FOR BIT DATA column in java  PostPosted: Jun 16, 2005 - 09:05 AM
Guest





Hi,

I am working in a java/ISeries environment and I try to display the informations of the DB2 database.

The prolem is that I have not the value of the columns but an hexa codification. I am using he rs.getString METHOD.

This is my code

try{
// make sure driver exists
Class.forName("com.ibm.as400.access.AS400JDBCDriver");
}catch(Exception e){
System.out.println(e.toString());
}
System.out.println("1. Connection succeed..");
try{
// create a new connection from driver
Connection con = DriverManager.getConnection("jdbc:as400://" + "OEM", "BRT", "TRB");
// create new statement from connection
java.sql.Statement stmt = con.createStatement();
System.out.println("2. create new statement from connection..");
// sql
String sql="SELECT * FROM Library.file FETCH FIRST 10 ROWS ONLY";
ResultSet rs = stmt.executeQuery(sql);
while(rs.next()){
out.println("<tr>" );

out.println("<td>"+rs.getString(1)+"</td>" );
out.println("<td>"+rs.getString(2)+"</td>" );
out.println("<td>"+rs.getString(3)+"</td>" );
out.println("<td>"+rs.getString(4)+"</td>" );
out.println("<td>"+rs.getString(5)+"</td>" );
out.println("</tr>" );
}
and that is the result displayed:

40F5F0F0F9F4404040404040404040 C1 1 0 0
C3C7E2E54040404040404040404040 C1 1 0 0
C3E2E2E54040404040404040404040 C1 1 0 0
C3E4E2E54040404040404040404040 C1 1 0 0
C4D6E2E54040404040404040404040 C1 1 0 0
C8E3E2E54040404040404040404040 C1 1 0 0
D7D3E2E54040404040404040404040 C1 1 0 0
D7D9D6E3D640404040404040404040 C1 1 0 0
D9C5D7D3C1C3C5D4C5D5E340404040 C1 1 0 0
D9D7E2E54040404040404040404040 C1 1 0 0

Can you help me

Thanks
saalkam@gmail.com
 
   
Reply with quote Back to top
Guest
Post subject: Re: How to get the CHAR() FOR BIT DATA column in java  PostPosted: Aug 25, 2005 - 05:28 PM






saalkam wrote:
Hi,

I am working in a java/ISeries environment and I try to display the informations of the DB2 database.

The prolem is that I have not the value of the columns but an hexa codification. I am using he rs.getString METHOD.

This is my code

try{
// make sure driver exists
Class.forName("com.ibm.as400.access.AS400JDBCDriver");
}catch(Exception e){
System.out.println(e.toString());
}
System.out.println("1. Connection succeed..");
try{
// create a new connection from driver
Connection con = DriverManager.getConnection("jdbc:as400://" + "OEM", "BRT", "TRB");
// create new statement from connection
java.sql.Statement stmt = con.createStatement();
System.out.println("2. create new statement from connection..");
// sql
String sql="SELECT * FROM Library.file FETCH FIRST 10 ROWS ONLY";
ResultSet rs = stmt.executeQuery(sql);
while(rs.next()){
out.println("<tr>" );

out.println("<td>"+rs.getString(1)+"</td>" );
out.println("<td>"+rs.getString(2)+"</td>" );
out.println("<td>"+rs.getString(3)+"</td>" );
out.println("<td>"+rs.getString(4)+"</td>" );
out.println("<td>"+rs.getString(5)+"</td>" );
out.println("</tr>" );
}
and that is the result displayed:

40F5F0F0F9F4404040404040404040 C1 1 0 0
C3C7E2E54040404040404040404040 C1 1 0 0
C3E2E2E54040404040404040404040 C1 1 0 0
C3E4E2E54040404040404040404040 C1 1 0 0
C4D6E2E54040404040404040404040 C1 1 0 0
C8E3E2E54040404040404040404040 C1 1 0 0
D7D3E2E54040404040404040404040 C1 1 0 0
D7D9D6E3D640404040404040404040 C1 1 0 0
D9C5D7D3C1C3C5D4C5D5E340404040 C1 1 0 0
D9D7E2E54040404040404040404040 C1 1 0 0

Can you help me

Thanks
saalkam@gmail.com
 
   
Reply with quote Back to top
Guest
Post subject: Re: How to get the CHAR() FOR BIT DATA column in java  PostPosted: Sep 28, 2005 - 02:46 PM






Anonymous wrote:
saalkam wrote:
Hi,

I am working in a java/ISeries environment and I try to display the informations of the DB2 database.

The prolem is that I have not the value of the columns but an hexa codification. I am using he rs.getString METHOD.

This is my code

try{
// make sure driver exists
Class.forName("com.ibm.as400.access.AS400JDBCDriver");
}catch(Exception e){
System.out.println(e.toString());
}
System.out.println("1. Connection succeed..");
try{
// create a new connection from driver
Connection con = DriverManager.getConnection("jdbc:as400://" + "OEM", "BRT", "TRB");
// create new statement from connection
java.sql.Statement stmt = con.createStatement();
System.out.println("2. create new statement from connection..");
// sql
String sql="SELECT * FROM Library.file FETCH FIRST 10 ROWS ONLY";
ResultSet rs = stmt.executeQuery(sql);
while(rs.next()){
out.println("<tr>" );

out.println("<td>"+rs.getString(1)+"</td>" );
out.println("<td>"+rs.getString(2)+"</td>" );
out.println("<td>"+rs.getString(3)+"</td>" );
out.println("<td>"+rs.getString(4)+"</td>" );
out.println("<td>"+rs.getString(5)+"</td>" );
out.println("</tr>" );
}
and that is the result displayed:

40F5F0F0F9F4404040404040404040 C1 1 0 0
C3C7E2E54040404040404040404040 C1 1 0 0
C3E2E2E54040404040404040404040 C1 1 0 0
C3E4E2E54040404040404040404040 C1 1 0 0
C4D6E2E54040404040404040404040 C1 1 0 0
C8E3E2E54040404040404040404040 C1 1 0 0
D7D3E2E54040404040404040404040 C1 1 0 0
D7D9D6E3D640404040404040404040 C1 1 0 0
D9C5D7D3C1C3C5D4C5D5E340404040 C1 1 0 0
D9D7E2E54040404040404040404040 C1 1 0 0

Can you help me

Thanks
saalkam@gmail.com
 
   
Reply with quote Back to top
Guest
Post subject: Re: How to get the CHAR() FOR BIT DATA column in java  PostPosted: Nov 22, 2005 - 09:49 PM






saalkam wrote:
Hi,

I am working in a java/ISeries environment and I try to display the informations of the DB2 database.

The prolem is that I have not the value of the columns but an hexa codification. I am using he rs.getString METHOD.

This is my code

try{
// make sure driver exists
Class.forName("com.ibm.as400.access.AS400JDBCDriver");
}catch(Exception e){
System.out.println(e.toString());
}
System.out.println("1. Connection succeed..");
try{
// create a new connection from driver
Connection con = DriverManager.getConnection("jdbc:as400://" + "OEM", "BRT", "TRB");
// create new statement from connection
java.sql.Statement stmt = con.createStatement();
System.out.println("2. create new statement from connection..");
// sql
String sql="SELECT * FROM Library.file FETCH FIRST 10 ROWS ONLY";
ResultSet rs = stmt.executeQuery(sql);
while(rs.next()){
out.println("<tr>" );

out.println("<td>"+rs.getString(1)+"</td>" );
out.println("<td>"+rs.getString(2)+"</td>" );
out.println("<td>"+rs.getString(3)+"</td>" );
out.println("<td>"+rs.getString(4)+"</td>" );
out.println("<td>"+rs.getString(5)+"</td>" );
out.println("</tr>" );
}
and that is the result displayed:

40F5F0F0F9F4404040404040404040 C1 1 0 0
C3C7E2E54040404040404040404040 C1 1 0 0
C3E2E2E54040404040404040404040 C1 1 0 0
C3E4E2E54040404040404040404040 C1 1 0 0
C4D6E2E54040404040404040404040 C1 1 0 0
C8E3E2E54040404040404040404040 C1 1 0 0
D7D3E2E54040404040404040404040 C1 1 0 0
D7D9D6E3D640404040404040404040 C1 1 0 0
D9C5D7D3C1C3C5D4C5D5E340404040 C1 1 0 0
D9D7E2E54040404040404040404040 C1 1 0 0

Can you help me

Thanks
saalkam@gmail.com
 
   
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits