Column not found
I have a database called dbuild and a table called news
with sample entries added by the DB_News.java So I have managed to communicate to the MySQL database and do stuff.
Here is my new problem when I try and get "article" which is a "TEXT" data format. It says the column is there. BUT IT IS!!!
news_id = getnews_id();
dbhandler.newSession();
String sql = "select * from news where id = '"+news_id+"'";
rs = dbhandler.doQuery(sql);
headingTextField.setText(rs.getString("heading"));<-- This works
contentTextArea.setText(rs.getString("article")); <-- This does work
dbhandler.closeSession();
Here is the Table details
+---------+----------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------+----------------+------+-----+---------+----------------+
| n_id | mediumint(9) | | PRI | NULL | auto_increment |
| heading | varchar(255) | | | | |
| article | text | | MUL | | |
+---------+----------------+------+-----+---------+----------------+
I'm thinking it's because the TEXT format does not work with rs.getString(String colname), I did try using the numbers like rs.getString(2); but it fails too!
The Driver I'm using is mysql-connector-java-3.1.11-bin. I compiled my owned and it came to 7MB (Probably used a lesser compression). I tried using the binary driver MySQL gives and that don't work either.
Tried the latest driver mysql-connector-java-3.1.12 that dont work :P BA
Any help much apperciated
z0man
Edited 5 time(s). Last edit at 01/30/2006 12:21PM by Paul Burden.
Subject
Written By
Posted
Column not found
January 30, 2006 11:48AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.