View Single Post
  #7 (permalink)  
Old 04-02-2008, 02:31 PM
AJG AJG is offline
Member
 
Join Date: Apr 2008
Posts: 7
Rep Power: 0
AJG is on a distinguished road
Default
yeah thats similar to what i have already got:

Code:
    try 
    {
        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    
        String dataSourceName="java";
        String dbURL = "jdbc:odbc:" + dataSourceName;            
        Connection con = DriverManager.getConnection(dbURL,"","");
            
	Statement s = con.createStatement();
	s.execute("SELECT Content FROM content_table");
	ResultSet rs = s.getResultSet(); 

	  if(rs != null);
	 {
	    rs.next();
           {
	     firstrow = rs.getString(1); 
          JTextArea text1 = new JTextArea(firstrow);
            }
                
	     s.close();
	     con.close();
          }
    }
    catch (Exception e) 
        {
            System.out.println("Error: " + e);
        }
However its the text in bold that i wish to use to insert the text into the JTextArea however this compiles but doesn't work, also firstrow is declared as a string at the top of this class
Reply With Quote