Re: Cannot get connection
Hi, According to JavaSE Javadocs: http://docs.oracle.com/javase/7/docs/api/java/lang/System.html user.dir User's current working directory so I don't quite understand why you seem to distinguish between them. Either case, I still do not understand why it works as expected under 166 and before, and fails under 168/169 It looks like either a bug in those later versions, or a behaviour change in the H2 specs. I will try asap that h2.baseDir system property I wasn't aware of until now, and see what happens. Regards, Carlos 2012/9/30 Thomas Mueller thomas.tom.muel...@gmail.com Hi, * jdbc:h2:h2/jplaydb *doesn`t work at all! It should create the folder and the database under user.dir as in prevoius H2 versions, I guess. No hope! Here is when I get the connection null. In this case, the database file should be created relative to the current working directory (see the docs), not relative to the user.dir. This always was the case for H2 (even in older versions). However, there is an exception if you use the system property h2.baseDir, in this case it is created relative to this directory. But in any case the connection returned by DriverManager is not null; either it works or it throws an exception (for me). Regards, Thomas -- You received this message because you are subscribed to the Google Groups H2 Database group. To post to this group, send email to h2-database@googlegroups.com. To unsubscribe from this group, send email to h2-database+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/h2-database?hl=en. -- Carlos Hoces jPlay project http://www.javaforge.com/project/jplay -- You received this message because you are subscribed to the Google Groups H2 Database group. To post to this group, send email to h2-database@googlegroups.com. To unsubscribe from this group, send email to h2-database+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.
Re: Cannot get connection
There are no error messages at all: the connection returned from the DriverManager is null. Yes, I use a relative path. This works perfectly under version 166 and before: if the folder does not exist, it is created by H2 engine, otherwise it's used. None of this happens with versions 168 and 169: no folder creation, no database creation. Even if the folder and database exists, it's no addressed at all. 2012/9/18 Brian iwor...@gmail.com Can you provide the error message? Or was the data just not there? I see you're using a relative path for the file - so the actual location of the file H2 is using would change depending on where (which working directory) your program is launched from. On Sunday, September 9, 2012 12:32:55 PM UTC-7, choces wrote: I've run into a trouble after switching from 166 to 168 version The url I use is as follows: jdbc:h2:h2/jplaydb Under 166 I get a connection w/o any trouble, and the database works perfectly. Soon after switching to either 168, or to the recent 169, w/o any changes in my codebase, I don't get a connection anymore. I've tried to use jdbc:h2:file:h2/jplaydb just in case, with no luck. I'm running it under JavaSE 1.7u7 either case. -- You received this message because you are subscribed to the Google Groups H2 Database group. To view this discussion on the web visit https://groups.google.com/d/msg/h2-database/-/e8e05JjMoxIJ. To post to this group, send email to h2-database@googlegroups.com. To unsubscribe from this group, send email to h2-database+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/h2-database?hl=en. -- Carlos Hoces jPlay project http://www.javaforge.com/project/jplay -- You received this message because you are subscribed to the Google Groups H2 Database group. To post to this group, send email to h2-database@googlegroups.com. To unsubscribe from this group, send email to h2-database+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.
Re: is there a tutorial anywhere on how to use prepared statements with H2 ?
http://docs.oracle.com/javase/tutorial/jdbc/basics/prepared.html 2012/3/30 Noel Grandin noelgran...@gmail.com google for jdbc preparedstatement On Fri, Mar 30, 2012 at 20:13, Christian MICHON christian.mic...@gmail.com wrote: Hi, I've now been using H2 for almost a year, extremely happy about its ease of use and performances. I'm currently trying to import lot of data into several tables, using always similar insert commands. I read somewhere that prepared statements could help speeding up partially (I've already experienced the usal no log, no undo and cache hints). I've been looking in many places, and I could only find a few java source files, but no tutorial, no concrete example. Where could I find some? Thanks again for this very nice tool. Regards, Christian -- You received this message because you are subscribed to the Google Groups H2 Database group. To view this discussion on the web visit https://groups.google.com/d/msg/h2-database/-/Pv6T6eatQCoJ. To post to this group, send email to h2-database@googlegroups.com. To unsubscribe from this group, send email to h2-database+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/h2-database?hl=en. -- You received this message because you are subscribed to the Google Groups H2 Database group. To post to this group, send email to h2-database@googlegroups.com. To unsubscribe from this group, send email to h2-database+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/h2-database?hl=en. -- Carlos Hoces jPlay project http://www.javaforge.com/project/jplay -- You received this message because you are subscribed to the Google Groups H2 Database group. To post to this group, send email to h2-database@googlegroups.com. To unsubscribe from this group, send email to h2-database+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.
Re: Criteria if a database should be embedded
Up to my knlowledge, embedding a database is a very convenient choice for stand alone desktop applications. Carlos Hoces jPlay project http://www.javaforge.com/project/jplay 2011/11/14 cnn nagesh...@gmail.com What will be the criteria to decide if the database should be embeded? I plan to develop a web application which is essentially CRUD and reporting style thanks -cnn -- You received this message because you are subscribed to the Google Groups H2 Database group. To post to this group, send email to h2-database@googlegroups.com. To unsubscribe from this group, send email to h2-database+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/h2-database?hl=en. -- You received this message because you are subscribed to the Google Groups H2 Database group. To post to this group, send email to h2-database@googlegroups.com. To unsubscribe from this group, send email to h2-database+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.
Re: Java 7 + H2 Database
Hi Thomas, I've recently ported my project from MySQL embedded to H2, and H2 have been running under Java 1.7 for a month by now, w/o any troubles. It's been tested under 1.7.0 and 1.7.u2 builds 6 and 8 I cannot say anything related to performance comparisons, since I haven't tested H2 under previous Java versions. I believe H2 would benefit from Java 1.7 enhancements, mostly related to the new NIO.2, but it would break compatibility with every other Java version. It could be interesting to port and build H2 to Java 1.7 just to see how it would perform, as a separate fork I mean. I would do it, just for testing purposes, but I'm afraid I lack SQL and database engine development knowledge enough :( Hi, I was wondering if anyone has ever tried to run H2 with Java 7? Any strange behavior, instability or crashes? Any performance improvements using the new Hotspot JVM? Thanks for your feedback -- Carlos Hoces jPlay development http://www.javaforge.com/project/jplay -- You received this message because you are subscribed to the Google Groups H2 Database group. To post to this group, send email to h2-database@googlegroups.com. To unsubscribe from this group, send email to h2-database+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.