jdbc 2 « SQL « Java Database Q&A





2. SQL Question    coderanch.com

thanks dana I am using oracle 8i the result is something like: TYPE_ID USER_NAME 1..........A 1..........B 1..........D 2..........A while I would like to have the result like: when the typeID = 1: TYPE_ID USER_NAME 1..........A 1..........B 1..........D null.......C null.......E null.......F but it doesn't work after i put in the condition type id = 1. Any suggestion? Thank so much

3. Generate Xquery from SQL    coderanch.com

4. Problem with SQL uqery or DSN    coderanch.com

Hi, I am using two different DSN for two different tables, thats my requirement. How can I insert a value of table1 into table2 without changing another cloumns values. RateInfo First DSN) name address city xxx yyy zzz aaa bbb uuu UserInfo: (Second DSN) name address city fff iii hhh ddd Finally the table would be look like name address city ...

6. SQL    coderanch.com

7. java.sql.Type to java type mapping    coderanch.com

I don't believe that such a thing exists. The best you can do is look at the "java.sql.Types" API to see what's defined there. One of the difficulties in doing the mapping you propose is that there might not be one--and only one--way to map. For example, if something is "Numeric" in the database, should that to map to an "int", ...

8. SQL trace logs    coderanch.com

9. How do you indent SQL?    coderanch.com

Not to start a holy war or anything, but is there any published guideline on how to indent SQL so it is easier to read? Mainly I'm interested in SELECT statements, but the other stuff would be nice too. I'm interested in the whole thing: indenting, whether keywords should be in upper or lower case, whether to indent with tabs or ...





10. A small Sql Question    coderanch.com

i am trying to insert data into sql database and the data comes from a file and gets transferred directly to the database. the problem is that one of my fields is to collect pathnames. now whenever the data reaches the databases the slashes are gone for ex if the path in the datafile is like \\rhino\users\vol1\sim then in the database ...

11. A little SQL help with SUM()    coderanch.com

Hi guys, I have query with a sum() in it, on a DB2 7.0 box. One of my sum() records returns a null because there are no values to add, but I want it to send back a zero so that it gets printed on a report. I tired using CASE WHEN to catch the null and print the '0' but ...

12. help in sql    coderanch.com

13. CONTAINS keyword in SQL    coderanch.com

14. get picture using sql    coderanch.com

Hi, I'm designing the system. So for each user's data appear , the user's picture also appear. let say John's data appear, so john's picture will appear, if Mary's data appear then Mary's picture will appear. I have no idea for that. Can anybody help me, some sample coding will help a lot! Thank u...

15. Stored Proc w/dynamic sql    coderanch.com

Is it a good to write a store procedure using dynamic sql? What in ways could I optimize this SP that uses dynamic sql? The tables will contain several million rows and I need to return only 20 rows at a time. ------------------ CallableStatement cstmt = con.prepareCall("{call dbo.rc(?,?,?,?,?,?,?)}"); cstmt.setString(1,Fieldnames); cstmt.setString(2,TableName); cstmt.setString(3,PrimaryKey); cstmt.setString(4,SortField); cstmt.setInt(5,PageSize); cstmt.setInt(6,currentPage); cstmt.setString(7,QueryFilter); cstmt.execute(); ------- CREATE PROCEDURE dbo.rc @Fieldnames ...

16. SQL help!    coderanch.com

There were no errors as such when I used my original statement- the only thing was that the table wasn't being displayed and thus suggesting that it had not been connected to but after I tried the ammendments (as mentioned in earlier reply) the table was displayed. I am using Access Databases.





17. SQL Stmt not working in Java App %    coderanch.com

Howdy Lisa, You 're not incidently querying a DATE column, are you? Wouldn't be surprised to see the VARCHAR syntax not working on those, would I! More in general: don't forget telling us what kind of database you are using. Makes it so much easier to answer. For myself, I can easily rope in the Oracle loose ends, but when you ...

18. SQL stmt Not working    coderanch.com

19. Counting the number of numbers in SQL    coderanch.com

I have two tables, one contains a list of subject areas and another which has these subjects allocated to it. The problem I have is I need to find out which subject area has the most courses allocated to it. I am attempting to count how many times each subjectID appears in the course table and then print the name of ...

20. SQL Problem    coderanch.com

