mysql 6 « mysql « Java Database Q&A





1. paging with mysql and java    coderanch.com

hello friends, i am looking for a database paging for my application. i am using mysql. after some search, i found that there is two queries that would help to get total no of records and also paged data...what i found is given below mysql> SELECT SQL_CALC_FOUND_ROWS * FROM tbl_name WHERE {condition} LIMIT 10, 10; mysql> SELECT FOUND_ROWS(); but am very ...

2. Access denied to me in mysql    coderanch.com

I have used the following piece of code to connect to a MySql database.The error message that i get is "Access denied for user 'ROOT'@'TRELSTON' (using password: YES)". Please check the code and see if it is perfect or i have made a mistake somewhere or this error is because i have no access to the database. My PM thinks i ...

3. MySQL DataBase    coderanch.com

Hello friends, I had wrote a programe for establish a connection MySql database using JDBC. My Programming code is import java.io.*; import java.sql.*; public class JdbcConnection { public static void main (String[] args) { System.out.println("Copyright 2004, R.G.Baldwin"); try{ String userName = "root"; String password = "admin"; String url = "jdbc:mysql://localhost:3306/test"; Class.forName ("com.mysql.jdbc.Driver").newInstance (); Connection conn = DriverManager.getConnection (url,userName ,password ); System.out.println ...

4. maximum range in mysql 5.0    coderanch.com

Hello! Please give me answer the following. maximum database in a server. maximum tables in a database. maximum rows in a table. I have known about there is 60000 tables and 50 millions record in a server. I use window XP sp_2 and mysql server 5.0.45. Can i store image and file, and process them with my web application.

6. where i put drive of mysql ?    coderanch.com

7. MySql Tuning    coderanch.com

8. does mysql support pl/sql?    coderanch.com

9. mysql network from home    coderanch.com

Hi guys. I have two macs, one is a laptop with mysql, the other is a mac mini. I have mysql installed and running fine on the laptop, and a JDBC application running on the mini that needs to access the database in the laptop. How can I connect from my mac mini to my mysql server on the laptop (I ...





11. Using MySql with a Java Web App    coderanch.com

12. MySQL Case Sensitive Problem    coderanch.com

Hi I have a jsp website which requires users to fill up verification code which is case sensitive when users register or login. However, if user signed in with Capital letter (according to the code image generated), it returned error. If user signed in using all small cap, it is ok. Is it related to MySQL problem? I use MySQL 5.0, ...

13. How to integrate mysql databases    coderanch.com

14. displaying data from mysql database.    coderanch.com

15. Database on MySQL Server    coderanch.com

Dear Friends, I have following SQL code for database: "Statement stmt=con.createStatement(); boolean b=stmt.execute("CREATE TABLE user(emailid VARCHAR(30) NOT NULL, password VARCHAR(12), PRIMARY KEY(emailid))");" which is not executing on my mysql server database. giving exception like this : "org.apache.jasper.JasperException root cause : java.lang.NullPointerException" How can i create table in my MySql database on remote server. Connection is getting establised properly.How can i eliminate ...

16. Web App cannot see Mysql data    coderanch.com





17. MySQL auto increment    coderanch.com

Hi. I have an 'ID' column for my database (MySQL) which is set to auto_increment. Everytime I add a row, the 'id' auto_increments. How do I get the auto_incremented 'ID' value ? I doubt if I get the most recently added row would work because what happen if there maybe a chance someone did an insert after you very quickly ? ...

18. Store Java object in MySQL Database    coderanch.com

Originally posted by Chetan Parekh: I want to store and retrive Java object in MySQL database. How can I do that? Is there any samlpe code? Reg, Chetan Hello Chetan, This can be done in multiple ways but i can tell you one approach for the same.You can use JDO i.e. Java Data Objects API and call its methods ...

19. Store text file in MySQL    coderanch.com

Satish's reply assumes that you want to store the text file all at once. If that is the case, then that is the way to go. However, if you have data in the text file that you want to split up into separate rows and columns, you need to parse the file first and then insert each row into the database. ...

20. Pool Manager with MySQL JDBC    coderanch.com

I try to use Pool Manager 2.0 to handle database connection to MySQL from JSP. But it returns an execption : Exception Report: javax.servlet.ServletException: javax/sql/ConnectionEventListener at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:442) at org.apache.jsp.JDBCtest_jsp._jspService(JDBCtest_jsp.java:123) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:200) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:379) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:453) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:254) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:194) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:255) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:225) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) ...

