In the H2 console I clicked the 'Remove' button on the configurations. After several reinstall's these options are not restored so now my only option is a generic JNDI datasource which I don't want.
How do I restore them?
I am using a Mac.
There is a file in your home called .h2.server.properties.
This stores the config and can be removed and then reinstalled to repopulate this.
The configuration file h2.server.properties is located in {userHome} / delete it and re-execute your project, the plugin recreates the file again with the configuration restored.
Go to the home directory and find this file:
$ cd ~
$ ls -alh | grep "h2"
-rw-r--r-- 1 chaklader staff 1.9K Nov 1 18:02 .h2.server.properties
Open this file .h2.server.properties in your VSCode or any other editor. Copy this whole file or only the 2 rows that provides the H2 info:
#H2 Server Properties
#Mon Nov 01 18:53:17 BDT 2021
webSSL=false
webAllowOthers=false
webPort=8082
10=Generic DB2|com.ibm.db2.jcc.DB2Driver|jdbc\:db2\://localhost/test|
11=Generic Oracle|oracle.jdbc.driver.OracleDriver|jdbc\:oracle\:thin\:#localhost\:1521\:XE|sa
12=Generic MS SQL Server 2000|com.microsoft.jdbc.sqlserver.SQLServerDriver|jdbc\:microsoft\:sqlserver\://localhost\:1433;DatabaseName\=sqlexpress|sa
13=Generic MS SQL Server 2005|com.microsoft.sqlserver.jdbc.SQLServerDriver|jdbc\:sqlserver\://localhost;DatabaseName\=test|sa
14=Generic PostgreSQL|org.postgresql.Driver|jdbc\:postgresql\:test|
15=Generic MySQL|com.mysql.jdbc.Driver|jdbc\:mysql\://localhost\:3306/test|
16=Generic HSQLDB|org.hsqldb.jdbcDriver|jdbc\:hsqldb\:test;hsqldb.default_table_type\=cached|sa
17=Generic Derby (Server)|org.apache.derby.jdbc.ClientDriver|jdbc\:derby\://localhost\:1527/test;create\=true|sa
18=Generic Derby (Embedded)|org.apache.derby.jdbc.EmbeddedDriver|jdbc\:derby\:test;create\=true|sa
19=Generic H2 (Embedded)|org.h2.Driver|jdbc\:h2\:~/test|sa
0=Generic JNDI Data Source|javax.naming.InitialContext|java\:comp/env/jdbc/Test|sa
1=Generic Teradata|com.teradata.jdbc.TeraDriver|jdbc\:teradata\://whomooz/|
2=Generic Snowflake|com.snowflake.client.jdbc.SnowflakeDriver|jdbc\:snowflake\://accountName.snowflakecomputing.com|
3=Generic Redshift|com.amazon.redshift.jdbc42.Driver|jdbc\:redshift\://endpoint\:5439/database|
4=Generic Impala|org.cloudera.impala.jdbc41.Driver|jdbc\:impala\://clustername\:21050/default|
5=Generic Hive 2|org.apache.hive.jdbc.HiveDriver|jdbc\:hive2\://clustername\:10000/default|
6=Generic Hive|org.apache.hadoop.hive.jdbc.HiveDriver|jdbc\:hive\://clustername\:10000/default|
7=Generic Azure SQL|com.microsoft.sqlserver.jdbc.SQLServerDriver|jdbc\:sqlserver\://name.database.windows.net\:1433|
8=Generic Firebird Server|org.firebirdsql.jdbc.FBDriver|jdbc\:firebirdsql\:localhost\:c\:/temp/firebird/test|sysdba
9=Generic SQLite|org.sqlite.JDBC|jdbc\:sqlite\:test|sa
20=Generic H2 (Server)|org.h2.Driver|jdbc\:h2\:mem\:testdb|sa
Restart the H2 database and in the console you will need to provide the correct URL if you have any custom properties:
spring.jpa.show-sql=true
spring.h2.console.enabled=true
spring.datasource.url=jdbc:h2:mem:testdb
Try with the Generic H2 (Server) and you should be login now.
Related
Seems that the new release by default starts the Embedded Mongo when it's found on the classpath instead of using the mongo template defined in the application.properties.
The workaround is to temporary remove flapdoodle.embed from the dependency list even if it's in test scope
2020-06-24 09:22:53.048 INFO 51028 --- [ Thread-305] o.s.b.a.mongo.embedded.EmbeddedMongo : 2020-06-24T09:22:53.047+0200 I CONTROL [initandlisten] MongoDB starting : pid=51029 port=63665 dbpath=/var/folders/7x/ss8w17pd4bsfrg1x1t56sl00zq753h/T/embedmongo-db-20d4fbe0-abac-4715-8ae0-b863f7bc9627 64-bit host=M84452
This is discussed in https://github.com/spring-projects/sts4/issues/493.
The short version is that the behavior of the launch configs slightly changed due to the (now correct) usage of the "exclude test classes" checkbox of the Eclipse platform. Make sure that when you re-use existing launch configs that this checkbox is set correctly.
In my tomcat temp folder, I have 2.5Gb of +~JF****.tmp files, the file sizes are either ~750K or ~23M
$ pwd
/var/cache/tomcat7/temp
$ ls -lt
-rw------- 1 tomcat tomcat 23278008 06:47 5 Th08 +~JF2247741302721424357.tmp
-rw------- 1 tomcat tomcat 773236 06:47 5 Th08 +~JF2626850872018060030.tmp
-rw------- 1 tomcat tomcat 750984 06:47 5 Th08 +~JF6955350201064404318.tmp
-rw------- 1 tomcat tomcat 23278008 06:34 5 Th08 +~JF5760450811263657816.tmp
...
I did you searching for this problem but all I found is about Jasper Report font problem which doesn't make sense to me, my project is not using Jasper.
do you have any idea why?
thanks
We are facing a similar problem and I would like to share what I found:
java.awt.Font.createFont(int i, java.io.InputStream in) generates a temporary file with a name +~XXXX.tmp (where XXXX is a long number).
When the JVM ends, all these files are deleted.
The problem arises when the JVM ends abruptly, as it doesn't delete temporary files, or for long-running JVM (i.e.: Tomcat production server).
What we did was just change the font creation method and use:
java.awt.Font.createFont(int i, java.io.File f)
With this method a temporary file is not created anymore.
See bottom for conclusion:
I'm trying to use schemacrawler to diagram a sqlite database. My setup:
OSX 10.8
SchemaCrawler 10.5 downloaded from Here
Java version 1.7.0_45 downloaded from Oracle
sqlite version: 3.7.12 2012-04-03 19:43:07 86b8481be7e76cccc92d14ce762d21bfb69504af
I'm in the directory where I installed schemacrawler, and using this command line:
stebro$ java -classpath lib/*:. schemacrawler.tools.sqlite.Main /Library/Application\ Support/MyApp/Data/MyApp.db -command="select count(*) from myTable" -infolevel=maximum
SchemaCrawler 10.5
Copyright (c) 2000-2013, Sualeh Fatehi.
SchemaCrawler is a database schema discovery and comprehension tool.
You can search for database schema objects using regular expressions,
and output the schema and data in a readable text format. You can find
potential schema design issues with lint. The output serves for
database documentation is designed to be diff-ed against other database
schemas. SchemaCrawler also generates schema diagrams.
password:
java.sql.SQLException: Could not connect to database, for user null
at schemacrawler.schemacrawler.BaseDatabaseConnectionOptions.getConnection(BaseDatabaseConnectionOptions.java:93)
at schemacrawler.schemacrawler.BaseDatabaseConnectionOptions.getConnection(BaseDatabaseConnectionOptions.java:70)
at schemacrawler.tools.commandline.SchemaCrawlerCommandLine.execute(SchemaCrawlerCommandLine.java:173)
at schemacrawler.tools.commandline.SchemaCrawlerMain.main(SchemaCrawlerMain.java:93)
at schemacrawler.tools.commandline.SchemaCrawlerMain.main(SchemaCrawlerMain.java:52)
at schemacrawler.tools.sqlite.Main.main(Main.java:43)
Caused by: java.lang.IllegalArgumentException: Insufficient parameters for database connection URL: missing [database]
at schemacrawler.schemacrawler.DatabaseConfigConnectionOptions.getConnectionUrl(DatabaseConfigConnectionOptions.java:73)
at schemacrawler.schemacrawler.BaseDatabaseConnectionOptions.getConnection(BaseDatabaseConnectionOptions.java:89)
... 5 more
If I specify -password, I get the same error, and specifying various values for -user does the same. Sqlite requires no user/password - why is the jdbc or schemacrawler asking me for one?
Addendum:
Here is a specific series of commands that creates a simple database then attempts to diagram it with schemacrawler:
bash-3.2$ sqlite3 MyApp.db
sqlite3 MyApp.db
SQLite version 3.7.12 2012-04-03 19:43:07
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> create table smbtest(col1 integer, col2 integer);
create table smbtest(col1 integer, col2 integer);
sqlite> ^D
bash-3.2$ ~/bin/sunjava -classpath lib/*:. schemacrawler.tools.sqlite.Main -database=MyApp.db -infolevel=maximum -command=graph -outputformat=pdf -outputfile=myapp.pdf
SchemaCrawler 10.5
Copyright (c) 2000-2013, Sualeh Fatehi.
SchemaCrawler is a database schema discovery and comprehension tool.
You can search for database schema objects using regular expressions,
and output the schema and data in a readable text format. You can find
potential schema design issues with lint. The output serves for
database documentation is designed to be diff-ed against other database
schemas. SchemaCrawler also generates schema diagrams.
password:
Graphviz was not available to create the requested graph. Please reinstall
Graphviz, and make it available on the system PATH. Meanwhile, a .dot text file
has been created instead. This .dot file can be opened in any Graphviz file
viewer.
java.io.IOException: Cannot run program "dot": error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041)
at schemacrawler.tools.integration.graph.ProcessExecutor.execute(ProcessExecutor.java:124)
at schemacrawler.tools.integration.graph.GraphGenerator.generateDiagram(GraphGenerator.java:87)
at schemacrawler.tools.integration.graph.GraphExecutable.executeOn(GraphExecutable.java:123)
at schemacrawler.tools.executable.SchemaCrawlerExecutable.executeOn(SchemaCrawlerExecutable.java:87)
at schemacrawler.tools.executable.BaseExecutable.execute(BaseExecutable.java:77)
at schemacrawler.tools.commandline.SchemaCrawlerCommandLine.execute(SchemaCrawlerCommandLine.java:176)
at schemacrawler.tools.commandline.SchemaCrawlerMain.main(SchemaCrawlerMain.java:93)
at schemacrawler.tools.commandline.SchemaCrawlerMain.main(SchemaCrawlerMain.java:52)
at schemacrawler.tools.sqlite.Main.main(Main.java:43)
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:135)
at java.lang.ProcessImpl.start(ProcessImpl.java:130)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1022)
... 9 more
Final conclusion:
The problem lay in the fact that the path to my db had a space in it; no combination of backslashing, double or single quotes, or both resolved the issue. Running the command from the same directory as my db file did the trick. The space issue may be due to my not understanding the right escape sequences to use in bash - I may have to double-escape the spaces if schemacrawler is spawning other processes using my name as part of the command line.
However, the app did continue to ask for my password, but just pressing enter allowed it to continue successfully.
Steve,
You need to specify the database like this:
"-database=/Library/Application Support/MyApp/Data/MyApp.db"
Notice the double-quotes to allow for the space in the path to the database file, and the -database command-line switch. I also removed the back-slash, since the whole switch in enclosed in double-quotes.
For help on the command-line, simply run:
java -classpath lib/*:. schemacrawler.tools.sqlite.Main
Sualeh Fatehi, SchemaCrawler
Generating DB Schema ER Diagram using SchemaCrawler We can visualize our DB schema using SchemaCrawler Download the latest package from here:
https://github.com/sualeh/SchemaCrawler/releases/
Copy _schemacrawler folder and rename it to schemacrawler to another location and add the directory path of the same to PATH Use GraphViz to create schema diagram http://sualeh.github.io/SchemaCrawler/diagramming.html
Cd into schemacrawler directory and run ./schemacrawler.sh(on mac and ubuntu env) with option as mentioned below.
You can run sample command to get the schema diagram in the form of png image for postgre db:
./schemacrawler.sh -command graph -outputformat png -outputfile=dh_er.png -loglevel=CONFIG -server=postgresql -host=localhost -port=5432 -database=testdb -user=testuser -password=testpass -infolevel=standard
To include/exclude some tables you need to define configuration
in schemacrawler.config.properties as example:
schemacrawler.table.pattern.include=.*askbot_activityauditstatus |.*askbot_anonymousanswer|.*askbot_anonymousquestion |.*askbot_askwidget|.*askbot_badgedata|.*askbot_bulktagsubscription |.*askbot_bulktagsubscription_groups|.*askbot_bulktagsubscription_tags
schemacrawler.table.pattern.exclude is the key. value of the same is the JAVA regex pattern
Note: If you are facing "SERVICE: Cannot run program "dot": error=2, No such file or directory" issue...
Please install below(for mac only):
Install the app : brew install graphviz
I don't think you are specifying -classpath correctly. I think you need a wrapper shell script around that command to expand each .jar in lib so that it's separated with : characters:
#!/bin/sh
classpath="."
for j in lib/*.jar
do
classpath=$classpath:$j
done
java -classpath $classpath schemacrawler.tools.sqlite.Main /Library/Application\ Support/MyApp/Data/MyApp.db -command="select count(*) from myTable" -infolevel=maximum
Just a stab-in-the-dark but that's the way I've always done it. Obviously this is more complicated if non-jar classpaths have to be included as well...
I'm woking with a team mate programming something in parallel with another group in the same solution.
But, my mate has a different version, the most recent, that is different from my own, older one. I would like to know if there's any way to know the exactly source version that I have on my machine, and then tell him to get the same change sets from the TFS Server.
Is this possible? There's any place that log this kind of information?
To see what versions you each have:
In Team Explorer / Source Code Explorer, you may right-click on a file and View History to see all change set history, and you may right-click on a file and select /advanced/Properties to see what you have in your workspace.
The corresponding command-line comands are tf history yourFileSpec see tf history on MSDN and tf properties yourFileSpec see tf properties on MSDN
To get a specific version:
You may right-click on a file in Source Control Explorer and get specific version. This also has a corresponding command-line of tf get [itemspec] [/version:versionspec] see tf get on MSDN
The tf info command will tell you the details of a file. Included in this information will be the local version (the changeset that you have locally) and the server version (the latest version on the server.)
C:\Temp>tf info filename.txt
Local information:
Local path : C:\Temp\filename.txt
Server path: $/Project/filename.txt
Changeset : 1099
Change : none
Type : file
Server information:
Server path : $/Project/filename.txt
Changeset : 1099
Deletion ID : 0
Lock : none
Lock owner :
Last modified: Thursday, May 26, 2011 10:04:49 PM
Type : file
File type : Windows-1252
Size : 619
When trying to deploy a VS2010 database project using the VSDBCMD tool, I get the following error:
SQL01268 .Net SqlClient Data Provider: Msg 5133, Level 16, State 1, Line 1 Directory lookup for the file "D:\MSSQL10_50\MSSQL10_50.MSSQLSERVER\MSSQL\Data\Data.mdf" failed with the operating system error 21(failed to retrieve text for this error. Reason: 1815).
SQL01268 .Net SqlClient Data Provider: Msg 1802, Level 16, State 1, Line 1 CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
However, if I take the SQL script generated by VSDBCMD and run it in SQL Management Studio, it works fine. Similarly, I can create the DB manually in Mgt Studio.
'Operating system error 21' is apparently Device Not Ready, but this looks spurious to me... The folder paths are all correct, and unlocking the security on the folders doesn't fix the issue (e.g. 'everyone' > full control). Also, there are no errors in the SQL log or event viewer on the server.
What is different between running VSDBCMD on the command line, and running the same SQL script through Management Studio??
Any ideas very welcome!
Chris
As per my own comments, this error was because the drive didn't actually exist.
If you are creating database with vsdbcmd in a server based on a dbschema, it would be nice to set path location for data and log files.
To change log path location in your .dbschema file:
<Element Type="ISql90File" Name="[YOUR_DATABASE_NAME_Data]">
<Property Name="FileName" Value="E:\YOUR DATA FOLDER\$(DatabaseName)_Data.MDF" />
<Element Type="ISql90File" Name="[YOUR_DATABASE_NAME_Log]">
<Property Name="FileName" Value="E:\YOUR LOGS FOLDER\$(DatabaseName)_Log.LDF" />
then import it into Sql Server using Command prompt:
CD\
"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VSTSDB\Deploy\vsdbcmd.exe" /a:Deploy
/cs:"Server=YOUR_SERVER\YOUR_INSTANCE;User Id=YOUR_USER;Password=YOUR_PASS;Pooling=false"
/dsp:Sql /dd+ /model:"C:\FOLDER\YOUR_DBSCHEMA_FILE.dbschema"
/p:TargetDatabase="YOUR_DATABASE_NAME"
More info on vsdbcmd: http://msdn.microsoft.com/en-us/library/dd193283.aspx