This is a SQL not a java problem, if someone could point me towards a SQL website similar to this i would be happy or if you can solve this problem I would be even happier. I have two tables EMPLOYEE and WORKING, I want to display all employees mot working. I use the folling SQL Code> select emp.employeeID, emp.name from ...

21. SQL Problem    coderanch.com

Hi, I have 2 tables, Attendee and Client_Company, and I need to display all client_companies with less than 2 female attendees. I can get the companies with 1 female to display but am stuck on how to also show those with no females. Heres what I have so far select compname from client_company, attendee where attendee.company_id = client_company.company_ID (+) and gender ...

22. Another SQL problem...    coderanch.com

I have an instructor table where each instructor has a unique ins_id, there is also a mentor_id column which allows instructors to mentor other instructors. This is show by having the ins_id of the mentoring instructor in the mentor_id column sort of like: ins_ID Mentor_ID 1 - 2 - 3 2 4 2 5 3 The problem is I need to ...

23. Some SQL help please    coderanch.com

Hello, im fairly new to SQL and believe it or not I have a problem. Im trying to update the first character value of each field in a column. e.g. "AZZZ999" would become "BZZZ999" the lengths of field value change. I would appreciate any help with this. In the end I want to put this into Java (using JDBC), but for ...

24. Decreasing numbers in SQL    coderanch.com

Hello! What I'm trying to do at the moment is have a query which finds the appropriate record of a particulat product in the STOCK table and then decrement that quantity by 1. However, I'm not sure ntirely how to do this, as I know how to change the number by specifying one but I'm not sure how to minus the ...

25. Microsoft SQL    coderanch.com

Okay now I am asking this because no one in the building has a clue. I have a stored proceedure that connects to another database using OPENDATASOURCE. Now it had been working for 5 months and all of the sudden stopped. Now it is showing the following: Server: Msg 18, Level 16, State 1, Line 1 Now I checked with the ...

26. sql Limit    coderanch.com

hi I have some problem with mysql sql statement. When i use the limit sql function it just gets the whole records starting instead of traversing it. Example "select * from MOD1 limit 140,160"; output 160 records instead of from record number 140 till 160. Am i making any mistake here? Does limit really function this way?

27. SQL question?    coderanch.com

28. sql querry    coderanch.com

Hi, I have a staff table like this: name year salary ============================ a 1998 50 a 1999 100 a 2000 200 a 2001 300 b 2000 200 b 2001 300 I want to get a new table from the above table: name salary(1998) salary(1999) salary(2000) salary(2001) =================================================================== a 50 100 200 300 b 0 0 200 300 NB-no of years may ...

29. Java&sql mystical problem with Switch    coderanch.com

First, I am sorry about my broken English. I have created simple project manager software with MySql and Java and I got this little problem. my problem: : java.sql.SQLException: No row count was produced -so there is something wrong in my code, but I cant find out what is wrong If I do those sql-clauses without switch they work. This is ...

30. Big SQL    coderanch.com

Hi Pranit, I would recommend laying the query out in the Java source as you would if it was specified in a SQL script or stored procedure. I've adapted it to my style below (well, not quite). I find it helpful to distinguish between keywords and tables/columns using upper/lower case. The neat little column of plusses is rather sad, but a ...

31. sql problems    coderanch.com

32. sql doubt    coderanch.com

33. Run dynamic sql in stored procedure problem    coderanch.com

Hi Can somebody tell me whats wrong to my stored procedure (Oracle 8i)? I want to run a dynamic SQL select stmt in my SP which returns set of records as output parameter to my java program. I am getting the following error: 8/1 PL/SQL: Statement ignored 13/6 PLS-00597: expression 'RS' in the INTO list is of wrong type ------------------------------------------------------------------------ CREATE ...

34. simple SQL question    coderanch.com

I have 2 tables TABLE A ID PRICE DATE_OF_DATE countrycode TABLE B countrycode exchange_rate I used the code: CREATE TABLE ALL as select a.ID, a.price, b.exchange_rate, a.a.DATE_OF_DATA from TABLEA a, TABLEB b where a.DATE_OF_DATA = b.DATE_OF_DATA and a.countrycode = b.countrycode order by a.barra_id, a.DATE_OF_DATA; RUN; It's giving me 2 entried for every ID and DATE i.e. ID price exchange Date A ...

35. Generating XML from SQL    coderanch.com