21. cloudscape vs mySQL    coderanch.com

22. javaserlvet&xml&mysql    coderanch.com

There are plenty of tutorials about which cover some or all of this technology, but before I can recommend one, I really need to know a bit more about what you plan to do with these buzzwords. Can you give us an example scenario of what a user would provide as input, then how that informatiom would flow through and the ...

24. Problem of my java code with mysql database.Thanks~    coderanch.com

Thanks in a million times for your kind help. i am really exhausted by this problem And this is a simple java code running on linux and i just try to connect it with mysql database. when i insert a new record, it is ok and i can find the new row in the right table in the database. but when ...

25. What type of MySQL    coderanch.com

To run Java Servlets and Java Server Pages, I have installed in my PC the following softwares below: - OS=Windows98 - Tomcat v. 4.1.27.exe - J2SE/JDK v. 1.3.1 I am now studying Integrating Web Application With Database, for this reason, I have to install the MySQL in my PC. There are things to consider in choosing the type of MySQL to ...

26. JDBC & MySQL    coderanch.com

27. MySQL problem    coderanch.com

I have a application using a MySql database. The application retrieves information and prints it out. That bit is all working. But the problem I have when I print out the information e.g. dith m I get dith m,.When I query the table the information comes out correct its only when the data is retrieved do I have problem..If any would ...

28. MVC mySQL    coderanch.com

29. Execute mysql commands using java program    coderanch.com

Hi all.... I want to execute mysql commands using java program. This is the sample program i wrote. import java.io.BufferedInputStream; import java.io.IOException; import java.io.*; public class ExecLs { static public void main(String[] args) { String cmds = "mysql test -u root --password=inapp12 --execute='show tables'"; try { Process ps = Runtime.getRuntime().exec(cmds); System.out.print(loadStream(ps.getInputStream())); System.err.print(loadStream(ps.getErrorStream())); } catch(IOException ioe) { ioe.printStackTrace(); } } // read ...

30. java application with mysql database    coderanch.com

hi, I have to make a small application in java where there is a form and the data goes inside a mysql database. The application will run as independent executable file.its very small application. Can any one explain me as how to do it. I am using eclipse as developing tool. Iam new to java and want to try making this ...

31. Help on mysql    coderanch.com

Hi Everyone, I am using MySQL as a database and am trying to run a sample program to fetch and display data from a table... I am getting the following error: Exception in thread "main" java.lang.NoClassDefFoundError: org/aspectj/lang/Signature at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:164) at com.sitepoint.ToDoList.(ToDoList.java:12) at com.sitepoint.ToDoTest.main(ToDoTest.java:6) Is this a classpath problem. I am using eclipse ide to run the project. Also ...

32. Automatic Generate Text File from mySQL    coderanch.com

33. Stroring Word Documents into MYSQL Database    coderanch.com

Word documents are only binary data: you should be able to store them as BLOBs in an SQL database... I don't use Hibernate though, so can't suggest anything there. This is probably better off in the JDBC forum. If you want Web app advice, try the Servlets or JSP forums - as a hint, you'll want to use a form (probably ...

34. Arabic in MySQL ...    coderanch.com

35. Stroing a Vector in MySQL    coderanch.com

36. Vector filtering VS. MySQL filtering    coderanch.com

Hello All, I am slightly confused on a small problem and was wondering if I could get your thoughts on it - I have a Vector of objects from which I need specific data - object where a=1 and b=2, etc. Then based on the results of one set of specifics (a=1, b=2), I need to extract other data from this ...

37. Vectors and chars, MySql Db    coderanch.com

There is no such thing as a "Char". There's a primitive type called "char", but you can't put a primitive in a Vector. That's what the wrapper classes like Integer (for int), Long, Float, Double, etc. are for. Try wrapping a char in a Character: vector.add(new Character(c)); To be honest though, I'm not sure you even need a vector here. If ...

39. Package Java app that uses MySQL    coderanch.com

I've written a Java application that uses a MySQL database. When i jar up the whole project it runs the GUI fine but it cant access the database. Im guessing it cant find the MySQL jar file its clearly going to need. Its using "mysql-connector-java-3.1.8-bin.zip". Someone gave me this solution here: *************** Create a directory, say it is C:\dev. From here ...

40. Accessing MySQL from NetBeans    coderanch.com

