SQL (JDBC and JAVA)

Hi
I have have problem in generating a results from my SQL command. Apparently the query run successfully but it fails to oick up the data in the table for display. Please find the code below:-
public class QueryTableModel extends AbstractTableModel {
ScrollingPanelVesDue screenVesDuePanel;
JTextArea output;
String url;
Connection connection;
Vector totalrows;
String[] colheads =
{ " Vessel Ref "," Agent ", " Name of Vessel ", "Arrival Date",
" Rem on Est Date of Arrival" };
public QueryTableModel( Connection dbc, ScrollingPanelVesDue s,
JTextArea o ) {
connection = dbc;
screenVesDuePanel = s;
output = o;
totalrows = new Vector();
//int i
public String getColumnName ( ) {
return colheads [ 5 ]; //i
//set the column number
public int getColumnCount() {
return 5;
//set the row number
public int getRowCount() {
return totalrows.size();
public Object getValueAt ( int row, int col ) {
return ( ( String[] ) totalrows.elementAt( row ) ) [ col ];
//sets the table cells non editable
public boolean isCellEditable ( int row, int col ) {
return false;
public void fire () {
fireTableChanged (null);
//executes query
public void query() {
try {
Statement statement = connection.createStatement( ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_READ_ONLY);
String query = "SELECT Vessel_Ref, Type, Agent, EDA, EstRemarks FROM VesselGeneral " +
"WHERE EDA=" + screenVesDuePanel.F_Date.getText() +
"AND " + screenVesDuePanel.P_Date.getText();
output.append( "\nsending query:\n" +
connection.nativeSQL( query ) + "\n" );
ResultSet rs = statement.executeQuery( query );
totalrows = new Vector();
while ( rs.next () ) {
String[] record = new String[ 5 ];
for ( int i = 0; i < 5; i++ ) {
record[ i ] = rs.getString( i + 2 );
totalrows.addElement( record );
output.append( "\nQuery successful\n" );
statement.close();
catch ( SQLException sqlex ) {
output.append( sqlex.toString() );
I need urgent help
harry

hi dave
Please find all of code as stated as i am seriously finding it tough to solve the problem. Please note that in all i have 21 fields in the table and out of these i am selecting fields 2, 3,4 ,5 and 21 in the criteria of earliest and present dates entered by the user.
CODE
public class QueryVesDue extends JFrame implements ActionListener {
private ScrollingPanelVesDue screenVesDuePanel;
private ScrollingPanelVesGen screenVesGenPanel;
private JTextArea output;
private String url;
private Connection connection;
private JScrollPane jspane;
private Container c;
private QueryTableModel qtbl;
private JTable jtbl;
private boolean firsttime = true;
public QueryVesDue( Connection dbc, ScrollingPanelVesDue s, JTextArea o ) {
super ( "VESSELS DUE IN PORT" );
connection = dbc;
screenVesDuePanel = s;
output = o;
public void actionPerformed ( ActionEvent e ) {
if ( ! screenVesDuePanel.F_Date.getText().equals( "" ) &&
! screenVesDuePanel.P_Date.getText().equals( "" ) ) {
// set up the table GUI
if ( firsttime ) {
c = getContentPane();
c.setLayout( new FlowLayout () );
qtbl = new QueryTableModel ( connection, screenVesDuePanel, output );
qtbl.query();
jtbl = new JTable ( qtbl );
TableColumn tcol = jtbl.getColumnModel().getColumn( 0 );
tcol.setPreferredWidth( 50 );
jspane = new JScrollPane ( jtbl );
c.add( jspane );
setSize(600, 500);
firsttime = false;
else {
qtbl.query();
qtbl.fire();
TableColumn tcol = jtbl.getColumnModel().getColumn( 0 );
tcol.setPreferredWidth ( 150 );
show();
else
output.append( "\n Find data before generating query \n");
public class ScrollingPanelVesDue extends JPanel {
JTextField F_Date, P_Date; // package access
JLabel lF_Date, lP_Date;
public ScrollingPanelVesDue() {
// Label panel
JPanel labelPanel = new JPanel();
labelPanel.setLayout(
new GridLayout( 2, 1, 2, 2 ) ); //labels
lF_Date= new JLabel ( " Enter Earliest Date: " );
labelPanel.add( lF_Date);
lP_Date = new JLabel ( " Enter Due Date: " );
labelPanel.add( lP_Date );
// TextField panel
JPanel screenVesDuePanel = new JPanel();
screenVesDuePanel.setLayout(
new GridLayout( 2, 1 ) );
F_Date = new JTextField( 11 );
F_Date.setText( "dd/mm/yyyy" );
screenVesDuePanel.add( F_Date ).setBackground( Color.orange );
P_Date = new JTextField( 11 );
P_Date.setText( "dd/mm/yyyy" );
screenVesDuePanel.add( P_Date ).setBackground( Color.orange );
//screenVesDuePanel.add( )
//Accessibility section - relate labels and text fields
// for use by assistive technologies
lF_Date.setLabelFor( F_Date );
lP_Date.setLabelFor( P_Date );
setLayout( new GridLayout( 1, 2 ) );
add( labelPanel );
add( screenVesDuePanel );
public class QueryVesDue extends JFrame implements ActionListener {
private ScrollingPanelVesDue screenVesDuePanel;
private ScrollingPanelVesGen screenVesGenPanel;
private JTextArea output;
private String url;
private Connection connection;
private JScrollPane jspane;
private Container c;
private QueryTableModel qtbl;
private JTable jtbl;
private boolean firsttime = true;
public QueryVesDue( Connection dbc, ScrollingPanelVesDue s, JTextArea o ) {
super ( "VESSELS DUE IN PORT" );
connection = dbc;
screenVesDuePanel = s;
output = o;
public void actionPerformed ( ActionEvent e ) {
if ( ! screenVesDuePanel.F_Date.getText().equals( "" ) &&
! screenVesDuePanel.P_Date.getText().equals( "" ) ) {
// set up the table GUI
if ( firsttime ) {
c = getContentPane();
c.setLayout( new FlowLayout () );
qtbl = new QueryTableModel ( connection, screenVesDuePanel, output );
qtbl.query();
jtbl = new JTable ( qtbl );
TableColumn tcol = jtbl.getColumnModel().getColumn( 0 );
tcol.setPreferredWidth( 50 );
jspane = new JScrollPane ( jtbl );
c.add( jspane );
setSize(600, 500);
firsttime = false;
else {
qtbl.query();
qtbl.fire();
TableColumn tcol = jtbl.getColumnModel().getColumn( 0 );
tcol.setPreferredWidth ( 150 );
show();
else
output.append( "\n Find data before generating query \n");
public class QueryTableModel extends AbstractTableModel {
ScrollingPanelVesDue screenVesDuePanel;
JTextArea output;
String url;
Connection connection;
Vector totalrows;
String[] colheads =
{ " Vessel Ref "," Agent ", " Name of Vessel ", "Arrival Date",
" Rem on Est Date of Arrival" };
public QueryTableModel( Connection dbc, ScrollingPanelVesDue s,
JTextArea o ) {
connection = dbc;
screenVesDuePanel = s;
output = o;
totalrows = new Vector();
public String getColumnName ( int i ) {
return colheads [ i ];
//set the column number
public int getColumnCount() {
return 5;
//set the row number
public int getRowCount() {
return totalrows.size();
public Object getValueAt ( int row, int col ) {
return ( ( String[] ) totalrows.elementAt( row ) ) [ col ];
//sets the table cells non editable
public boolean isCellEditable ( int row, int col ) {
return false;
public void fire () {
fireTableChanged (null);
//executes query
public void query() {
try {
Statement statement = connection.createStatement( ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_READ_ONLY);
String query = "SELECT Vessel_Ref, Type, Agent, EDA, EstRemarks FROM VesselGeneral " +
"WHERE EDA BETWEEN " + screenVesDuePanel.F_Date.getText() +
"AND AND EDA " + screenVesDuePanel.P_Date.getText() + "";
output.append( "\nsending query:\n" +
connection.nativeSQL( query ) + "\n" );
ResultSet rs = statement.executeQuery( query );
totalrows = new Vector();
while ( rs.next () ) {
String[] record = new String[ 20 ];
for ( int i = 0; i < 20; i++ ) {
record[i] = rs.getString( i + 2 );
totalrows.addElement( record );
output.append( "\nQuery successful\n" );
statement.close();
catch ( SQLException sqlex ) {
output.append( sqlex.toString() );
PLEASE HELP
HARRY

Similar Messages

  • Import and process larger data with SQL*Loader and Java resource

    Hello,
    I have a project to import data from a text file in a schedule. A lager data, with nearly 20,000 record/1 hours.
    After that, we have to analysis the data, and export the results into a another database.
    I research about SQL*Loader and Java resource to do these task. But I have no experiment about that.
    I'm afraid of the huge data, Oracle could be slowdown or the session in Java Resource application could be timeout.
    Please tell me some advice about the solution.
    Thank you very much.

    With '?' mark i mean " How i can link this COL1 with column in csv file ? "
    Attilio

  • PL/SQL Procedure and Java

    Hi All,
    I am working on a Data Warehousing Product and generating Web Reports.
    These Web Reports are JSPs.
    The basic architechture used for this is :
    1. Get the inputs required for Report Generation through a Web GUI
    2. Validate and Process (If Valid) the inputs so that it can be applied on the Data in the DB to fetch appropriate information.
    3. The Data from the DB is retreived in the form of PL/SQL Procedures, which take the Processed information from Step 2 as Input and give the Output in the form of REF CURSORS.
    Note: There are a many PL/SQL Procedures that are being executed, based on the configuration the Client has set. This configuration enables the Client to set the columns he wants to see in the Web Reports. This configuration is set before the Reports are run.
    4. A call is made from Java to Oracle, each time a PL/SQL Procedure need to be executed. The REF CURSOR received as an Output from the PL/SQL Procedure is processed.
    5. The next PL/SQL Procedure is called (if existing), else the Processed Data (from REF CURSOR Output) is displayed in the JSP as Web Reports.
    The issue with above architechture is the PERFORMANCE.
    I would like to know:
    - The various ways in which data can be EFFICIENTLY & QUICKLY retrieved from PL/SQL Procedure in Java.
    - Are there any APIs that improve the Java-Oracle Data Fetch Efficiency
    - Is there any Java Framework available that can be used to increase the spped of Web Report generation.
    - Do you suggest any changes in the above mentioned architechture, that make this work a Sweet Sixeen Year olg guy! ;)
    - In general, any input that can increase the Speed of Web Report Generation.
    Kindly let me know if I have not been clear at any point, so that I can re-explain the same more clearly.
    And the most important thing, kindly scrap down your thoughts about the same.
    Thanks a lot in advance for your VALUABLE INPUTS.
    - Vikas

    Spring
    http://www.springframework.org/
    http://static.springframework.org/spring/docs/2.0.x/reference/jdbc.html
    http://static.springframework.org/spring/docs/2.0.x/reference/jdbc.html#jdbc-StoredProcedure

  • Java.sql.Date and java.util.Date - class loaded first in the classpath

    I had two jar files which has java.util.Date and java.sql.Date class file. i want to know whether which class is loaded first in the classpath...
    I like to change the order of loading the class at runtime...
    Is there is any way to change the order of loading of class...
    I may have different version of jar files for example xerces,xercesImpl. some of the code uses xerces ,some of the code uses xercesImpl..i had common classes.
    I like to load the class with the same name according to the order i need..
    Can we do all these in Run time ?????

    I had two jar files which has java.util.Date and
    java.sql.Date class file. i want to know whether
    which class is loaded first in the classpath...
    I like to change the order of loading the class at
    runtime...
    Is there is any way to change the order of loading of
    class...
    I may have different version of jar files for example
    xerces,xercesImpl. some of the code uses xerces ,some
    of the code uses xercesImpl..i had common classes.
    I like to load the class with the same name according
    to the order i need..
    Can we do all these in Run time ?????That is meaningless.
    The classes you are referring to are part of the Java API. Third party jars have no impact on that. And you can't change to the order because java.sql.Data is derived from java.util.Date. So the second must load before the first.
    And if you have two jar files with those classes in them (and not classes that use them) then you either should already know how to use them or you should stop trying to do whatever you are doing because it isn't going to work.

  • A silly question about oracle.sql.timestamp and java.sql.timestamp

    Hi,
    I'm looking at a method that takes objects of type Object and does stuff if the object is really a java.sql.timestamp. If it is not then an error is flagged. In my case it flags an error when an object of type oracle.sql.timestamp is passed to it. Not really entirely comfortable with java (i'm still learning it), here's my stupid question :- why isn't oracle.sql.timestamp a subclass of java.sql.timestamp? Also in various books it indicates that java.sql.timestamp maps to oracle.sql.timestamp. Does that mean you have to physically do the mapping:
    i.e.
    java.sql.Timestamp t = new Timestamp( new oracle.sql.Timestamp( CURRENTTIMESTAMP ).timestampValue() );
    or is there something else to it.
    Thanks.
    Harold.

    The best forum for this is probably Forum Home » Java » SQLJ/JDBC
    Presumably you are refering to oracle.sql.TIMESTAMP. While this is intended to (and does) correspond to java.sql.Timestamp it can't be a subclass because it needs to be a subclass of oracle.sql.Datum.

  • Jdbc and java stored procedures

    Hi all,
    I am new to Oracle Java Stored Procedures but I am interested in knowing to which extent is object passing supported.
    Can I send any kind of object to a java stored procedure? And back from the procedure? Anybody knows any good resources online about Java Stored Procedures and JDBC?
    I also saw that to pass the string back you need to specify java.lang.string, how would I do in order to pass back a user defined object, do I have to register the class in Oracle before (and if yes, how?)or is the classpath enough?
    Many thanks,
    A.

    Hi again,
    perhaps I didn't understand exactly what you meant with "publish", AFAIK you have to expose the java class (i.e. RowCounter) by using
    CREATE OR REPLACE FUNCTION row_count (tab_name VARCHAR2) RETURN NUMBER
    AS LANGUAGE JAVA
    NAME 'RowCounter.rowCount(java.lang.String) return int';
    (BTW this works fine)
    or else you cannot access the java class you loaded on the server, and that's where my questions arose. What if I am passing an object, let's say myObject, shouldn't I use the STRUCT mapping then or something like that?
    Or, could you clarify what do you mean by publishing to SQL, I just need to access the class from jdbc, not from PL/SQL or others, but as I understand to call the class from JDBC I need to call the function or procedure that calls the class and then I could call it from PL/SQL as well...
    Thanks,
    A.

  • Error with Sql Server and Java App

    Hi i have a java based multithread application which comunicate with SQL SERVER via DSN bridge , some time my application crashes with this error any idea what its happend and how to remove it .
    Thanks
    ************* Exception ********************************8
    An unexpected exception has been detected in native code outside the VM.
    Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x77F87EEB
    Function=RtlEnterCriticalSection+0xB
    Library=F:\WINNT\system32\ntdll.dll
    Current Java thread:
    at sun.jdbc.odbc.JdbcOdbc.numResultCols(Native Method)
    at sun.jdbc.odbc.JdbcOdbc.SQLNumResultCols(JdbcOdbc.java:4625)
    at sun.jdbc.odbc.JdbcOdbcStatement.getColumnCount(JdbcOdbcStatement.java:1235)
    at sun.jdbc.odbc.JdbcOdbcStatement.execute(JdbcOdbcStatement.java:352)
    - locked <04DC3EE0> (a sun.jdbc.odbc.JdbcOdbcStatement)
    at sun.jdbc.odbc.JdbcOdbcStatement.executeUpdate(JdbcOdbcStatement.java:288)
    at advcomm.advrad.DBParams.Ltht(Unknown Source)
    at advcomm.advrad.DBParams.BDhb(Unknown Source)
    at advcomm.advrad.DlkhlHz.run(Unknown Source)
    Dynamic libraries:
    0x00400000 - 0x00406000 F:\j2sdk1.4.1_03\bin\java.exe
    0x77F80000 - 0x77FFC000 F:\WINNT\system32\ntdll.dll
    0x7C2D0000 - 0x7C335000 F:\WINNT\system32\ADVAPI32.dll
    0x7C570000 - 0x7C623000 F:\WINNT\system32\KERNEL32.dll
    0x77D30000 - 0x77DA8000 F:\WINNT\system32\RPCRT4.dll
    0x78000000 - 0x78045000 F:\WINNT\system32\MSVCRT.dll
    0x75030000 - 0x75044000 F:\WINNT\system32\WS2_32.DLL
    0x75020000 - 0x75028000 F:\WINNT\system32\WS2HELP.DLL
    0x6D340000 - 0x6D46B000 F:\j2sdk1.4.1_03\jre\bin\client\jvm.dll
    0x77E10000 - 0x77E79000 F:\WINNT\system32\USER32.dll
    0x77F40000 - 0x77F7C000 F:\WINNT\system32\GDI32.dll
    0x77570000 - 0x775A0000 F:\WINNT\system32\WINMM.dll
    0x6D1E0000 - 0x6D1E7000 F:\j2sdk1.4.1_03\jre\bin\hpi.dll
    0x6D310000 - 0x6D31E000 F:\j2sdk1.4.1_03\jre\bin\verify.dll
    0x6D220000 - 0x6D239000 F:\j2sdk1.4.1_03\jre\bin\java.dll
    0x6D330000 - 0x6D33D000 F:\j2sdk1.4.1_03\jre\bin\zip.dll
    0x6D260000 - 0x6D26B000 F:\j2sdk1.4.1_03\jre\bin\JdbcOdbc.dll
    0x1F7A0000 - 0x1F7DA000 F:\WINNT\system32\ODBC32.dll
    0x71710000 - 0x71794000 F:\WINNT\system32\COMCTL32.dll
    0x7CF30000 - 0x7D175000 F:\WINNT\system32\SHELL32.dll
    0x70A70000 - 0x70AD6000 F:\WINNT\system32\SHLWAPI.dll
    0x76B30000 - 0x76B6E000 F:\WINNT\system32\comdlg32.dll
    0x1F840000 - 0x1F857000 F:\WINNT\system32\odbcint.dll
    0x1F9C0000 - 0x1FA27000 F:\WINNT\System32\SQLSRV32.dll
    0x41090000 - 0x410BD000 F:\WINNT\System32\SQLUNIRL.dll
    0x77800000 - 0x7781E000 F:\WINNT\System32\WINSPOOL.DRV
    0x76620000 - 0x76631000 F:\WINNT\system32\MPR.DLL
    0x77820000 - 0x77827000 F:\WINNT\system32\VERSION.dll
    0x759B0000 - 0x759B6000 F:\WINNT\system32\LZ32.DLL
    0x779B0000 - 0x77A4B000 F:\WINNT\system32\OLEAUT32.dll
    0x7CE20000 - 0x7CF0F000 F:\WINNT\system32\ole32.dll
    0x7CDC0000 - 0x7CE13000 F:\WINNT\System32\NETAPI32.dll
    0x77980000 - 0x779A4000 F:\WINNT\System32\DNSAPI.dll
    0x75050000 - 0x75058000 F:\WINNT\System32\WSOCK32.dll
    0x751C0000 - 0x751C6000 F:\WINNT\System32\NETRAP.dll
    0x77BF0000 - 0x77C01000 F:\WINNT\System32\NTDSAPI.dll
    0x77950000 - 0x7797B000 F:\WINNT\system32\WLDAP32.DLL
    0x7C340000 - 0x7C34F000 F:\WINNT\System32\SECUR32.DLL
    0x75150000 - 0x75160000 F:\WINNT\System32\SAMLIB.dll
    0x769A0000 - 0x769A7000 F:\WINNT\system32\NDDEAPI.DLL
    0x1FA30000 - 0x1FA46000 F:\WINNT\System32\sqlsrv32.rll
    0x1F7F0000 - 0x1F80A000 F:\WINNT\system32\odbccp32.dll
    0x74CB0000 - 0x74CCA000 F:\WINNT\system32\DBNETLIB.DLL
    0x75500000 - 0x75504000 F:\WINNT\system32\security.dll
    0x782D0000 - 0x782F2000 F:\WINNT\system32\msv1_0.dll
    0x7C740000 - 0x7C7CC000 F:\WINNT\system32\CRYPT32.dll
    0x77430000 - 0x77441000 F:\WINNT\system32\MSASN1.dll
    0x77340000 - 0x77353000 F:\WINNT\system32\iphlpapi.dll
    0x77520000 - 0x77525000 F:\WINNT\system32\ICMP.DLL
    0x77320000 - 0x77337000 F:\WINNT\system32\MPRAPI.DLL
    0x773B0000 - 0x773DF000 F:\WINNT\system32\ACTIVEDS.DLL
    0x77380000 - 0x773A3000 F:\WINNT\system32\ADSLDPC.DLL
    0x77830000 - 0x7783E000 F:\WINNT\system32\RTUTILS.DLL
    0x77880000 - 0x7790E000 F:\WINNT\system32\SETUPAPI.DLL
    0x7C0F0000 - 0x7C154000 F:\WINNT\system32\USERENV.DLL
    0x774E0000 - 0x77514000 F:\WINNT\system32\RASAPI32.DLL
    0x774C0000 - 0x774D1000 F:\WINNT\system32\rasman.dll
    0x77530000 - 0x77552000 F:\WINNT\system32\TAPI32.dll
    0x77360000 - 0x77379000 F:\WINNT\system32\DHCPCSVC.DLL
    0x74CD0000 - 0x74CD8000 F:\WINNT\system32\DBmsLPCn.dll
    0x0B990000 - 0x0B9E6000 F:\WINNT\system32\MSVCR71.dll
    0x6D2E0000 - 0x6D2EE000 F:\j2sdk1.4.1_03\jre\bin\net.dll
    0x782C0000 - 0x782CC000 F:\WINNT\System32\rnr20.dll
    0x777E0000 - 0x777E8000 F:\WINNT\System32\winrnr.dll
    0x777F0000 - 0x777F5000 F:\WINNT\system32\rasadhlp.dll
    0x74FD0000 - 0x74FEE000 F:\WINNT\system32\msafd.dll
    0x75010000 - 0x75017000 F:\WINNT\System32\wshtcpip.dll
    0x77920000 - 0x77943000 F:\WINNT\system32\imagehlp.dll
    0x72A00000 - 0x72A2D000 F:\WINNT\system32\DBGHELP.dll
    0x690A0000 - 0x690AB000 F:\WINNT\system32\PSAPI.DLL
    Local Time = Wed Mar 08 17:24:41 2006
    Elapsed Time = 9294
    # The exception above was detected in native code outside the VM
    # Java VM: Java HotSpot(TM) Client VM (1.4.1_03-b02 mixed mode)
    #

    I'm having the same problem.
    One potential solutions is to use a custom SQL server JDBC driver instead of going through the ODBC bridge. This will minimize dependencies and should also improved performance. Hope this helps.
    - Joe

  • SQL Server and Java problem

    Hi,
    I am having a problem using Java and JDBC talking to a SQL Server database. On a new record or on an existing record the record will not update if someone types into a text field. If they don't type into that field it will insert the record just fine. The field is defined Text with a size of 16 in the database. In Java the variable is defined string. The error is Runtime Error 129, Record Not Updated. Is there a list of the explanations of the error messages and why they might be caused somewhere? Do you think the size of the field is what the problem is? Or is it the field type? Thanks for any help.

    I would try varchar(16). It may be the database is tryin to enforce that all strings be 16 characters and refusing to update if they're not.

  • SQL Injection and Java Regular Expression: How to match words?

    Dear friends,
    I am handling sql injection attack to our application with java regular expression. I used it to match that if there are malicious characters or key words injected into the parameter value.
    The denied characters and key words can be " ' ", " ; ", "insert", "delete" and so on. The expression I write is String pattern_str="('|;|insert|delete)+".
    I know it is not correct. It could not be used to only match the whole word insert or delete. Each character in the two words can be matched and it is not what I want. Do you have any idea to only match the whole word?
    Thanks,
    Ricky
    Edited by: Ricky Ru on 28/04/2011 02:29

    Avoid dynamic sql, avoid string concatenation and use bind variables and the risk is negligible.

  • SQL Developer and Java GUI problems

    I am having a problem with all the java apps i use, including Oracle SQL Developer. When i load up SQL developer, the top of the "Connections" text is chopped off as well as all the table names in the list when I make a connection. Also the java buttons are rather large. Almost as if they have a carriage return in the text of the button.
    Its seems the gui configuration for java has been corrupted, but i cannot find where to modify those settings. I cant find anything on the internet on this. I have checked my video card settings and modified them to see if that is the issue, but it doesnt fix the problem.
    Since other java apps do the same thing, I know its a java issue, but Ive uninstalled all the JRE's and JDKs i have and reinstalled them, and I still have the problem.
    Im on an Windows XP box and running the JDK and JRE 1.5.0_09 versions. Any help would be appreciated. its very annoying to not be able to read some of the text in the java apps including sql developer due to the tops being cut off.
    I have an ATI RADEON 7000 on an DELL optiplex gx620.
    any help would be appreciated

    The first thing to try, if you haven't already, is to update your video driver.

  • SQL Loader and Java

    Hi,
    I am using a Java Stored Procedure to invoke a SQL Loader process. The RDBMS Version is 8.1.7 on HP-UX 11. I invoke the procedure by calling: exec runcommand('sqlldr user=scott/tiger@orcl control=/home/mydir/ctlfile.ctl log=/home/mydir/logfile.log direct=true errors=550')
    where runcommand is the name of the java stored procedure.
    The SQL Loader process returns a value of 3 which is the return value for an Operating System Error. I am unable to find any errors related to the Operating System. Is there any particular environment variable which needs to be set before running the process.
    I was able to run the same Java Stored Procedure on Personal Oracle on Windows XP without any problems.
    TIA,
    Ramesh

    Hi,
    Make sure that the path for data file in control file is correct.
    Then it serves your purpose.
    Otherwise, give full path to "sqlldr", then run it.
    Please let me know the result.
    Thanks
    Srinivasa Rao

  • Help with sql statements and Java

    Hi,
    How can I create a string kind of like this
    Select * From Students Where Name Like "Bob Burns";
    As the sql statement might indicate I am using MS Access. I seem to be having problems with the double quotes required by the Like operator in MS Access, Java views that as a beginning of a string as oppposed to an actual string value.

    Like this:
        Connection connection = null;
        PreparedStatement stmt = null;
        ResultSet res = null;
        try  {
            connection = ...get from connection pool...;
            String sql = "select ... from ... where name like ?";
            stmt = connection.prepareStatement(sql);
            stmt.setObject(1, "%Bob%", java.sql.Types.VARCHAR);
            res = stmt.executeQuery();
            while (res.next()) { ...the usual...; }
        } finally {
            ...close res, stmt & return connection to pool...
        }You can try stmt.setString() instead of setObject() but rumor has it that some mssql drivers have a bug that makes setString() not work with "like", but oddly enough setObject() works.

  • SQL Dates and JAVA

    Hi All,
    Firstly I am a complete newbie with java code so apologies in advance!! To cut a long story short I have inherited a java app which is of great importance to the company I am working for - in fact its of such importance that the creator saw no reason to document any of its usage - apparently it ran for several years before falling over by which time its author had long gone! - at that point it had to be ported over to new hardware.
    Basically the app consists of javascript running from within Tomcat - the data is then dumped into a mysql database.
    I have managed to get it working again...except for the date -
    the user enters the date in the form eg 04/07/2007 and this is then (or should be ) entered into the database in the format yyyy-MM-dd
    Now , when I start mysql up with logging I can see that the insert statement is completing except for the date (which is left as 0000-00-00). It is attempting to enter the date in the following format.
    #2006-07-04#
    it seems to be the '#' thats screwing it up. If i enter the insert statement manually without the '#' everything is fine. So question is why is this happening and how do I change it.
    The last pice of code before the insert is attempted is
    stmta.executeUpdate(qry.toString())
    I suppose that the toString gives a string representation of the date - I have got myself a java CBT which I am working through :) but I hoped one of you guys would be able to point me in the right direction in the meantime
    Many Thanks

    yes - I have been through it I think the relevant code is this
    rdate = request.getParameter("rdate")
    String ndateissued = request.getParameter("ndateissued");
    if (ndateissued == null) {
    ndateissued = "";
    myformat = new SimpleDateFormat("dd/MM/yyyy");
    Date issueddate = null
    String rdate1 = rdate.substring(8,10) + "/" + rdate.substring(5,7) + "/" + rdate.substring(0,4);
    //String rdate1 = rdate.substring(5,7) + "/" + rdate.substring(8,10) + "/" + rdate.substring(0,4);
    Date rdate2 = myformat.parse(rdate1);
    try {
    if (ndateissued.length() > 0) {
    issueddate = myformat.parse(ndateissued);
    if (issueddate.getTime() < rdate2.getTime()) {
    %> <CENTER><FORM><TABLE>
    <tr><td>Date issued < Date Recei
    ved?????</td></tr>
    </TABLE></FORM></CENTER>
    <%
    return;
    return;
    if (((issueddate.getTime() - rdate2.getTime()) / 3600000) > 2400 ) {
    %> <CENTER><FORM><TABLE>
    <tr><td>Date issued > Date Received + 100 days ?????</td></tr>
    </TABLE></FORM></CENTER>
    <%
    return;
    dstring = myformat.format(issueddate);
    if (!dstring.equals(ndateissued)) {
    %> <CENTER><FORM><TABLE>
    <tr><td>Date issued - out of range</td></tr>
    </TABLE></FORM></CENTER>
    <%
    return;
    ndateissued = ndateissued.substring(6,10) + "-" + ndateissued.substring(3,5) + "-" + ndateissued.substring(0,2);
    } catch (Exception e) {
    %> <CENTER><FORM><TABLE>
    <tr><td>Date issued- parsing error</td></tr>
    </TABLE></FORM></CENTER>
    <%
    return;
    Calendar cal = Calendar.getInstance();
    cal.setTime(rdate2);
    String xdow = cal.get(Calendar.DAY_OF_WEEK) + "";
    directtly after this is the code referencing the insert statement.
    Many Thanks

  • Problems with SQL*Loader and java Runtime

    Hi. I'm trying to start SQL*Loader on Oracle 8 by using Runtime class in this way:
    try{
    Process p = Runtime.getRuntime().exec( "c:\oracle\ora81\bin\sqlldr.exe parfile=c:\parfile\carica.par" );
    /*If i insert this line my application never stops*/
    p.waitFor();
    }catch( Exception e ){
    . I have seen that if lines to insert are less then 400 all works very fine, but if lines number is greater than 400, all data go in my tables but my log file is opened always in writing.Can anyone tell me why?
    Thanks

    Just a note if the executable "sqlldr.exe" does not stop (quit running) by itself the p.waitFor() will wait for ever.

  • Serverlets, JSP and Java Web Start

    Hi As I have heard J2EE is used for serverlet's and JSP programming But JSP and Serverlet programming can be created and implemented using java web start which comes with J2SE what then is the difference between J2EE and J2SE

    Clarification:
    J2EE has an additional E in it, while J2SE as an additional S.
    Ok, now that we cleared that up, Lets see if I can answer your question.
    There is no magic button such as 'java web start' that will automatically generate computer code for you. You have to write java line by line and debug each and every line of code. A typical whole project may consist up up to 1500 functions (mine has over 12000). You read whole books on the subject as I discuss below and work through thier examples. Within about 2 or 3 years of hard study, you should be a pretty good programmer.
    Java is an object oriented language that you'll need to become familiar with that takes some practice to learn. Also, a java based web site consists of several technologies in addition to the java language that you'll need to be familiar with. Many programmers will read articles on the internet and pick up fragments of information on these various technologies and throw a web site together thats impossible to maintain and enhance. I think it would be better if you read whole books and experiment with the technologies. Consider it an at-come college course. Here is my suggested reading list read in roughly this order ( I suggest buying them one at a time via the internet (its cheaper) before moving onto the next book).
    "Thinking In Java" - Bruce Eckel
    HTML & XHTML: The Definitive Guide
    JavaServer Pages - Hans Bergsten
    Programming Jakarta Struts
    JavaScript: The Definitive Guide
    SAMs Teach Yourself SQL
    JDBC and Java
    Also, visit the Web Tools Platform (WTP) Project (www.eclipse.org/webtools) . Its a free Eclipse Java development tool that has the bulk of the java development IDE market (above even JBuilder).However, I suggest creating a few small java programs using the dos command line before you let this IDE do a lot of the work for you. You also might want to install some type of database (Oracle Lite, MySql, etc) on your computer so you have a database to play with (you'll need a computer with at least 2Gbytes of memory).

Maybe you are looking for

  • Stock Transfer Order Report

    Hi,      How to develop a Stock Transfer Order report. I also want to track the cost of transfer from one plant to another. Plz help.

  • Image Resizing : CSS vs jQuery (which is best?)

    I need your opinions. I am using two different methods to size down an image to fit viewport. CSS: http://www.vilverset.com/css.php JQUERY: http://www.vilverset.com/vali.php The CSS version simply tells an IMG to occuppy 100% of the surrounding DIV.

  • Syncing iPod with iTunes with greater file size than iPod capacity

    Hi, My wife has a large iTunes library. It is composed of a large number of mpg files converted from CDs. Many of the songs she doesn't care to have on her iPod, they merely came with the CD. The iTunes Library has grown so large that there are more

  • OEM Part 2

    hi dear, I want to upgrade my OMS server 10.2.0.1 to 10.2.0.5 I downloaded the patch 10.2.0.5 and read the README.txt Part of the README is: 1.2 Enter the following command to extract the installation files: $ unzip GridControl_10.2.0.5_<platform nam

  • JRE 1.4 to 1.6 - Migration Question

    Thank you for reading this post and attempting to help me. I am being tasked with a project to migrate a application that was developed on JDK 1.4 to JDK 1.6, the application is not going to go through any functional change. I went about upgrading my