I'd like to generate an XML document from a SQL query. Is there a tool that do it easily? How should I do it? 1st step: retrieve the data .... conn = getConnection(); query = "SELECT * FROM CLIENT"; stmt = conn.createStatement(); rs = stmt.executeQuery(query); .... 2nd step: generate the XML file I have no idea how to do it. I ...

36. sql question    coderanch.com

Hi all, I have this sql statement SELECT count(*) as svcvol,sum(Amt) as svcsum,Status,Service,Compcode from SCTABLE where Status='00' GROUP BY Service The problem is if there is no result matches it returns nothing. I want to display something even though there is nothing like displaying the compcode and the count is 0 and the sum is 0 and so on. Is this ...

37. SQL    coderanch.com

you can just get the year and divide it by 4. if you get the reminder it means the year is not a leap year, else it is. i think we have a function called mod(). you can use it to in order to get the reminder. any particular function. sorry i dont know. may be someone else.

38. SQL Help Please    coderanch.com

I am having a hard time figuring out a query for the following: I have 2 tables. employee_table --------- id firstname lastname email user_table -------- id password role Ok, A user is an Employee. So I didn't want to duplicate all the info in both tables. So what I need is a query that will get the row in the employee_table ...

39. OK here's a daft SQL problem for you...    coderanch.com

OK second post of the day. Got my DB working and got my JSPs displaying and removing and inserting data, etc... But! Noticed a problem in the code. If in and of the text firlds I put a ' or " symbol, it kills the SQL. I know this is because the query string is just that, a string (in Java/JSP); ...

40. subquery in transact sql    coderanch.com

hi all, ok..ere's what the problem is. i am using a subquery to select multiple rows in a table, take a specific field out of them, and sum them up, and return the result (which should be one float value) to a field in a temp table in a stored proc. when i run the subquery by itself, using the same ...

41. (IN) PREDICATE in sql    coderanch.com

I have a SQL statement which uses in predicate . In the in clause I am having around 500 products list like: select * fro Product where prodict_id in (1,2,3,4....) The list of product_id are selected from list on jsp page. Can you suggest the performance issues related to using a query with in predicate and 500 items in the in ...

42. SQL question (not JDBC)    coderanch.com

Hey! Hope someone can help me with a little SQL problem that I have.. Two tables... A and B. A has one field called nick which also exists in B. B also has another field (status) which is an enum. Not every nick that exists in A exists in B. I want to extract all nicks from A WITHOUT the ones ...

43. Yes/No SQL Quieries    coderanch.com

Hi Peter, Some of my projects using Oracle database. And we usually use Number(1) as boolean field. We store that value with '1' for true and '0' for false. We also retrieve that value, and change into boolean value in the value object. Correct me if i am wrong Hope this help daniel

44. quick SQL help please    coderanch.com

