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