Hello! I am trying to get conncetion to MySQL database using this simple java class. package simpledbconnection; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; public class DBConnection { public static void main(String[] args) throws SQLException, ClassNotFoundException { Class.forName("com.mysql.jdbc.Driver"); System.out.println("Driver Loaded"); Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/MyNewDatabase"); System.out.println("Database Connected"); Statement statement = connection.createStatement(); ResultSet resultSet = statement.executeQuery("select * from counselors"); while ...

41. MySQL: how to enforce the NOT NULL constraint    coderanch.com

NULL is not an empty string. This is one of the short come of MySql: It has not yet implemented CHECK CONSTRAINTs so you have to enforce requirements like those for non-empty strings in the application layer until it fills that hole. A workaround is to have the application layer change empty strings to NULLs so that MySQL returns on error ...

42. MySQL    coderanch.com

hi, I'm new to java and MySql, I just downloaded MySql and trying to add a new scheme to the DB. I logged in as localhost because I don't know what else to log in as. I haven't set up any admin username or password. I just unzipped the MySql into a folder. I ran mysqld.exe --console Then MySQLQueryBrowser.exe to create ...

43. MySQL    coderanch.com

44. A Question About Mysql and netbeans    coderanch.com

45. MySQL: Collation Nightmare    coderanch.com

I'm not a fan of database character encoding and collations. They give me a headache, today being no different. I've extracted out the details of the problem so that it is reproducible. Personally, I feel like its a MySQL bug (I've been reading MySQL documentation all evening on the subject to no avail) so here's a simplified version: First, create a ...

46. Mysql database restore through java application...?    coderanch.com

Hi Members, I have to execute mysql command line syntax from java runtime, that should work in both windows and linux machine. I tried using the Runtime.getRuntime().exec("cmd /c mysql -u username -p pass databasename < c:backup.sql"); But this is not restoring my database, instead im getting the mysql version and options information in the console trace. Please help me to figure ...

47. MySQL Javax.mail Shared Drive    coderanch.com

Hello everyone, Here is a description of the problem: _Multiple desktops with access to a shared drive _Users need to be able to submit information to a MySQL database on the shared drive _A Java program will then extract information from the database and send automatic emails via the JEE Mail API My main concern is concurrency, I'll obvisouly have mutiple ...

48. how can find mysql database address?    coderanch.com

many thanks Mr. Scholtz & Mr. Ritchie OK i download a jar file (MySQL J-connector for JDBC) and now where I should put this guy and make a instance of it? I mean where do i should put them in my project and can I use of "set CLASSPATH" for this guy? many thanks Mr Scholtz & Mr. Ritchie .

49. mysql dump with WHERE or LIMIT clause    coderanch.com

50. what changes have to be made while migrating from 1.4 mysql jdbc to 1.5 jdbc    coderanch.com

Hi, I am compartively very new to concept of jdbc connection. i have done some jdbc programming using java 1.4. Few days back I completed my SCJP 1.5 certification. That's why I want to verify some of my previous code with Java 1.5 version. Now my question is what changes I have to make if I want to write the same ...

51. Match XML data value with the mysql database    coderanch.com

I know which xml elements match with which rows, but i don't want to do any hard coding..i am having so many database table and want to write a generic program for all. I have attached my xml file and database columns name...and also writing this program because i don't want any dependency on XSD.. ...

52. mysql browser logic    coderanch.com

What is the logic behind having a text box just like mysql query browser for a user interface in which one can type sql commands and get the result just like he does the same in a mysql command-line? Please let me know in detail ranchers .. I need to develop a UI of such a kind ..

53. mysql    coderanch.com

54. using MySql    coderanch.com

Hi all, I have developed an EJB application that accesses the database MySql that is shipped with the Glass fish server Sun Java System Application Server 9.1_01. The MySql database is running on port 3036. The database connection properties are mentioned in persistence.xml as: com.entity.client.Employee

55. bat file to Start and Stop mysql?    coderanch.com

56. MySQL question    coderanch.com

No it's terrible. Lol. Actually it's fine to have but keep in mind database query optimizes tend to choke on disjunctive (= OR) query paths. In other words, the more OR's you have, the great the possibility its going to run poorly. There are often ways you can eliminate OR using boolean logic, so try to find one. Otherwise, if your ...

57. exporting mysql into xml    coderanch.com

I've seen questions like this, and the simple answer is, you need to write a software program, possibly a short JDBC one, to do it. You can export the data into a flat format like CSV or as a database backup, but if you're looking for a more meaningful XML interpretation, databases simple aren't equipped to handle it. For example, consider ...

58. Issues upgrading Mysql 4.1 to Mysql 5.1    coderanch.com

59. Getting all the database names using java with MySql    coderanch.com

There is another thing... When I want to use a different database, I believe the sql command is: USE databaseName; So when I do... Statement s = conn.createStatement(); s.executeUpdate("USE databaseABC"); With the same connection object that was used to connect to first database, It doesn't throw an exception, but it doesn't seem to do anything either, as if its not in ...

60. MySQL prepareCall hangs    coderanch.com

I'm trying to prepare a CallableStatement for MySQL, and the prepareCall method hangs (using MySQL 5.0.21 and the 5.1.7 connector). If the call syntax isn't valid, it throws an exception to that effect. Also, I happened to find out that if I misspell the procedure name, it also throws an exception. But, if the call syntax is valid, as in {CALL ...

61. Problem in Configuring MySQL    coderanch.com

I am using Windows Vista Home Basic with Norton Internet Security 2009. My Windows firewall has been turned off by norton, as it provides its own firewall. I have installed mysql and I am trying to configure my mysql 5.1. While configuring at the last step "Applying Security setting" mysql throws an error saying that to "open the port 3306 TCP ...

62. using Java with an internet based mySQL Server?    coderanch.com

I have a free hosting service on x10hosting.com, and it does not appear that server side java is one of the services they offer, at least it isn't listed in their services, but I will ask. But I'm pretty sure it's a no go. Anyways, I hadn't thought about being "stuck" with an applet. This is just a hobby project, I ...

63. MySQL JDBC ConnectionPool Configuration in GrassFish v2.1    coderanch.com

Please Balu Sadhasivam I really want to know the secret? I remember that the last time I tried this with Oracle 10g XE I eqaully encountered the same problem which forced me to install the Enterprise Edition but the issue persited. Hence, I removed Oracle and come to MySQL, it was the re-occurrance of the same that force send this post. ...

64. MYSQL Synchronization    coderanch.com

I use mysqlyog for Synchronization. We are looking for two way DB Synchronization mechanisim/feature. We have requirement that we have same copy fo DB @ N (5) number of remote locations. Each one updated with a local client applications which will be updating the data locally on thier local DB. At the end of day we would like to syncrhonize between ...

65. MySQL localhost    coderanch.com

Hello All, I'm trying to install MySQL on my laptop. When I installed it successfully, my code didn't show the desired answer. so I removed and reinstalled MySQL and since then, even if I enter correct existing password followed by new password and confirm it. It shows me Error no 2003, "Can't connect to MySQL server on localhost(10061). I checked the ...

66. MySQL without MYSQL server running?    coderanch.com

In the past, I've always used MS Access as a database because I found the connection easy to set up and it is the only database software we have in school. Now I have read that it is not 'good practice' to use MS Access as a DB source at all. Now I want to move over to an 'acceptable' database ...

67. How to read data from an XML file and store it into database(MySQL) ?    coderanch.com

I see this question come up every few months. In short, there's no simple answer. Data in XML may be highly structured or highly unstructured and mapping it to a set of database tables is non-trivial. The issue of what fields to normalization (put in their own table) is cumbersome at best. For example, if you have a list of addresses, ...

69. wild cards in MySQL using jdbc    coderanch.com

Hello everyone. The following statements works from a MySQL command line: SELECT * FROM drug WHERE otherBrands LIKE '%?%' When I place it in the follow code there is a bad SQL message (below). If I remove the wildcards, the query runs fine. I've been playing around with variations of the MySQL statement with no luck. I am breaking a syntax ...

73. proper format display from mysql    coderanch.com

i am to display text stored in mysql on jsp page using javabean. i am done with it really but problem is that paragraph and line breaks need to be worked out. i need to show text in paragraphs but it comes as one piece para. i am also storing that info from another jsp/servlet pair. do have to do the ...

74. mysql simple doubt    coderanch.com

Primay key is one type of constraints.There should be a way to differentiate Primary keys in datbase. For example if i have another table called Dept with a primary key. if we don't specify primary key name in your table .there will be a conflict in database system. think that database has a SQL parser to understand give SQL statements. correct ...

75. Communications link failure with MySQL    coderanch.com

i'm trying to create a java application [it's been a while since i have], and i'm trying to connect to mysql with the latest connector/J [5.1.10] and on my windows 7 machine i get the following error. but on my ubuntu laptop, it works just fine the code i'm running is this: PreparedStatement st = null; ResultSet rs = null; Item ...

76. Storing HTML Dependency/Skip logic in MySQL database    coderanch.com

I'm looking for some opinions on an issue my development team is wrestling with. Some background info. We are developing an application that dynamically generates UI screens (eventually thousands) based on information stored in a database to be used in part of our application. For every UI screen in this section of the app, we store a representation of the JSF ...

77. Different between Java DB and Mysql    coderanch.com

78. Storing Files larger than 1 GB in MySQL    coderanch.com

Friends, I've to store a binary file into database larger than max_allowed_packet size say e.g. 2 GB. How to do that? I hope you'll know that if you try the jdbc blob way you get an error saying that max_packet_size exceeded. -- Is there a way I can open a stream to a blob into a table's row and write data ...

79. MySql problem    coderanch.com

80. MySql synchronisation    coderanch.com

I am developing a Java application which will be used in 3 physical locations. Of these 3, on is the head office. I need to design in such a way that the head office application can see data from all 3 locations. My design is as follows: I am not making a web app with the DB hosted on web server. ...

81. mysql timestamp    coderanch.com

82. Unable to Access mysql database through JNDI.    coderanch.com

Dear Friends, I am trying to access mysql database through JNDI but I am not able to access it. I am not much familiar to JNDI. I am sending you the coding part of my programs. Kindly help me and tell where am I making a mistake - DatabaseCheck.java //jdbc packages import import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; import javax.sql.DataSource; //jndi ...

83. forum using mysql    coderanch.com

84. files needed for MYSQL    coderanch.com

85. Recover Mysql Dump file    coderanch.com

86. problem after installing mysql    coderanch.com

I have installed MySQL 5.1 on XP without issues. So it is debugging time. 1) If you type "cmd.exe" in the Start menu Run box, does the command prompt window open? 2) If you go into the Service control panel and shut down MySQL, does the command prompt work again? 3) How much free memory do you have after installing MySQL? ...