I am getting the error "Identifier or Quoted Identifier Expected" when i try to execute this in my code, however it works fine in SQL Plus or SQL Worksheet. What am I missing? SELECT DISTINCT matrix_list.sample_type FROM (SELECT DISTINCT s1.sample_type FROM lims_sys.sample_user su1, lims_sys.sample s1, lims_sys.sdg_user sdgu1 WHERE sdgu1.SDG_ID = s1.SDG_ID AND s1.sample_id = su1.sample_id and s1.status <> 'X' AND s1.sample_type ...

45. SQL Jobs    coderanch.com

Arjun, That information is usually stored in the data dictionary, so you simply need to query the data dictionary. Of-course, data dictionaries are not standard across different DBMS's, nor across different versions of the same DBMS, so if you want a more detailed answer, you need to provide a more detailed question -- like what is your definition of a "SQL ...

47. sql problem    coderanch.com

public String showOrder( String ono ) throws Exception { StringBuffer b = new StringBuffer(); b.append( "

" + "" ); String qty = ""; String partno = ""; rs = statement.executeQuery( "SELECT * FROM LINEITEM WHERE ORDER_NUMBER = '" + ono + "'" ); while( rs.next() ) { partno = rs.getString( "PART_NUMBER"); qty = rs.getString( "QTY" ...

48. Keeping SQL Out of Code    coderanch.com

49. SQL Question    coderanch.com

Hi all, I'm new to sql and need some help. I'm trying to subtract the difference between two timestamps in an oracle DB, then find average of the time difference. Heres what I've come up with so far: SELECT SUBSTR(start,1,30) "Time1", SUBSTR(end,1,30) "Time2", SUBSTR((end - start),1,30) "difference", AVG(SUBSTR((end - start),1,30)) AS AvgTime FROM AUDIT_TIME; This does not work because: I think ...

51. SQL Count    coderanch.com

select count(*) , message_code from error_messages group by message_code Read up on how count() and group by work. (Some versions of SQL may allow you to omit the group by section in this particular query, but most versions require it.) My proposed query is based on some assumptions about what you trying to do. Correct me if I'm wrong. I have ...

52. Getting the "Most Recent" Record via SQL    coderanch.com

Hi all, I've run across a SQL statement that I need to write and, in order to get it working, I'm going to have to accomplish something I've never tried before. I'm hoping there's some simple SQL keyword that will help me out. Hopefully, someone here knows a simple solution. Anyway, here's the basis of the problem - I'll try to ...

53. problems with SQL    coderanch.com

The problems is in the databases have a different types. The original database is declared as an integer but I was change as a text. The declaration of Matrik: Vector matrik = new Vector(9000,1); The source code: try { String query = "SELECT Distinct Matrik FROM AmbilKursus "; ResultSet rs = stmt.executeQuery(query); String dat; while (rs.next()) { dat = rs.getString("Matrik"); if ...

54. Any Quick go through tutorial on SQL    coderanch.com

55. Duplicate recs in SQL    coderanch.com

Just wondering if there is a SQL guru out there that might be able to help. I have a SQL statement that is roughly. SELECT 'several columns one column has sum' FROM 'many tables with inner joins' (T312.CODE IN ('EINA','EINE','EINV')) 'some more inner joins' GROUP BY 'same columns as in select' The problem is the codes (EINA, EINE, and EINV) are ...

56. SQL Job    coderanch.com

57. SQL Question    coderanch.com

Guys, Please help with the following scenario: I have a Java Program that will make an executeQuery for an SQL statement, but this query is actually quite hard to formulate: I have 6 database tables: Person, Person_History, Address, Address_history, Preferences and Preferences_history. The primary key for Person and Person_hist is record_number and all other tables are linked by record_number as foreign ...

58. Sql Where clause and/or issues    coderanch.com

I'm creating a search page similiar to many we've done here as our work as students at the college. The search form consists of multiple textboxes that the user can fill out. They must fill in at least 1 but can fill in more or all of them. I want the search to pull all matching records, if they put in ...

59. SQL Performance    coderanch.com

I think I have not written that with clarity. In the first option,After SQL execution,we are going to use java/perl to push the data.So question is "Should this comparison and assignment be done at SQL level as done in option 1 OR should this comparison and assignment be done in a program?"

60. SQL statment - issues with SUM    coderanch.com

ok, here is the deal: I have 2 tables: invoice & payments. the invoice include all information the customer needs to pay (hotel, flights...) the payments shows all payments done by him. So.... I am trying to get the SUM of all the invoice AND the SUM of all payments. it works...but not correctly. It if there are 5 arguments in ...

61. My SQl prob    coderanch.com

When i try to create a new database in mysql using the mysqladmin and encounter the following error the command typed by me is mysql>mysqladmin create petstore; ERROR 1064: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysqladmin create petstore' at line 1or

62. Calling SQL stored procedure from statment?    coderanch.com

Someone showed me that you can callable statement like this to the procedure: stmt = con.createStatement(); rs = stmt.executeQuery("my_storedprocudure '1','newyork',25,'US'") It actually works! I thought stored procedure only works with something like con.prepareCall("{call my_sp(?,?,?,?,?)}" then pass in the parameters. Will that achieve the same result? [ May 05, 2005: Message edited by: Richard Vagner ] [ May 05, 2005: Message edited ...

63. SQL Question: Getting the rank    coderanch.com

Hi, I've got a table called Persons, who contain persons. Each person has a value and I wish to get a "persons rank". I need to print the result in a browser btw. (not that it matters..) I tried the following: "SELECT COUNT(*) AS "nr" FROM (SELECT * FROM player ORDER BY player.score DESC) WHERE id = 10;" my idea was, ...

64. SQL question    coderanch.com

Hi, i am trying to understand something about correlated sql sub-queries. the following is taked from some web tutorial. regarding the third example, they say that since only the dept_id is returned by the sub query, there is no need for any subsequent table access. For these reasons, the third query would normally perform better than the first. thats looks incorrect ...

65. SQL questions    coderanch.com

66. SQL with multiple counts    coderanch.com

Hi guys, Heres my SQL for you. Table Rome S Rome D1 Rome D2 Rome D1 Geneva S Geneva S Geneva D1 Geneva D1 Tel-Aviv T1 Tel-Aviv T1 Tel-Aviv T1 Tel-Aviv D1 Tel-Aviv D1 Im trying to count how many S, D and T are there (mind that there might be D1 and D2) I tried this: SELECT city, type, count(type) ...

67. Dont know much sql in java...    coderanch.com

I've had an ongoing thread about making an administrator application in java that will be able to display update and delete table data. My question is: Where would i find how to make this same line in java: code: -------------------------------------------------------------------------------- $result = mysql_query($sql, $dbase) or die(mysql_error()); -------------------------------------------------------------------------------- thats from a php file i made. It also has: code: -------------------------------------------------------------------------------- $dbase = ...

68. Alternate SQL    coderanch.com

I have a SQL query that would work in Oracle... but if I change the DB then it would not work as I am using Oracle specific fn. (NVL). I do not have much of an experience with writing SQL queries. Some one please help me rewrite a generic query that would work on all DB. My oracle specific query is ...

69. SQL question: returning the posts between rank y and z    coderanch.com

Hi, I have a table containing "football players", each having a score (ie. their worth). I'd like to be able to return the posts between rank z and y. For instance the 10 best players (ie. z=1, y=10) or the players between rank 100 and 200 (ie. z=100, y=200). My table looks like the following: Player(name, age, score). Let's assume it's ...

70. sql newbie    coderanch.com

Made a sql database, can use select and insert. Made the database from notepad and renamed it .sql and works fine (mysql). How do I insert new rows into the database AND have the new rows saved in my .SQL file for permanent storage? Basically what i am saying is i can insert stuff but it does not save it for ...

71. SQL Array Question    coderanch.com

I am trying to learn about the interface java.sql.Array. The method getResultSet(long index, int count) is the one I am trying to use in my code. It says "Retrieves a result set holding the elements of the subarray that starts at index index and contains up to count successive elements." As this is an Interface I know I cannot use new ...

72. Problem with SQL where IN clause    coderanch.com

Hi Everyone I know this issue is not related to JDBC. Its more an sql question. I'm using ORACLE database. I have a query that looks something like this. select distinct sp.first_nm, sp.last_nm, psp1.prfl_value_txt from person sp, prfl_person psp1, acct asi where sp.src_person_id = psp1.src_person_id and psp1.prfl_value_id=6 and asi.acct_id in (200328,204659,237316,237592,238507,240121,300014,309084,330073,330614,340083) The problem is the acct_id's is a huge list of ...

73. Strange sql problem in jdbc    coderanch.com

75. Help with SQL    coderanch.com

I did not laid my Report like that. How come the positions of my values changed? I wrote 01/01 1000 EMPTY 1000 02/01 EMPTY 3000 3000 03/01 2500 1600 4100 In simple words, I meant that on one fine day only advance in lieu of order was received, so the total on that day was 1000. The next day some advance ...

76. eclipse plugin sql    coderanch.com

77. Help with SQL    coderanch.com

Hi All, I need some help with SQL Queries. I want to sort the rows in a table by three columns. The Sorting order can be ascending or descending and can be specified for each of the three columns. I think in SQL we can sort either all the columns ascending or all the columns descending. But is there a way ...

78. SQL in SQuirreL    coderanch.com

79. a very basic question on sql...    coderanch.com

There are really two answers to this question. Yes and no. Yes it is possible. Basically you do a join and can update multiple tables based on that. No because not all databases support that. Further, you must be doing a JOIN to make this work (you can't update un-related tables at the same time) and last because quite frankly I'm ...

80. SQL: Retrieve duplicate records    coderanch.com

81. SQL question - the missing ID    coderanch.com

82. sql problem - sum is Incorrect    coderanch.com

SELECT TI.ID, TI.firstName, TI.middleName, TI.LastName, DEP.depositeDate AS InsDatePay, DEP.depositAmount AS insAmnt, CRG.dueDate, MIN(FL.DepartureDate) AS leaving , MAX(FL.DepartureDate) AS returning, SUM(unit * charge) AS chgTotal FROM infoAS TI, deposit AS DEP, segments FL, payment AS CRG WHERE TI.ID = DEP.ID AND FL.ID = DEP.ID AND CRG.ID = DEP.ID AND DEP.Comment='insurance' AND TI.Status <>'cancelled' GROUP BY FL.ID

83. SQL    coderanch.com

84. SQL code to test    coderanch.com

Can someone try out this code? My JRE keeps crashing and until I can download a new one from Sun, (It keeps giving me a fatal exception),I need to know what it does and what exceptions might be thrown. Thank you! import com.sun.rowset.*; import java.awt.*; import java.awt.event.*; import java.io.*; import java.sql.*; import java.util.*; import javax.swing.*; import javax.swing.table.*; import javax.sql.rowset.*; public class ...

85. How to use sql.Array    coderanch.com

Sarah, I'm kind of curious what it is you're trying to do - I know you want to make a java.sql.Array, but why? What do you intend to do with it after that? Because Array is an interface, you'll probably need to create your own instance: public class MyArray implements Array{ .... } Create a constructor for this class that accepts ...

87. Running sql scripts    coderanch.com

88. sql question    coderanch.com

Originally posted by Abigail Moore: I have the following sql: SELECT customer_id, hierarchy_id, hierarchy_type_cd, primary_station, primary_type_cd FROM ebat.ha_station_hierarchy_811 WHERE customer_id = '9999999999' AND primary_station = '5629402401' This returns 2 rows of data where primary_type_cd is different. How do I change this sql so that it rolls the 2 rows of data into 1, ignoring the difference in the primary_type_cd? Thanks for ...

89. Dynamic Vs Static SQL    coderanch.com

Tom, The answer largely depends on the context. Normally you would speak of static vs dynamic SQL as applied to stored procedures, in which case static SQL refers to valid SQL constructs as per the SP syntax of the database at hand. Static statements may have parameters to be replaced with bind variables at runtime, but they are still static in ...

90. what is Transact - SQL ?    coderanch.com

91. What does IDENTITY mean in SQL?    coderanch.com

92. SQL NULL    coderanch.com

Arun, Paul is correct that rs will never be null. It sounds like JTest is passing null to the method, not the result set. This is to get you think about what should happen if null is passed. Should the code throw an IllegalArgumentException, pass silently, etc. Or if it could never happen, you can supress the test. I would throw ...

93. SQL SUBSTRING command problem    coderanch.com

Quite simple really, I have a table with a shift_id which is generated by date (ddmmyyyhhmmss) plus '_userid' (example 24032006132015_01). I need to check that a user doesn;t have a shift time for today already entered, so I'm checking the substring of the first 8 characters to see if they match todays date, here is my SQL command: [SELECT * FROM ...

94. Invoking SQL Loader from java vs JDBC application    coderanch.com

I have written a java applicaiton that uses JDBC to query a SQLServer database and writes tables to Oracle 10g. I know I can use SQLLoader to achieve the same thing, using control files and reading the result sets off a text file. Plus I am using log4j framework in the JDBC app to do all my logging stuff. With SQLLoader ...

95. SQL    coderanch.com

Im using a stored procedure to test data stored in my oracle database.I havnt access to the database other than through the java application. I was testing the oracle database seperatly but im getting an error.My procedure is returning more data than I have called.Is there a way to loop through and display all the data.Im trying to display a members ...

96. SQL ServerAgent restarting automatically    coderanch.com

HI, Our main internal application has been dying for last month at the same day on the same day. Looking at everything, We noticed SQl Server Agent was restarting at that time for no apparent reason. This is what we get: 2006-04-15 14:50:15 - ? [393] Waiting for SQL Server to recover databases... 2006-04-15 14:50:21 - ? [100] Microsoft SQLServerAgent version ...

97. MY SQL    coderanch.com

98. Java and SQL    coderanch.com

Hey all. I'm working on a project and I would like to use java with a sql database. I don't know a whole lot about sql (though I understand its not too terrible difficult)and I have no idea how to make it interact with java at all. Does anyone know of any guides that might help me get started or what ...

99. regarding SQL injuctions    coderanch.com

100. sql debugger    coderanch.com

Do you just want to see query results? MySql has an administration tool that allows you to issue queries and see the results. There's also a command-line interface. If you're looking to step through statements, I'm not aware of a specific tool that allows you to do this with mySql, although such tools do exist for other RDBMS and it would ...