87. Mysql problem after instsalling    coderanch.com

89. mysql Connector/J prerequisites    coderanch.com

Installation is simple: download the zip or tar.gz file and unpack it somewhere. That is it. Prerequisites: you need to have a JVM and you must have access to a MySQL database. To use it, make sure the mysql-connector-java-3.1.14-bin.jar file is in your classpath. If you are running a standalone client (Java SE app), see the docs for the API calls ...

90. Issue with MySql 5 FKs    coderanch.com

Hi guys I have been having some trouble with MySql since it's upgrade and support of Foreign Keys. I have set up my Foreign Key in the tables tbl_user_details id (PK, Auto) firstname surname email tbl_user_secure id (PK, Auto) user_id (FK) sername password tbl_user_secure Foreign Keys has a reference setup linking it to tbl_user_details.id My Dao has the following: @Entity @Table(name ...

91. Download file from Mysql database    coderanch.com

Hi, I have written the following code to download a file from a MySql database using a Servlet.The problem i have is that i havnt done it right. Can someone please point me in the right direction. Any help will be greatly appreciated. Thank you for your help. import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PrintWriter; import ...

92. MySQL - would like to know if it matters.    coderanch.com

Dear experts, Currently, I am forced to learn how to use MySQL because majority of the web hosting company is using it. My question is that mysql is installed in windows XP but most of the plans are Linux plan. If I manage to create a database ( I believe I will need to struggle to create it - never learn ...

93. problem in mysql    coderanch.com

94. MySQL problems during retore by dumping    coderanch.com

96. Access to mysql database in server    coderanch.com

97. How to send a J2EE web application linked to mysql database to others?    coderanch.com

HI ALL, I have made a simple J2EE web application which has few pages which pick up and displays data from mysql database. I need to send this project to someone as a proof of my project work. How do I send it? I am using Netbean6.5 IDE and mysql database. I have included the driver in the library folder of ...

98. SHA output different for Java and for MySQL    coderanch.com

Greetings all, This code package door.model; import java.io.*; import java.util.*; import java.lang.reflect.*; import java.math.BigDecimal; import java.text.ParseException; import java.text.SimpleDateFormat; import java.text.DecimalFormat; import java.net.*; import java.sql.*; import org.apache.commons.codec.binary.*; // need to grab this from apache commons codec import java.io.UnsupportedEncodingException; import java.security.*; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class TestSha { /** * @param args */ public static void main(String[] args) { String clearText, encodedText, ...

99. Which DB- Postgre or MySql    coderanch.com

100. jdbc with mysql    coderanch.com